Skip to content

Instantly share code, notes, and snippets.

@da-n
da-n / comment.md
Created August 13, 2017 21:30
Encrypt tar.gz file on create

Source: mightypile https://askubuntu.com/a/829835

I do this with asymmetric key encryption. That means I have a public key (that I can share with anyone I'd like to send me encrypted packages) which allows me to encrypt the package. I also have a private key (that I do not share) which allows me to decrypt the package.

My commands to encrypt the current working directory: the -e to encrypt, the -r to specify a "recipient" or key to use, the -o to specify the output file.

$ tar -cvz . | gpg -e -r ABCD1234 -o backup.tgz.gpg

And to decrypt to the current working directory:

@da-n
da-n / .abcde.conf
Last active February 26, 2017 15:56
abcde config
# -----------------$HOME/.abcde.conf----------------- #
#
# A sample configuration file to convert music cds to
# FLAC using abcde version 2.7.2
#
# http://andrews-corner.org/linux/abcde/index.html
# -------------------------------------------------- #
# Encode tracks immediately after reading. Saves disk space, gives
# better reading of 'scratchy' disks and better troubleshooting of
@da-n
da-n / rsnapshot-daily.timer
Created February 26, 2017 01:05
rsnapshot
[Unit]
Description=rsnapshot daily backup
[Timer]
OnCalendar=*-*-* 00:00:30
Persistent=true
Unit=rsnapshot@daily.service
[Install]
WantedBy=timers.target
@da-n
da-n / ssh.json
Created January 25, 2017 10:20
iTerm SSH Profile
{
"Guid" : "3B588533-BFA8-4069-84E8-30FF9D510436",
"Tags" : [
],
"Ansi 12 Color" : {
"Green Component" : "0.6235294",
"Blue Component" : "0.8117647",
"Red Component" : "0.4470588"
},
@da-n
da-n / default.json
Created January 25, 2017 10:20
iTerm Default Profile
{
"Guid" : "B08493A5-64BB-48D9-B30D-67CAFD86A9E5",
"Tags" : [
],
"Ansi 12 Color" : {
"Green Component" : "0.6235294",
"Red Component" : "0.4470588",
"Blue Component" : "0.8117647"
},
@da-n
da-n / update-dtdns.sh
Created January 24, 2017 23:10
Update DtDNS Bash Script
#!/usr/bin/bash
DOMAIN=
PASSWORD=
IPADDR=`wget -qO- tnx.nl/ip`
LASTIP=`nslookup bitmono.dtdns.net ns1.darktech.org | grep -A1 bitmono | grep Address | awk '{ print $2 }'`
echo -n "`date` - "
if [ "$IPADDR" != "$LASTIP" ]; then
@da-n
da-n / arch-linux-install
Created January 15, 2017 16:01 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
@da-n
da-n / gist:2e7b706d61a3d70ad77ec71525dd08f3
Created October 6, 2016 22:40
Enable Termite on remote server, fixes Error opening terminal: xterm-termite.
$ wget https://raw.githubusercontent.com/thestinger/termite/master/termite.terminfo
$ tic termite.terminfo
@da-n
da-n / file.php
Created September 28, 2016 23:04
Laravel insert into array $key => $value in a session
Session::put('cart', array_add($cart = Session::get('cart'), $product, $quantity));
@da-n
da-n / ajax.php
Created September 22, 2016 14:30
Laravel PHPUnit test ajax
$this->get('/users/2/routes', ['HTTP_X-Requested-With' => 'XMLHttpRequest'])
->seeJsonStructure([
'*' => ['id', 'name'],
]);