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
1) Download nssm from http://nssm.cc/download/?page=download and extract nssm.exe, for example to %windir%\system32\ | |
2) Install your service: | |
nssm.exe install my-node-service c:\programs\nodejes\node.exe c:\my\server.js | |
3) Start it using net start: | |
net start my-node-service |
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/python -W ignore::DeprecationWarning | |
import sys | |
import os | |
""" | |
Experimental python script to kill processes on unix-like systems. | |
https://gist.github.com/2726360 | |
Looks for all established connections on a given port and kills their processes. |
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
python -m dbg codefile.py |
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
locale-gen en_US.UTF-8 | |
locale-gen de_DE.UTF-8 | |
/usr/sbin/update-locale LANG=en_US.UTF-8 | |
dpkg-reconfigure tzdata | |
aptitude update | |
aptitude safe-upgrade |
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/sh | |
kill -9 `ps au|grep 6.1|grep -v "grep"| awk '{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
# Install riak-0.14.2rc8 to Ubuntu 10.04 LTS 32 bit | |
# make sure you have a compatible build system and the ncurses and openssl | |
# development libraries installed, also git and curl: | |
sudo aptitude install build-essential libncurses5-dev openssl libssl-dev git-core curl -y | |
# download, build and install Erlang: | |
ERLANG=/opt/erlang |
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
# Git visual log displays commit tree view with who did what when and in which branch | |
git config --global alias.vlog 'log --graph --date-order --date=relative --pretty=format:"%C(cyan)%h: %Cblue - %an - %Cgreen %C(cyan)%ar:%Creset%n%s%n" --color' |
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 sys | |
""" | |
Save this file as c:\Python24\Lib\docprint.py or in your application or library directory. | |
File is maintained as a gist at github: https://gist.github.com/1334355 | |
""" | |
def write(txt): |
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
# recipe-137951-1.py | |
# from http://code.activestate.com/recipes/137951-dump-all-the-attributes-of-an-object/ | |
# created by (C) Philip Kromer http://code.activestate.com/recipes/users/552075/ | |
# forked as https://gist.github.com/1291055 | |
# licence = psf http://code.activestate.com/recipes/tags/meta:license=psf/ | |
# On python attributes and methods read: http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.html | |
from cStringIO import StringIO | |
import sys |
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
<?php | |
echo "Connecting to MySQL Server ... "; | |
mysql_connect( | |
"localhost", | |
"admin", | |
"pass123") | |
or die(mysql_error()); | |
echo "[OK]<br />"; |