Skip to content

Instantly share code, notes, and snippets.

View opexxx's full-sized avatar

Alexander Knorr opexxx

View GitHub Profile
@opexxx
opexxx / ssh_tunnel
Last active August 29, 2015 14:21 — forked from jarus/ssh_tunnel
#!/bin/sh
# Simple init script to dig a ssh tunnel
# Author: Christoph Heer <christoph.heer@googlemail.com>
SSH_ARGS="user@remote.host -p 22 -N -n -L 4950:localhost:4949"
PID_FILE="/var/run/remote_host_tunnel.pid"
case "$1" in
start)
if [ -f $PID_FILE ]; then
@opexxx
opexxx / ntfsutil.sh
Last active August 29, 2015 14:21 — forked from jsfaint/ntfsutil.sh
#!/bin/bash
mount_disk()
{
sudo umount $disk
mkdir ~/Desktop/$diskname
sudo mount_ntfs -o rw,auto,nodev,nobrowse,noowners,noatime $disk ~/Desktop/$diskname
echo "Mount $disk to ~/Desktop/$diskname"
open ~/Desktop/$diskname
}
# install dependencies
sudo apt-get install libcurl4-openssl-dev libncurses5-dev pkg-config automake yasm
# clone cpuminer
git clone https://github.com/pooler/cpuminer.git
# compile
cd cpuminer
./autogen.sh
./configure CFLAGS="-O3"
@opexxx
opexxx / opt.md
Last active August 29, 2015 14:21 — forked from Alexnder/opt.md

Оптимизация png без потерь

apt-get install pngcrush

for file in *.png ; do pngcrush -reduce -brute -rem alla -rem gAMA -rem cHRM -rem iCCP -rem sRGB "$file" "${file%.png}-crushed.png" && mv "${file%.png}-crushed.png" "$file" ; done

Оптимизация jpg без потерь

apt-get install jpegoptim

jpegoptim *.jpg --strip-all

install

apt-get install squid3

configure

nano /etc/squid3/squid.conf

config file

http_access allow all
http_port 3128

cache_dir ufs /var/spool/squid3 1024 16 256
@opexxx
opexxx / xor.py
Last active August 29, 2015 14:21 — forked from 013/xor.py
#!/usr/bin/python
# -*- coding: UTF-8 -*-
string = "something something something"
key = "cheese"
def crypt(string, key):
data = ''
for i in range(len(string)):
@opexxx
opexxx / pi-btsync.sh
Last active August 29, 2015 14:21 — forked from firmread/pi-btsync.sh
###
# setup btsync in pi
###
mkdir ~/.btsync && cd ~/.btsync
#wget http://btsync.s3-website-us-east-1.amazonaws.com/btsync_arm.tar.gz
wget https://download-cdn.getsyncapp.com/stable/linux-arm/BitTorrent-Sync_arm.tar.gz
tar -xvf BitTorrent-Sync_arm.tar.gz
echo "# run btsync and web interfact at port 8888" >> ~/.bashrc
sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install netatalk
# already netatalk's dependency but if no netatalk, totally do this
# sudo apt-get install avahi-daemon
# so we can find raspberrypi.local
@opexxx
opexxx / rpi-todo.md
Last active August 29, 2015 14:21 — forked from vancetran/rpi-todo.md

Raspberry Pi: BitTorrent Sync

This Gist will install and configure BitTorrent Sync on a Raspberry Pi running Raspbian. By default, BT Sync will be bound to the address 127.0.0.1. Meaning the web interface is not accessible from any machine besides the Pi. This script will enable access from any machine on the network.

Installation

To perform the default installation of BT Sync, simply execute the following after SSHing onto the Pi.

curl -s -L http://go.trav.sh/pi_btsync | bash