Skip to content

Instantly share code, notes, and snippets.

View seraphyn's full-sized avatar
🏠
Working from home and loving' it

Christian M. Grube seraphyn

🏠
Working from home and loving' it
View GitHub Profile
@seraphyn
seraphyn / shrinkpdf.sh
Last active December 31, 2015 00:49
Shellscript um mit Hilfe von ghostscript PDFs zu verkleinern. Die DPI liegt bei 72 und sollte für Retina dann eher in Richtung 200 geändert werden. Ich habe so ein Display am Thinkpad nicht und somit ist es für mich noch obsolet. Aber die dpi sind ausreichend für "normale" Androidsmartphones und Tablets im Moment
#!/bin/sh
# Original by Alfred Klomp
gs -q -dNOPAUSE -dBATCH -dSAFER \
-sDEVICE=pdfwrite \
-dCompatibilityLevel=1.3 \
-dPDFSETTINGS=/screen \
-dEmbedAllFonts=true \
-dSubsetFonts=true \
-dColorImageDownsampleType=/Bicubic \
@seraphyn
seraphyn / browserselect
Last active December 31, 2015 07:59
Browserselect ist ein Script welches die ProzessID (PID) des momentan laufenden Browsers sucht und allen Programmen, welche eine Seite öffnen wollen, den laufenden Browser zuweist.
#!/bin/bash
# GNU GPL v3
# the order in which to execute the commands
# breaks on success
# available are the following commands:
#
# firefox_new_tab
# opera_new_tab
#
# firefox_new_win
@seraphyn
seraphyn / 000-default
Created January 11, 2014 13:17
000-default genutzt in der Anleitung Friendica in Debian Wheezy installieren
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/friendica
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/friendica>
Options Indexes FollowSymLinks MultiViews
@seraphyn
seraphyn / funtions.php
Created July 26, 2014 09:01
Lösung für RichSnippets in dem Theme Twenty Thirteen von Wordpress. Gehört zu dem Kommentar von Janet ( http://got-tty.org/archives/rich-snippets-in-wordpress-und-google.html#comment-6102) des Beitrages http://got-tty.org/archives/rich-snippets-in-wordpress-und-google.html
<?php
//mod content
function hatom_mod_post_content ($content) {
if ( in_the_loop() && !is_page() ) {
$content = '’.$content.”;
}
return $content;
}
add_filter( ‘the_content’, ‘hatom_mod_post_content’);
@seraphyn
seraphyn / sshantiscan_honeypot.sh
Created February 27, 2015 09:54
Put your sshd on another Port and if somebody scans port 22 he will be blocked for 10 minutes
#!/bin/sh
# Put SSHd on another Port
# If someone scans your typical sshport 22 he will be blocked for 10 Minutes
HP_IPT='/sbin/iptables'
HP_Port=22
HP_Time=600
$HP_IPT -N honeypot
$HP_IPT -A INPUT ! -s 127.0.0.1 -j honeypot
startup_message off
deflogin on
vbell on
vbell_msg " Wuff ---- Wuff!! "
defscrollback 1024
bind ^k
bind ^\
bind \\ quit
bind K kill
bind I login on
@seraphyn
seraphyn / style.css
Created June 21, 2015 15:34
Rewritten cleaner style.css for tasks version v0.6
* {
-moz-user-select: -moz-none;
margin: 0;
padding: 0;
text-decoration: none;
}
#content {
overflow: hidden;
color: #423E3E;
background: repeat scroll 0 0 #f3f3f3;
@seraphyn
seraphyn / ttrss-update.service
Created September 17, 2015 12:31
Start TinyTinyRSS update Service with systemd instead using cron.
# This file is part of my tinytinyRSSinstallation
# It is used by systemd under Debian Jessie
# WorkingDirectory=/var/www/html/ttrss must be YOUR Installationpath without
# ending slash /
#
# vim /lib/systemd/system/ttrss-update.service
# systemctl enable ttrss-update.service
# systemctl --system daemon-reload
# systemctl start ttrss-update.service
# systemctl status ttrss-update.service
mod_statusbar.create{
screen=0,
pos='bl',
fullsize=false,
systray=true,
template="%date || %>load || E: %netmon_avgin/%netmon_avgout W: %iwinfo_signal %iwinfo_ssid || %exec_tlpbattery %exec_temp || %workspace_pager ||%weather_tempC C %weather_wind || %exec_sera %exec_chris %exec_google PWK: %exec_pwk WP: %exec_wp GAuth: %exec_ggl %systray_dock",
}
mod_statusbar.launch_statusd{
date={
@seraphyn
seraphyn / 00logwatch
Created December 31, 2015 17:53
Encrypt Logwatch with gpg
#!/bin/bash
recipient_email=""
recipient_gpg_pub_key=""
sender_gpg_pub_key=""
file="$(mktemp)"
test -x /usr/share/logwatch/scripts/logwatch.pl || exit 0
/usr/sbin/logwatch --detail high > $file
test -s $file || exit 1