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 update && sudo apt-get dist-upgrade -y |
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
mkdir /tmp/win | |
sudo mount -t cifs //192.168.1.23/temp -o username=mike /tmp/win |
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 | |
arecord -D "plughw:1,0" -q -d 3 -f cd -t wav | ffmpeg -loglevel panic -y -i - -ar 16000 -acodec flac file.flac > /dev/null 2>&1 | |
wget -q -U "Mozilla/6.0" --post-file file.flac --header "Content-Type: audio/x-flac; rate=16000" -O - "http://www.google.com/speech-api/v1/recognize?lang=en-us&client=chromium" | cut -d\" -f12 | |
rm file.flac > /dev/null 2>&1 |
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
#!/usr/bin/python | |
import wolframalpha | |
import sys | |
#Get a free API key here http://products.wolframalpha.com/api/ | |
#I may disable this key if I see lots of abuse | |
app_id='Q59EW4-7K8AHE858R' | |
client = wolframalpha.Client(app_id) | |
query = ' '.join(sys.argv[1:]) |
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
# install bluetooth tools | |
sudo apt-get install --no-install-recommends bluetooth | |
# find MAC address (needs to be discoverable) | |
hcitool scan | |
# ping it | |
sudo l2ping -c 1 12:34:56:78:90 | |
# Connect by MAC |
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
a=$(/sbin/iwconfig wlan0 | awk '/Link Quality/ {print $2}' | sed 's/.*\=//'); | |
echo $(($((${a%/*} * 100)) / ${a#*/}))%; |
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 signal | |
def handler(signum, frame): | |
print 'Got CTRL+C' | |
exit (0) | |
signal.signal(signal.SIGINT, handler) |
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 stdbuf -oL tshark -i wlan0 -I -R 'wlan.fc.type_subtype != 0x08' -T fields | |
-E separator=, -E quote=d -e wlan.sa -e wlan_mgt.ssid -e frame.time -e radiotap. | |
dbm_antsignal |
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 lighttpd -y | |
sudo apt-get install php5-cgi -y | |
sudo sh -c "echo '<?php phpinfo(); ?>' > /var/www/phpinfo.php" | |
sudo sh -c "echo 'cgi.fix_pathinfo = 1' >> /etc/php5/cgi/php.ini" | |
sudo lighty-enable-mod fastcgi | |
sudo lighty-enable-mod fastcgi-php | |
sudo /etc/init.d/lighttpd restart |
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 libjpeg8-dev imagemagick libv4l-dev | |
sudo ln -s /usr/include/linux/videodev2.h /usr/include/linux/videodev.h | |
wget http://sourceforge.net/code-snapshots/svn/m/mj/mjpg-streamer/code/mjpg-streamer-code-182.zip | |
unzip mjpg-streamer-code-182.zip | |
cd mjpg-streamer-code-182/mjpg-streamer | |
make mjpg_streamer input_file.so output_http.so | |
sudo cp mjpg_streamer /usr/local/bin |
OlderNewer