Skip to content

Instantly share code, notes, and snippets.

@hunter007VN
hunter007VN / Python hang
Created March 15, 2018 02:38 — forked from reywood/how-to.md
How to get a stack trace from a stuck/hanging python script
# How to get a stack trace for each thread in a running python script
Sometimes a python script will simply hang forever with no indication of where things went wrong. Perhaps it's polling a service that will never return a value that allows the program to move forward. Here's a way to see where the program is currently stuck.
## Install gdb and pyrasite
Install gdb.
```sh
# Redhat, CentOS, etc
@hunter007VN
hunter007VN / supermicro-mass-upgrade-ipmi.py
Created October 24, 2016 05:33 — forked from andrew-azarov/supermicro-mass-upgrade-ipmi.py
Mass upgrade script for supermicro ipmi, needs requests and requests_toolbelt
#!/usr/bin/env python
# coding=utf8
"""
Copyright (c) 2015 ServerAstra Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@hunter007VN
hunter007VN / scrape.sh
Created October 24, 2016 05:30 — forked from dalehamel/scrape.sh
Supermicro iKVM preview scraper
USER=
PASS=
IPMI_HOST=
SESSION_ID=$(curl -d "name=${USER}&pwd=${PASS}" "https://${IPMI_HOST}/cgi/login.cgi" --silent --insecure -i | awk '/Set-Cookie/ && NR != 2 { print $2 }')
ipmi_scrape()
{
curl -H "Cookie: ${SESSION_ID}" --insecure "https://${IPMI_HOST}/$1"
}
time=$(ruby -e 'require "time"; require "uri"; puts URI.escape Time.now.httpdate.gsub(",", "")')
@hunter007VN
hunter007VN / ngTodos.html
Created October 15, 2016 09:09 — forked from amejiarosario/ngTodos.html
angularJS routes todo app
<html ng-app="app">
<head>
<title>Hello Controllers in AngularJS</title>
</head>
<body>
<ng-view></ng-view>
<!-- Libraries -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular.min.js"></script>