Last active
October 11, 2015 16:58
-
-
Save gertcuykens/3890716 to your computer and use it in GitHub Desktop.
.profile
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 | |
PATH="$PATH:$HOME/.cabal/bin:$HOME/.ghc/bin:$HOME/.emacs.x/bin" | |
export DISPLAY=:0 | |
. .X | |
if [ "$TERM" = "linux" ]; then | |
echo -en "\e]P0000000" #black | |
echo -en "\e]P82B2B2B" #darkgrey | |
echo -en "\e]P1D75F5F" #darkred | |
echo -en "\e]P9E33636" #red | |
echo -en "\e]P287AF5F" #darkgreen | |
echo -en "\e]PA98E34D" #green | |
echo -en "\e]P3D7AF87" #brown | |
echo -en "\e]PBFFD75F" #yellow | |
echo -en "\e]P48787AF" #darkblue | |
echo -en "\e]PC7373C9" #blue | |
echo -en "\e]P5BD53A5" #darkmagenta | |
echo -en "\e]PDD633B2" #magenta | |
echo -en "\e]P65FAFAF" #darkcyan | |
echo -en "\e]PE44C9C9" #cyan | |
echo -en "\e]P7E5E5E5" #lightgrey | |
echo -en "\e]PFFFFFFF" #white | |
#clear #for background artifacting | |
fi |
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 | |
lsmod | grep snd | |
cat /proc/asound/cards | |
cat /proc/asound/pcm | |
arecord -l | |
arecord -L | |
arecord -D hw:0,0 -d 10 /tmp/test-mic.wav | |
aplay /tmp/test-mic.wav | |
speaker-test -c2 -twav | |
alsamixer #m space up down < > |
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/sh | |
GOPRO=`ls $1 | grep GOPRO*` | |
AVI="avidemux --load $1/"`( echo "$GOPRO"; cat << EOF ) | sed 1q` | |
for line in `( echo "$GOPRO"; cat << EOF ) | sed 1d`;do | |
AVI="$AVI --append $1/$line" | |
done | |
$AVI | |
NAME=`echo "$1" | sed -e 's/^\(.*\)\.MP4$/\1\-SLOW.MP4/g'` | |
MP4Box -add $1#video -raw 1 -new temp_raw | |
MP4Box -add temp_track1.h264:fps=30 -new $NAME | |
#MP4Box -add temp_track1.h264:fps=30 -add normal.mp4#audio -new slow.mp4 | |
rm temp_* | |
if (( $2 \< 0 )) | |
then list=`ls $1 | grep "\-[0-9]*" | sort -k2 -n -t-` | |
else list=`ls $1 | grep "\-[0-9]*" | sort -k2 -n -t- -r` | |
fi | |
for l in $list; do | |
if [[ $l =~ (.*\-)([0-9]*)(.*) ]]; then | |
if [[ ${BASH_REMATCH[2]} == $3 ]]; then m=true; fi | |
if [[ $m == true ]]; then i=00$((BASH_REMATCH[2]$2)); i=${i:(-2)}; mv -v -n $1/$l $1/${BASH_REMATCH[1]}$i${BASH_REMATCH[3]}; fi | |
if [[ ${BASH_REMATCH[2]} == $4 ]]; then m=false; fi | |
fi | |
done | |
list=`ls $1 | grep "\-[0-9]*" | sort -k2 -n -t-` | |
echo "$list" | |
string="--load " | |
for l in $list; do | |
string="$string $1/$l --append " | |
done | |
read -p "append (y/n) = " | |
if [[ "$REPLY" == "y" ]]; then | |
avidemux ${string:0:-10} --output-format MP4 --save "append.mp4"; | |
else echo "canceled"; fi |
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 | |
dd if=/dev/zero of=IMAGEFILE bs=1 count=1 seek=SIZE | |
dd if=/dev/random of=KEYFILE bs=1024 count=1 | |
cryptsetup luksFormat --key-file KEYFILE --cipher aes-xts-plain --size 512 IMAGEFILE | |
cryptsetup luksOpen --key-file KEYFILE IMAGEFILE NAME | |
cryptsetup luksClose NAME |
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 | |
dpkg -l | awk '/^rc/ {print $2}' | xargs sudo dpkg --purge | |
dpkg -L name | |
dpkg -c name.deb | |
for i in $(dpkg -l | grep "^ii" | awk '{print $2}'); do aptitude why "$i"; done | grep "Unable to find" | |
aptitude search '?and( ?automatic(?reverse-recommends(?installed)), ?not(?automatic(?reverse-depends(?installed))) )' | awk '{ print $3 }' | xargs sudo dpkg -P | |
aptitude full-upgrade | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 16126D3A3E5C1192 | |
dpkg-query -S boot | |
mv /var/lib/dpkg/info/linux-generic.* /tmp/ | |
dpkg --force-remove-reinstreq --purge linux-generic | |
dpkg --install --force-confmiss ... |
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 | |
sudo mount /dev/sdb1 /mnt | |
for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt/$i; done | |
sudo chroot /mnt | |
grub-install /dev/sdb | |
update-grub | |
/boot/grub/grub.cfg | |
exit | |
for i in /dev/pts /dev /proc /sys; do sudo umount /mnt/$i; done |
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 | |
sudo apt-get install lilo | |
sudo lilo -M /dev/sda mbr |
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 | |
sudo locale-gen en_US.UTF-8 |
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 | |
for i in /dev /dev/pts /proc /sys; do sudo mount -B $i chroot/$i; done | |
sudo chroot chroot | |
export HOME=/root | |
export LC_ALL=C | |
exit | |
for i in /dev/pts /dev /proc /sys; do sudo umount chroot/$i; done | |
sudo mount --bind /dev chroot/dev | |
chroot | |
mount none -t proc /proc | |
mount none -t sysfs /sys | |
mount none -t devpts /dev/pts | |
umount -lf /proc | |
umount -lf /sys | |
umount -lf /dev/pts | |
exit | |
sudo umount chroot/dev |
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 | |
sudo apt-get install openssh-server | |
ssh-keygen -t rsa | |
cat ~/.ssh/id_rsa.pub | ssh gert@locahost 'cat >> .ssh/authorized_keys' | |
ssh-add | |
openssl genrsa -out key.pem 1024 | |
openssl req -new -key key.pem -out req.pem | |
openssl x509 -req -in req.pem -signkey key.pem -out cert.pem | |
openssl pkcs12 -export -in cert.pem -inkey key.pem -name gert -out gert.p12 | |
openssl pkcs12 -in protected.p12.orig -nodes -out temp.pem | |
openssl pkcs12 -export -in temp.pem -out unprotected.p12 |
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 | |
#/etc/network/interfaces | |
ethernet-wol g | |
#/etc/init.d/halt | |
NETDOWN=no | |
#/etc/rc.local | |
echo -n mac > /proc/acpi/wakeup | |
#/etc/modules | |
options 8139too enable_wol=1 | |
post-install 8139too ethtool -s eth0 wol g | |
#./wol.py | |
import struct, socket | |
def wol(m): | |
m = m.split(':') | |
m = struct.pack('BBBBBB', int(m[0], 16), int(m[1], 16), int(m[2], 16), int(m[3], 16), int(m[4], 16), int(m[5], 16)) | |
m = b'\xff' * 6 + m * 16 | |
print(m) | |
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) | |
s.sendto(m, ('<broadcast>', 9)) | |
s.close() | |
wol('00:00:00:00:00:00') | |
#./wol.sh | |
python -c "import socket; | |
s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM); | |
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1); | |
s.sendto(b'\xff'*6+b'\x00\x00\x00\x00\x00\x00'*16, ('<broadcast>', 7));" | |
#./test.sh | |
depmod -a | |
echo -n mem > /sys/power/state | |
ethtool eth0 | |
ethtool -s eth0 wol pumbg | |
cat /proc/acpi/sleep | |
grep eth0 /proc/interrupts | |
lspci |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment