This file contains 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
$ ssh-keygen | |
Generating public/private rsa key pair. | |
Enter file in which to save the key (/root/.ssh/id_rsa): | |
$ cd .ssh | |
mv id_rsa.pub id_rsa_auxiliary.pub | |
mv id_rsa id_rsa_auxiliary | |
# http://rtomaszewski.blogspot.co.uk/2013/10/home-directory-and-dotfiles-management.html | |
# https://github.com/rtomaszewski/dotfiles/blob/master/.bashrc_rado_aux |
This file contains 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) Example can be found here | |
# https://github.com/rtomaszewski/dotfiles | |
# (2) | |
#alias homeshick="source $HOME/.homesick/repos/homeshick/bin/homeshick.sh" | |
git clone git://github.com/andsens/homeshick.git $HOME/.homesick/repos/homeshick | |
source $HOME/.homesick/repos/homeshick/homeshick.sh | |
# (3) | |
homeshick clone rtomaszewski/dotfiles |
This file contains 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 | |
TESTS[0]=a,b,c | |
TESTS[1]=1,2,3 | |
for row in "${TESTS[@]}"; do | |
IFS="," | |
set $row | |
col1=$1 | |
col2=$2 |
This file contains 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 os | |
import pyrax | |
conf = os.path.expanduser("rackspace_cloud_credentials.txt") | |
#pyrax.set_credential_file(conf, "LON") | |
pyrax.set_credential_file(conf) | |
cs = pyrax.cloudservers | |
servers = cs.servers.list() | |
print ("cloud server under your account:") |
This file contains 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
set itermExists to false | |
try | |
tell application "Finder" to get application file id "com.googlecode.iterm2" | |
set itermExists to true | |
end try | |
set terminalScpt to path to resource "terminal.scpt" in directory "Scripts" | |
set itermScpt to path to resource "iterm.scpt" in directory "Scripts" | |
if itermExists then |
This file contains 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
; This program adjust scroling of the mouse wheel on windows. | |
GLOBAL CONST $SPI_SETWHEELSCROLLLINES = 105 | |
$SPIF_UPDATEINIFILE = 0x1 | |
$SPIF_SENDWININICHANGE = 0x2 | |
$SPIF_SENDCHANGE = $SPIF_SENDWININICHANGE | |
$WHEEL_PAGESCROLL = 4294967295 ; Use this, if you want scroll one Screen at a time |
This file contains 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 myfunc(message): | |
""" | |
This is external function | |
@param message: this is string that is going to be printed | |
@return: none | |
""" | |
print("myfunc: %s" % message) |
This file contains 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 | |
iptables=$(iptables -nL) | |
ret=no | |
if echo $iptables | grep -q 'Chain INPUT .policy DROP.' ; then | |
if echo $iptables | grep -q 'Chain FORWARD .policy DROP.' ; then | |
if echo $iptables | grep -q 'Chain OUTPUT .policy ACCEPT.' ; then | |
if echo $iptables | grep -q 'Chain RS-RackConnect-INBOUND' ; then | |
ret=yes |
This file contains 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
public class JavaExample { | |
// with the next line commented the code is erroring out when we try to compile it | |
//public int number; | |
public JavaExample (int _number) { | |
number=_number; | |
} | |
public void show() { | |
System.out.println("[test " + number + "] list=%s"); |
This file contains 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
class Test1InstanceVariable: | |
mylist=[] | |
def __init__(self, number): | |
self.number= number | |
def add(self, i): | |
self.mylist.append(i) | |
def show(self): |