Skip to content

Instantly share code, notes, and snippets.

View vivus-ignis's full-sized avatar

Vivus Ignis vivus-ignis

View GitHub Profile
@vivus-ignis
vivus-ignis / switchHeadphones.sh
Created September 27, 2020 09:01 — forked from OndraZizka/switchHeadphones.sh
Bluetooth headset - switch between quality sound + no mic (A2DP) and crappy sound and mic (HSP/HFP)
#!/bin/bash
#### Restart Bluetooth
if [ "$1" == "resetBT" ] ; then
sudo rfkill block bluetooth && sleep 0.1 && sudo rfkill unblock bluetooth;
exit;
fi;
#### Toggle listen/speak
if [ "$1" == "" -o "$1" == "toggle" ] ; then
@vivus-ignis
vivus-ignis / aws-lambda-relative-import-no-known-parent-package.md
Created January 29, 2020 10:10 — forked from gene1wood/aws-lambda-relative-import-no-known-parent-package.md
Python relative imports in AWS Lambda fail with `attempted relative import with no known parent package`

Python relative imports in AWS Lambda fail with attempted relative import with no known parent package

The Problem

In AWS Lambda if I attempt an explicit relative import like this

.
├── lambda_file.py
└── example.py
Error in src/gist-scout.cr:23: undefined method 'main' for Gist::Scout:Module
Gist::Scout.main
^~~~
@vivus-ignis
vivus-ignis / index.txt
Created August 28, 2017 04:53 — forked from gus/index.txt
Ruby/Clojure analogs
For each Ruby module/class, we have Ruby methods on the left and the equivalent
Clojure functions and/or relevant notes are on the right.
For clojure functions, symbols indicate existing method definitions, in the
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can
be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master,
ruby-to-clojure.*/* functions can be obtained from the source files in this
gist.
If no method symbol is given, we use the following notation:
@vivus-ignis
vivus-ignis / resample_flac.bash
Created August 15, 2017 12:31 — forked from ksze/resample_flac.bash
A script to resample your FLAC files *and* make sure they conform to the FLAC Subset specification so they will play in pretty much all hardware players - e.g. portable music players like those made by COWON) - all this while minimizing the file sizes.
#!/usr/bin/env bash
# A script to resample your FLAC files *and* make sure they conform to the FLAC Subset
# specification so they will play in pretty much all hardware players - e.g. portable
# music players like those made by COWON - all this while minimizing file sizes.
# Requirements:
# - Bash 4 or newer (for the globstar)
# - sox
# - flac
@vivus-ignis
vivus-ignis / hack.sh
Created October 14, 2016 08:31 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
$ java -jar jenkins-cli.jar -s http://localhost:9000 install-plugin findbugs
findbugs is neither a valid file, URL, nor a plugin artifact name in the update center
No update center data is retrieved yet from: http://updates.jenkins-ci.org/update-center.json
findbugs looks like a short plugin name. Did you mean 'null'?
# Specifying a full URL works!
$ java -jar jenkins-cli.jar -s http://localhost:9020 install-plugin http://updates.jenkins-ci.org/download/plugins/AdaptivePlugin/0.1/AdaptivePlugin.hpi
# Get the update center ourself
# upgrade postgresql on debian
set -e
echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' >> /etc/apt/sources.list.d/pgpd.list
wget https://www.postgresql.org/media/keys/ACCC4CF8.asc
apt-key add ACCC4CF8.asc
apt-get update
apt-get install -y postgresql-9.3
pg_dropcluster 9.3 main --stop
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDdZZR6t6BAoPynfYeGCHpFdhYluOSeuScqKOkCwQyKop3IvmpFBRK+TxbCIpKIz2YgkC2CKkwfcTIfb5UHQmeCUzqlKFSJCVivxOakS9niZndR+CNDlhLoQcIFfC+OYDH│·
WJq2qnimONG33oC9E3HVKVFAJMJrwdrLeypNJI12LSaxTL9cY3/Pt8S5qqk8dAHy5YVLY73RhMnyxfQShQA8EiccM6Hw//qvWaXjuZ1m/WUifhosR5POttgnWPTVQT1kEP2/H9tWGz7WjJITzJ1VBhynnCFjLY74Ro6na8F│·
p2tIm12GWBP6i47hKc2Hw5q2UaajdEGSn2kkMT8weP+rYh mail2ignis@gmail.com
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")