This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(",", "")') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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> |