Skip to content

Instantly share code, notes, and snippets.

@shirshir
shirshir / README.md
Created September 12, 2021 09:56 — forked from pamolloy/README.md
Ubiquiti USG configuration for Wireguard

Download the latest ugw3 package from https://github.com/Lochnair/vyatta-wireguard/releases and install it on your USG using dpkg -i wireguard-ugw3-<version>.deb.

cd /config/auth
umask 077
mkdir wireguard
cd wireguard
wg genkey > wg_private.key
wg pubkey < wg_private.key > wg_public.key
@shirshir
shirshir / mac.md
Created May 19, 2020 07:26 — forked from lornajane/mac.md
Keyboard Only OS X

Keyboard-only Mac Cheatsheet

Hi, I'm Lorna and I don't use a mouse. I have had RSI issues since a bad workstation setup at work in 2006. I've tried a number of extra hardware modifications but what works best for me is to use the keyboard and only the keyboard, so I'm in a good position and never reaching for anything else (except my coffee cup!). I rather unwisely took a job which required me to use a mac (I've been a linux user until now and also had the ability to choose my tools carefully) so here is my cheatsheet of the apps, tricks and keyboard shortcuts I'm using, mostly for my own reference. Since keyboard-only use is also great for productivity, you may also find some of these ideas useful, in which case at least something good has come of this :)

Apps List

There's more detail on a few of these apps but here is a quick overview of the tools I've installed and found helpful

Tool Link Comments
@shirshir
shirshir / slack_delete.rb
Created November 23, 2015 15:48 — forked from jamescmartinez/slack_delete.rb
This Ruby script will bulk remove all Slack files older than 30 days. Just add your API token from https://api.slack.com/web#authentication into the token quotes at the top of the file.
require 'net/http'
require 'json'
require 'uri'
@token = ''
def list_files
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago
params = {
token: @token,
# Build Passes
curl -d "room_id=ourRoom&from=BuildBot&message=Build+Status:+Passing&color=green" https://api.hipchat.com/v1/rooms/message?auth_token=AUTH_TOKEN_HERE&format=json
# Build Fails
curl -d "room_id=ourRoom&from=BuildBot&message=Build+Status:+Failing&color=red&notify=1" https://api.hipchat.com/v1/rooms/message?auth_token=AUTH_TOKEN_HERE&format=json
@mixin force-gpu-rendering {
-webkit-backface-visibility: hidden;
-webkit-perspective: 800;
-webkit-transform-style: preserve-3d;
-webkit-transform: translateZ(0);
-o-transform: translateZ(0);
-moz-transform: translateZ(0);
transform: translateZ(0);
}
@shirshir
shirshir / ExtendedMonologServiceProvider.php
Created January 14, 2014 08:39
A Silex Service Provider to add Monolog\Handler\BufferHandler, Monolog\Handler\FingersCrossedHandler and Symfony\Bridge\Monolog\Handler\SwiftMailerHandler to email any errors. Silex\Provider\MonologServiceProvider must also be registered.
<?php
namespace App\Provider;
use Monolog\Handler\BufferHandler;
use Monolog\Handler\FingersCrossedHandler;
use Monolog\Logger;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Symfony\Bridge\Monolog\Handler\SwiftMailerHandler;
use Symfony\Component\HttpKernel\Event\PostResponseEvent;
@shirshir
shirshir / gist:8400570
Created January 13, 2014 13:47
Recursive .zip excluding .git and .DS_Store
zip -r files.zip ./directory -x "*.git*" -x "*.DS_Store"
<?php
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
* @Entity
*/
class Document
{
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>gitlab.sidekiq</string>
<key>ProgramArguments</key>
<array>
<string>/Users/git/.rbenv/shims/bundle</string>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>gitlab.puma</string>
<key>ProgramArguments</key>
<array>
<string>/Users/git/.rbenv/shims/bundle</string>