From 49f29d7912e9b1d2f544ce1db3b70c0771f96bfb Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Mon, 1 Dec 2014 12:08:10 +0100 Subject: [PATCH] update push script --- files/.listing | 4 --- files/hashes.txt | 2 -- hashes.txt | 14 +++++---- index.html | 12 +++++--- nsa-dropbox.html | 46 ---------------------------- put.bash | 23 +++++++------- wlan-debian.html | 78 ----------------------------------------------- youtube-term.html | 31 ------------------- 8 files changed, 27 insertions(+), 183 deletions(-) delete mode 100644 files/.listing delete mode 100644 files/hashes.txt delete mode 100644 nsa-dropbox.html delete mode 100644 wlan-debian.html delete mode 100644 youtube-term.html diff --git a/files/.listing b/files/.listing deleted file mode 100644 index ba5c470..0000000 --- a/files/.listing +++ /dev/null @@ -1,4 +0,0 @@ -drwxr-xr-x 2 ftp ftp 4096 Mar 19 08:41 . -drwxr-xr-x 3 ftp ftp 4096 Mar 19 08:41 .. --rw-r--r-- 1 ftp ftp 2859 Mar 19 08:37 dvorak-0.74.map --rw-r--r-- 1 ftp ftp 10240 Mar 19 08:35 dvorak_dos.tar diff --git a/files/hashes.txt b/files/hashes.txt deleted file mode 100644 index 9f4ee44..0000000 --- a/files/hashes.txt +++ /dev/null @@ -1,2 +0,0 @@ -dd13e096acf6b9b95cace6943fe56577 dvorak-0.74.map -85f82d281bc3d4e48e375193fdaada66 dvorak_dos.tar diff --git a/hashes.txt b/hashes.txt index 5ab5088..4b2b845 100644 --- a/hashes.txt +++ b/hashes.txt @@ -1,15 +1,17 @@ 3d85a9b435eb833de088e45c3f56e49c ./dvorak.html 9e5b7702d73bfb7febb24bf58f0e8d60 ./hashes.txt -029ca90462962a4dbcc632e7cb87ce2a ./index.html +198a371dd238282e3fa78732be9fbfdb ./index.html 72ac29b74f3e09c551aa10a2a8d2581d ./lejos-ubuntu.html 0ba6cb2c3a9d7d8ba27406d215aa501e ./mart@martlubbers.net.asc -146f1bb6bed2adfd4d13f9644390db71 ./nsa-dropbox.html 75068866762dc200d6e185bfe9b3a2bf ./o.html ce31052406b3874b287e98c8a9477516 ./p.jpg -95b2932b7da95664dcef20097b1b58df ./put.bash +e0242c7228f6ef8da9747516c597f52c ./put.bash 43eb61826bc538817b4c78c7f8d57019 ./README.md 4be5b32df3dedb74eeb758b233864fe6 ./robots.txt -04c8dd2c53feada9530fcdba9285c016 ./style.css d69f225d06c3d7a417fb5e8159efc2d1 ./test.php -2ed34aa229468632cce58151c33d1ebc ./wlan-debian.html -d07dca8f45b3f046558216cf3ac96c28 ./youtube-term.html +146f1bb6bed2adfd4d13f9644390db71 ./archive/nsa-dropbox.html +2ed34aa229468632cce58151c33d1ebc ./archive/wlan-debian.html +d07dca8f45b3f046558216cf3ac96c28 ./archive/youtube-term.html +dd13e096acf6b9b95cace6943fe56577 ./files/dvorak-0.74.map +85f82d281bc3d4e48e375193fdaada66 ./files/dvorak_dos.tar +b92c31cd0dfde6e6e8322d2163f0d728 ./files/phonetic_dvorak.gz diff --git a/index.html b/index.html index 538e742..0625e25 100644 --- a/index.html +++ b/index.html @@ -61,11 +61,13 @@

Other Interests

- - Death/Doom metal
- - Hacking
- - Kung fu
- - Linux
- - Pokémon +

Suspended projects/archive

diff --git a/nsa-dropbox.html b/nsa-dropbox.html deleted file mode 100644 index 921e78e..0000000 --- a/nsa-dropbox.html +++ /dev/null @@ -1,46 +0,0 @@ - - - Use any untrusted cloud storage with encryption - - - -

PREREQUISITES

- Install encfs and fuse
-
# apt-get install fuse encfs
- Install a cloud service(copy.com used here)(assuming ~/bin is in your path and running on a 64bits machine)
- When using a different architecture just change x86_64 to x86 or armv6h in the client install script
- If ~/bin is not in your path add to your bashrc(example using user: test): -
PATH=$PATH:/home/test/bin
- Download and install the copy client for linux -
-$ wget https://copy.com/install/linux/Copy.tgz
-$ mkdir ~/bin/copy; tar -xf Copy.tgz -C ~/bin/copy
-$ ln -s ~/bin/copy/x86_64/CopyConsole ~/bin/CopyConsole
-
-

SETUP

-

Make sure your user is in the fuse group and setup the encfs share by doing this: -

-$ mkdir ~/.copy.encr ~/copy
-$ encfs ~/.copy.encr ~/copy
-
- When they ask use option p for paranoia and pick a password.
- Create an account on copy.com and setup the client by typing this command -
$ CopyConsole -u=the_mail_you_signed_up_with -r=/home/your_linux_username/.copy.encr -p=the_password_you_signed_up_with
- This creates a setup that does this automatically in the future
- Let the daemon and the encfs autostart when you and only you are logged in by adding this to ~/.bashrc -
-if ! mountpoint -q ~/copy; then
-    encfs ~/.copy.encr ~/copy
-fi
-if ! pidof CopyConsole >> /dev/null; then
-    CopyConsole -daemon 2>&1 1>/dev/null
-fi
-
- Congratulations your setup is working.
- When you want to stop the daemon you can kill the pid given by ~/.copy.pid.
- From now on your computer or server will ask one time for you password when the first bash starts in your account.

- -

NOTES

-

This could work with any cloud service, just mount the folder it wil sync first with encfs

- - diff --git a/put.bash b/put.bash index cd0b8fd..665e574 100644 --- a/put.bash +++ b/put.bash @@ -1,18 +1,19 @@ #!/bin/bash set -e -for f in $(find . -type f -not -name "*hashes*" | grep -v "put\|/\.\|^\.$\|/$") +files=$(find . -type f -not -iwholename "*.git*") +user=$(gpg -q --use-agent -d ~/pw/general.asc | grep ftpmartlubbers.net -A3 | grep -Po "(?<=user: ).*") +pass=$(gpg -q --use-agent -d ~/pw/general.asc | grep ftpmartlubbers.net -A3 | grep -Po "(?<=pass: ).*") + +for f in $files do - dir=$(dirname $f) - if [ "$(md5sum $f | awk '{print $1}')" = "$(grep $(basename $f) $dir/hashes.txt | awk '{print $1}')" ] + origmd5=$(grep "$f" ./hashes.txt | awk '{print $1}') + currmd5=$(md5sum "$f" | awk '{print $1}') + if [ "$origmd5" = "$currmd5" ] then - echo "$f didn't change..." + echo "$f is not changed" else - echo "$f did change..." - curl -u $(gpg --use-agent -d ~/passwd.gpg | grep ftp-user | awk '{print $2":"$3}') -T $f ftp://martlubbers.net/public_html/$f + echo "$f is changed" + curl -u "$user:$pass" -T $f ftp://martlubbers.net/public_html/$f fi done -echo "recalculating hashes" -md5sum ./* > hashes.txt -cd files -md5sum ./* > hashes.txt -cd .. +md5sum ./*{,/*} > ./hashes.txt diff --git a/wlan-debian.html b/wlan-debian.html deleted file mode 100644 index 8f35522..0000000 --- a/wlan-debian.html +++ /dev/null @@ -1,78 +0,0 @@ - - - Automatic wifi without heavy network manager on debian - - - -

PREREQUISITES

-

Install wpa_supplicant and wireless-tools(standard in most distros).
-

# apt-get install wireless-tools wpa_supplicant
-
- Identify your wifi controller. This can usually be found by typing
-
$ iwconfig
-
- Locate all the config files for your desired networks. Mine are placed in /etc/network/wifi/.conf. More info on creating configs in the end of the file.

- -

INSTALLATION

-

Create the SSID selection script.
- I've put mine in /etc/network/wifi/select
-

-#!/bin/sh
-ifconfig [INTERFACE] up 1> /dev/null && { iwlist [INTERFACE] scan | grep -o "\".*\"" | tr -d \'\" | sort | uniq; grep -o "map\ .*" /etc/network/interfaces | awk '{print $2}'; } | sort | uniq -d | head -1
-
-
- Make it executable.
-
# chmod +x /etc/network/wifi/select
-
- Change in /etc/network/interfaces the [INTERFACE] specification.
-
		
-mapping [INTERFACE]
-	script /etc/network/wifi/select
-	map [SSID]1
-	map [SSID]2
-	..
-	map eduroam
-
-iface [SSID]1 inet dhcp
-wpa_conf /etc/network/wifi/[SSID]1.conf
-
-iface [SSID]2 inet dhcp
-wpa_conf /etc/network/wifi/[SSID]2.conf
-
-..
-
-iface eduroam inet dhcp
-wpa_conf /etc/network/wifi/eduroam.conf
-
-
- You're finished! Restart the network service with:
-
# service networking restartworking restart
- And you can connect to a available network by running this command.
-
# ifup [INTERFACE]
- If you want to force an [SSID] you can run:
-
# ifup [INTERFACE]=[SSID]

- -

CONFIG CREATION

-

Standard wpa2 network configs can be created by running:
-

# wpa_passphrase [SSID] [PASSWORD] > /etc/network/wifi/[SSID].conf
-
- For eduroam you can use this example:
-
		
-network={
-	ssid="eduroam"
-	key_mgmt=WPA-EAP
-	eap=TTLS
-	phase2="auth=MSCHAPV2"
-	ca_cert="/etc/ssl/certs/AddTrust_External_Root.pem"
-	identity="login@university.nl"
-	scan_ssid=1
-	password="YOURPASSWORD"
-}
-
- If you don't want your password in a config you can also use a hash generated by this command. (Don't forget to remove it from ~/.bash_history afterwards)
-
$ echo -n [PASSWORD] | iconv -t UTF16LE | openssl md4
- You should replace the plaintext string with: "hash:[HASHOUTPUT]"
- note: don't use quotes.

-
update 2014-03-04: fixed a few small errors concerning hashing and config files
- - diff --git a/youtube-term.html b/youtube-term.html deleted file mode 100644 index 6f69543..0000000 --- a/youtube-term.html +++ /dev/null @@ -1,31 +0,0 @@ - - - Play youtube videos on a headless server - - - - Download the get_flash_videos latest version: -
$ git clone https://github.com/monsieurvideo/get-flash-videos.git
- Install the dependencies: -
# apt-get install perl libmodule-find-perl libwww-mechanize-perl vlc
- Install the get_flash_videos script: -
-$ cd get-flash-videos/
-$ make
-$ make install
-
- Create a small script that combines these with vlc by adding this to bashrc or a shellscript in PATH the flag -A alsa could be different(when usig pulseaudio it can be omitted): -
-function ytview {
-	if [ "$#" -ne "1" ]; then
-		echo "usage $0 yturl"
-	else
-		get_flash_videos -q -f - $1 | cvlc -A alsa -V aa -
-	fi
-}
-
- Play a video by typing: -
$ ytview http://www.youtube.com/watch?v=QAUzWtLMnU0
- Some videos can't be downloaded, but most videos will just work. - - -- 2.20.1