Skip to content

Instantly share code, notes, and snippets.

View DeftNerd's full-sized avatar

Adam Brown DeftNerd

View GitHub Profile
@DeftNerd
DeftNerd / transcode.fish
Last active December 5, 2021 13:05
fish shell script to transcode video files
#!/usr/bin/env fish
# Set some default variables
set FFMPEG_LOCATION "ffmpeg"
set FFPROBE_LOCATION "ffprobe"
set REMOVE_ORIGINAL "true"
set TARGET_CRF "28"
set TARGET_ENCODER "libx265"
set TARGET_CODEC "hevc"
set TARGET_PRESET "veryfast"
@DeftNerd
DeftNerd / notify.sh
Created October 31, 2016 18:19
Slack SSH Notification
#!/bin/sh
# Place this file in /etc/ssh/notify.sh
# Make sure to chmod +x this notify.sh file
if [ "$PAM_TYPE" != "close_session" ]; then
url="https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK"
channel="#dev"
host="`hostname`"
content="\"attachments\": [ { \"mrkdwn_in\": [\"text\", \"fallback\"], \"fallback\": \"SSH login: $PAM_USER connected to \`$host\`\", \"text\": \"SSH login to \`$host\`\", \"fields\": [ { \"title\": \"User\", \"value\": \"$PAM_USER\", \"short\": true }, { \"title\": \"IP Address\", \"value\": \"$PAM_RHOST\", \"short\": true } ], \"color\": \"#F35A00\" } ]"
curl -X POST --data-urlencode "payload={\"channel\": \"$channel\", \"mrkdwn\": true, \"username\": \"ssh-bot\", $content, \"icon_emoji\": \":computer:\"}" $url
fi
@DeftNerd
DeftNerd / linkedin-auto-endorser.js
Last active March 14, 2017 17:05 — forked from icodeforlove/linkedin-auto-endorser.js
Endorse everyone on linkedin
(function () {
var csrfToken = $('[name="csrfToken"]').val();
var profiles = 120 + Math.floor(Math.random() * (25 - 1 + 1)) + 1;
$.getJSON('https://www.linkedin.com/hp/modules/ozfeed/promo/endorsements/fetch?offset=0&count=' + profiles, function (response) {
var endorsements = response.endorsements;
console.log('found ' + endorsements.length + ' endorsements');
function endorse (callback) {
var endorsement = endorsements.shift();

Keybase proof

I hereby claim:

  • I am deftnerd on github.
  • I am deftnerd (https://keybase.io/deftnerd) on keybase.
  • I have a public key whose fingerprint is 8ABC 8644 96CE EF1C A518 53F5 C3B1 8E90 7A80 0D7C

To claim this, I am signing this object:

{{-- Define all our servers --}}
@servers(['staging' => '', 'production' => ''])
@setup
{{-- The timezone your servers run in --}}
$timezone = 'Europe/Amsterdam';
{{-- The base path where your deployments are sitting --}}
$path = '/var/www/site.com/htdocs';
Verifying that +deftnerd is my Bitcoin username. You can send me #bitcoin here: https://onename.io/deftnerd