This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo tmutil listbackups | grep 2018 | xargs -I {} sudo tmutil delete '{}' | |
sudo hdiutil compact /Volumes/TimeMachine/YourBackup.sparsebundle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import boto3 | |
from boto3.s3.transfer import S3Transfer | |
filename = 'file.txt' | |
bucket_name = 'ravenskill' | |
s3 = boto3.resource('s3') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import boto3 | |
import logging | |
import time | |
from botocore.exceptions import ClientError | |
class Waiter: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: RTSPSERVER | |
# Required-Start: $local_fs $network $named $time $syslog | |
# Required-Stop: $local_fs $network $named $time $syslog | |
# Default-Start: 2 3 4 | |
# Default-Stop: 0 1 6 | |
# Description: Provides the Mpromoneth rtsp server | |
### END INIT INFO | |
SCRIPT="/home/pi/h264_v4l2_rtspserver/h264_v4l2_rtspserver -P 8554 -Q 10 -r -s -W 2592 -H 1944 -F 15" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dscacheutil -flushcache | |
sudo killall -HUP mDNSResponder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## in .bash_profile | |
SSHAGENT=`which ssh-agent` | |
SSHAGENTARGS="-s" | |
if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then | |
eval `$SSHAGENT $SSHAGENTARGS` | |
trap "kill $SSH_AGENT_PID" 0 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// simple example of the cake pattern | |
// abstract DAO trait | |
trait Repository[A, B]{ | |
// saves an entity, returns an ID | |
def save(entity: A): B | |
// more features.. | |
} | |
trait RdbmsRepository extends Repository[MyUserCaseClass, Long]{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash | |
echo "source ~/.git-completion.bash" >> ~/.bash_profile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create a patch | |
git diff --no-prefix > patchfile | |
# apply a patch | |
patch -p0 < patchfile | |
# apply a patch created without "--no-prefix" | |
patch -p1 < patchfile |
NewerOlder