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
| >>> import pkg_resources | |
| >>> pkg_resources.get_distribution("blogofile").version | |
| '0.7.1' |
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
| import pkg_resources | |
| distros = pkg_resources.AvailableDistributions() # scan sys.path | |
| for key in distros: | |
| for dist in distros[key]: | |
| print dist.name, dist.version |
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
| >>> import xmlrpclib | |
| >>> x = xmlrpclib.ServerProxy('http://127.0.0.1:9001/RPC2') | |
| >>> x.system.listMethods() | |
| ['supervisor.addProcessGroup', 'supervisor.clearAllProcessLogs', 'supervisor.clearLog', 'supervisor.clearProcessLog', 'supervisor.clearProcessLogs', 'supervisor.getAPIVersion', 'supervisor.getAllConfigInfo', 'supervisor.getAllProcessInfo', 'supervisor.getIdentification', 'supervisor.getPID', 'supervisor.getProcessInfo', 'supervisor.getState', 'supervisor.getSupervisorVersion', 'supervisor.getVersion', 'supervisor.readLog', 'supervisor.readMainLog', 'supervisor.readProcessLog', 'supervisor.readProcessStderrLog', 'supervisor.readProcessStdoutLog', 'supervisor.reloadConfig', 'supervisor.removeProcessGroup', 'supervisor.restart', 'supervisor.sendProcessStdin', 'supervisor.sendRemoteCommEvent', 'supervisor.shutdown', 'supervisor.startAllProcesses', 'supervisor.startProcess', 'supervisor.startProcessGroup', 'supervisor.stopAllProcesses', 'supervisor.stopProcess', 'supervisor.stopProcessGroup', 'supervisor.tai |
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
| def partial(fn, *pargs): | |
| """ | |
| Partial Function builder | |
| >>> f=lambda p1,p2: p1+p2 | |
| >>> pf=partial(f, 66) | |
| >>> pf(44) | |
| 110 | |
| """ | |
| def _(*args): | |
| plist=list(pargs) |
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
| /** | |
| * Map | |
| * | |
| * @author jldupont | |
| */ | |
| package com.cdf.front.types.client; | |
| import java.util.Iterator; | |
| import java.util.Set; |
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
| /* | |
| * Message Switch | |
| * | |
| * @desc Each subscriber gets at least the first occurence of a message-type: | |
| * it is the responsibility of the subscriber to return its "interest" | |
| * for a particular 'message type'. | |
| * | |
| * Suscribers must implement the 'mailbox' method. | |
| * | |
| * NOTE: 'no interest' map stored in the Agent |
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
| /* | |
| * A lightweight proc & task runner | |
| * | |
| * runner.js | |
| * | |
| * @author Jean-Lou Dupont | |
| * | |
| * @dependencies: | |
| * - oo.js ('method') | |
| */ |
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
| ip address | grep eth0 | grep inet | awk -F" " '{print $2}' |
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
| ip link | grep "link/ether" | awk -F" " '{print $2}' |
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
| #!/bin/bash | |
| # | |
| # Backup my rhythmbox database over to Google Docs | |
| # | |
| DATE=`date +%d%m%g` | |
| zip /tmp/rb${DATE} ~/.local/share/rhythmbox/rhythmdb.xml | |
| /usr/local/bin/google docs upload --folder=_backup --title=rb${DATE}.zip /tmp/rb${DATE}.zip |