Skip to content

Instantly share code, notes, and snippets.

View herrbischoff's full-sized avatar

Marcel Bischoff herrbischoff

View GitHub Profile
@herrbischoff
herrbischoff / new_gist_file.sh
Created April 8, 2015 20:13
Check for Applications Listening on a Certain Port
sudo lsof -i -n -P | grep TCP
@herrbischoff
herrbischoff / new_gist_file_0
Created April 8, 2015 20:19
Temporary SSL certificate in Ubuntu
/etc/ssl/certs/ssl-cert-snakeoil.pem
/etc/ssl/private/ssl-cert-snakeoil.key
@herrbischoff
herrbischoff / nginx.conf
Created April 8, 2015 20:21
WordPress nginx + Apache
# The main config file, probably /etc/nginx/nginx.conf
user nginx;
worker_processes 4;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
#A maximum of 1024 concurrent connections.
worker_connections 1024;
}
http {
@herrbischoff
herrbischoff / cleanup.sh
Created April 8, 2015 20:31
Raspberry Pi Headless Server Cleanup
apt-get install deborphan -y && \
apt-get autoremove --purge libx11-.* lxde-.* raspberrypi-artwork xkb-data omxplayer penguinspuzzle sgml-base xml-core alsa-.* cifs-.* samba-.* fonts-.* desktop-* gnome-.* && \
apt-get autoremove --purge $(deborphan) && \
apt-get autoremove --purge && \
apt-get autoclean
@herrbischoff
herrbischoff / md5.md
Last active August 29, 2015 14:18
How to generate MD5 SHA-1 SHA-256

Calculate MD5 checksum:

md5 /tmp/1.iso

Calculate SHA-1 checksum:

shasum -a 1 /tmp/1.iso

Calculate SHA-256 checksum:

shasum -a 256 /tmp/1.iso

@herrbischoff
herrbischoff / compile.sh
Created April 8, 2015 20:53
Compile nzbget
./configure --with-libxml2-includes=/usr/include/libxml2 --with-libxml2-libraries=/usr/lib/x86_64-linux-gnu/libxml2.so
make
make install
make install-conf
make clean
@herrbischoff
herrbischoff / robot.txt
Last active August 29, 2015 14:18
Disallow certain crawlers
User-agent: SurveyBot
Disallow: /
User-agent: ia_archiver
Disallow: /
@herrbischoff
herrbischoff / apache2.conf
Last active August 29, 2015 14:18
Remove version info from output
ServerSignature Off
ServerTokens Prod
@herrbischoff
herrbischoff / apache2.conf
Created April 8, 2015 21:53
Disable hotlinking
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.com/.*$ [NC]
#RewriteRule \.(gif|jpg)$ – [F]
#RewriteRule \.(gif|jpg)$ http://www.example.com/wp-content/hotlinking.png [R,L]
@herrbischoff
herrbischoff / .htacess
Created April 8, 2015 21:55
Force file download
AddType application/octet-stream .csv
AddType application/octet-stream .xls
AddType application/octet-stream .doc
AddType application/octet-stream .avi
AddType application/octet-stream .mpg
AddType application/octet-stream .mov
AddType application/octet-stream .pdf