#standalone running of clojure and leiningen using only jars and no scripts java -Xbootclasspath/a:../clojure-1.4.0/clojure-1.4.0.jar -cp ../leiningen-2.0.0-preview6-standalone.jar clojure.main -m leiningen.core.main help
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
require 'google/api_client' | |
client = Google::APIClient.new(:key => 'something') | |
client.authorization = nil | |
search = client.discovered_api('customsearch') | |
offset = 100 | |
1.step(10,10) do |i| | |
#cx is gotten from the API registration page |
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
sudo tcpdump -A -i wlan0 |& tee /tmp/out | |
figure out the exact post command and use net/http to execute it |
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
body { margin: 35px 0 0; } table { background: none; } /* header */ table td[bgcolor] { margin: 0 0 20px 0; padding: 5px; display: block; background-color: #eee; position: fixed; z-index: 100; top: 0; left: 0; width: 100%; box-sizing: border-box; } table td[bgcolor] b a { font-size: 12px; width: 99px; } table td[bgcolor] a { font-size: 12px; } .pagetop b { margin-right: 20px; } table tr[style]:nth-child(2) { height: 15px ; } tbody tr:nth-child(3) table { margin-left: 0; display: block; } tbody tbody tr:nth-child(3n) { height: 12px ; } tbody tr:nth-child(3n) table { width: 100%; } tbody { position: relative; } /* hide numbering */ tbody tbody td.title:first-child { font-size: 1px; visibility: hidden; } .title:nth-child(3) { position: relative; z-index: 1; padding: 0 0 2px 0; } .title a { font-size: 14px; } .title a:visited { color: #999; } .subtext { padding: 2px 0; color: #fff; position: relative; } .subtext * { z-index: 10; color: #444; } /* points */ .subtext span { font-weight: bold; position: absolute; le |
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
#get data about current RAID | |
#1 block = 1kb | |
cat /proc/mdstat | |
mdadm --detail --scan | |
#to get to the real fstab | |
mount /dev/md1 /tmp/1 | |
vi /tmp/1/etc/fstab #find out the md # of the partition that u want to reformat | |
mdadm --detail /dev/md6 #more details about that partition, especially the /dev/sda6 + /dev/sdb6 info |
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
#add a system user | |
sudo adduser --system --home=/opt/openerp --group openerp | |
#copying config files to correct locations | |
#The below commands make the file owned and writeable only by the openerp user and group and only readable by openerp #and root. | |
sudo cp /opt/openerp/server/install/openerp-server.conf /etc/ | |
sudo chown openerp: /etc/openerp-server.conf | |
sudo chmod 640 /etc/openerp-server.conf | |
#running the command |
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 httpd port 2812 and # Monit will run on port 2812 | |
allow sss:sss123 #set your username and password to loin to your Monit |
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
#Notice that when we created the user, we used –disable-password, which prevents us logging into the machine using a password. Therefore we’ll need to upload a ssh key for running the installer. Here, I will create a public and private keypair with the name id_rsa_gitolite. | |
sudo adduser --system --shell /bin/bash --gecos 'git version control' --group --disabled-password --home /home/gitolite gitolite | |
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
# ls with dates formatted as timestamps | |
ls -ahltr --time-style=+%Y%m%d%H%M |
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
sudo apt-get install libavcodec-extra-53 | |
#This method re-encodes the audio. This method is slow, and lossy (mostly noticeable when using low bitrates), but the resulting mp3 file is properly playable in most media players. There are ways to merge mp3s without re-encoding, but the duration of the files can often not be properly detected by most players. | |
cvlc aa.mp3 bb.mp3 cc.mp3 --sout "#transcode{acodec=mp3,ab=<bitrate>,channels=2}:std{access=file,mux=raw,dst=1.mp3}" --sout-keep | |
#much faster | |
sudo apt-get install vbrfix libid3-tools libav-tools | |
cat 1.mp3 2.mp3 3.mp3 > tmp.mp3 | |
#OR | |
ffmpeg -i concat:file1.mp3\|file2.mp3 -acodec copy tmp.mp3 |