Skip to content

Instantly share code, notes, and snippets.

View 1stvamp's full-sized avatar
:shipit:

Wes Mason 1stvamp

:shipit:
View GitHub Profile
@arthurchui
arthurchui / database.yml
Last active December 15, 2024 11:53
Custom mysql2 adapter for connecting Rails via ProxySQL
database: &default
host: 127.0.0.1
adapter: proxy_mysql2
...
@jordansissel
jordansissel / zoom.md
Last active March 16, 2023 00:48
Zoom on Linux notes

In a zoom?

xdotool search --name "Zoom Meeting ID:"

This will exit non-zero if no meeting matching this name is found. "Zoom Meeting ID:"

This window exists regardless of sharing or not sharing, in my tests.

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active December 21, 2024 08:53
set -e, -u, -o, -x pipefail explanation
@dimaryaz
dimaryaz / dropbox_ext4.c
Created August 15, 2018 07:28
Dropbox ext4 hack
/*
* dropbox_ext4.c
*
* Compile like this:
* gcc -shared -fPIC -ldl -o libdropbox_ext4.so dropbox_ext4.c
*
* Run Dropbox like this:
* LD_PRELOAD=./libdropbox_ext4.so ~/.dropbox-dist/dropboxd
*/
import github3
# example code:
github = Github(
token='token',
repo_name='some_repo',
)
github.stage('articles/some_article.md', 'This is some new content')
github.publish('commit message')
#!/bin/bash
# if we are testing a PR, merge it with the latest master branch before testing
# this ensures that all tests pass with the latest changes in master.
set -eu -o pipefail
PR_NUMBER=${CI_PULL_REQUEST//*pull\//}
err=0
if [ -z "$PR_NUMBER" ]; then
#!/bin/bash
#
# This script will create xenial and trusty lxd images that will be used by the
# lxd provider in juju 2.1+ It is for use with the lxd provider for local
# development and preinstalls a common set of production packages.
#
# This is important, as between them, basenode and layer-basic install ~111
# packages, before we even get to any packages installed by your charm.
#
# It also installs some helpful development tools, and pre-downloads some
#!/bin/bash
set -eu
_UID=$(id -u)
GID=$(id -g)
# give lxd permission to map your user/group id through
grep root:$_UID:1 /etc/subuid -qs || sudo usermod --add-subuids ${_UID}-${_UID} --add-subgids ${GID}-${GID} root
# set up a separate key to make sure we can log in automatically via ssh
# with $HOME mounted
@niedbalski
niedbalski / mongo.sh
Created February 10, 2015 20:20
Connect to Juju Mongodb
$ juju ssh 0
machine-0# sudo apt-get install mongodb-clients
machine-0# mongo --ssl -u admin -p $(grep oldpassword /var/lib/juju/agents/machine-0/agent.conf | awk -e '{print $2}') localhost:37017/admin
MongoDB shell version: 2.4.9
connecting to: localhost:37017/admin
juju:PRIMARY> db = db.getSiblingDB("juju")
juju
@caius
caius / gist:ef463ad94312988d7381
Created December 2, 2014 12:14
Table flipping exceptions in Ruby
A = Class.new(Exception)
# => A
A_(╯°□°)╯︵┻━┻ = Class.new(Exception)
# => A_(╯°□°)╯︵┻━┻
A_(╯°□°)╯︵┻━┻.new(Marshal.load("\x04\bI\"\flbs\xCA\x8E\xC9\xAF\x06:\x06ET"))
# => #<A_(╯°□°)╯︵┻━┻: lbsʎɯ>