Skip to content

Instantly share code, notes, and snippets.

@jiphex
jiphex / backup_mysql.sh
Created August 3, 2011 09:23
Remote MySQLdump backup with Rsync driver
#! /bin/bash
# script to backup MySQL data to remote server
# James Hannah - January 2009
# set some variables
FILENAME="`date +mysqldump-%Y-%m-%d-%H:%M:%S`.sql"
LOCALFILE="/home/sql_backup/$FILENAME"
LOCKFILE="/tmp/sqlbackup.lock"
BACKUPSERVER="10.1.1.1"
MYSQLPASS="secretsgohere"
@robulouski
robulouski / gmail_imap_example.py
Last active April 19, 2024 02:27
Very basic example of using Python and IMAP to iterate over emails in a gmail folder/label. http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
#!/usr/bin/env python
#
# Very basic example of using Python and IMAP to iterate over emails in a
# gmail folder/label. This code is released into the public domain.
#
# RKI July 2013
# http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
#
import sys
import imaplib
@staltz
staltz / introrx.md
Last active July 29, 2024 05:55
The introduction to Reactive Programming you've been missing
@LeonardoCardoso
LeonardoCardoso / ScrollTextView.java
Last active January 21, 2022 07:37
TextView with continuous scroll marquee animation no matter where the Activity focus is.
public class ScrollTextView extends TextView {
public ScrollTextView(Context context) {
super(context);
}
public ScrollTextView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@andyrbell
andyrbell / scanner.sh
Last active July 9, 2024 16:43
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
@PatrickLang
PatrickLang / README.md
Last active June 10, 2024 18:36
Yubikey + Windows

Using a Yubikey 4 on Windows

These are my notes on how to set up GPG with the private key stored on the hardware Yubikey. This will reduce the chances of your GPG private key from being stolen, and also allow you to protect other secrets such as SSH private keys.

It's just some notes and a partial worklog for now, but I may turn it into a full blog post later.