Skip to content

Instantly share code, notes, and snippets.

@step21
step21 / venv_wrapper
Created May 3, 2019 00:12 — forked from dbtek/venv_wrapper
Python 3 venv wrapper. Manages all virtual environments under ~/.venv/ .
# include following in .bashrc / .bash_profile / .zshrc
# usage
# $ mkvenv myvirtualenv # creates venv under ~/.venv/
# $ venv myvirtualenv # activates venv
# $ deactivate # deactivates venv
# $ rmvenv myvirtualenv # removes venv
export VENV_HOME="$HOME/.venv"
[[ -d $VENV_HOME ]] || mkdir $VENV_HOME
#!/usr/bin/bash
echo "Checking the bus for any Nvidia cards.."
if lspci | grep NVIDIA
then
echo "Nvidia GPU detected!"
echo "Switching to Nvidia..."
if pacman -Qe | grep mesa-libgl
then
yes | pacman -S nvidia-libgl lib32-nvidia-libgl
@step21
step21 / gist:547e0c9b4bf070fb40972c1cc1ffefe4
Created September 14, 2016 15:52 — forked from taylor/gist:8701482603d44a7c0057
my laptop-mode config differences from working x230 to new x230
ac97-powersave.conf
auto-hibernate.conf
--- /etc/laptop-mode/conf.d/auto-hibernate.conf 2014-09-07 13:38:23.000000000 -0500
+++ auto-hibernate.conf 2013-09-25 21:09:36.603610468 -0500
@@ -8,21 +8,21 @@
# Auto-hibernation settings
# -------------------------
#
-#__COMMENT Using these settings, you can make laptop mode tools automatically put your
-#__COMMENT computer into hibernation when the battery level goes critically low.
@step21
step21 / tlp
Created September 14, 2016 15:52 — forked from orschiro/tlp
X230 Linux Configuration
# ------------------------------------------------------------------------------
# tlp - Parameters for power save
# Hint: some features are disabled by default, remove the leading # to enable
# them.
# Set to 0 to disable, 1 to enable TLP.
TLP_ENABLE=1
# Seconds laptop mode has to wait after the disk goes idle before doing a sync.
#!/usr/bin/bash
xconfig="/etc/X11/xorg.conf"
if [ -e "$xconfig" ]
then
echo "Nvidia xconfig detected"
echo "Switching to mesa..."
sudo pacman -S lib32-mesa-libgl mesa-libgl
sudo rm $xconfig
else
@step21
step21 / index.user.js
Created May 7, 2016 22:15 — forked from ApoorvSaxena/index.user.js
Regex Crossword Debugger
// ==UserScript==
// @name Regex Crossword Debugger
// @namespace http://www.kunxi.org/
// @version 0.2
// @description Check the answers and mark the mismatched regex.
// @author Kun Xi
// @match https://regexcrossword.com/playerpuzzles/*
// @match https://regexcrossword.com/challenges/*
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
@step21
step21 / index.user.js
Created May 7, 2016 22:14 — forked from kunxi/index.user.js
Regex Crossword Debugger
// ==UserScript==
// @name Regex Crossword Debugger
// @namespace http://www.kunxi.org/
// @version 0.1
// @description Check the answers and mark the mismatched regex.
// @author Kun Xi
// @match http://regexcrossword.com/playerpuzzles/*
// @match http://regexcrossword.com/challenges/*
// @require //cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js