Skip to content

Instantly share code, notes, and snippets.

@saghul
saghul / gist:1124655
Created August 4, 2011 07:30
Check Python architecture reliably
# http://mail.python.org/pipermail/pythonmac-sig/2009-September/021649.html
# On Mac OSX Python may run in 32 or 64 bit mode so platform.architecture() is not reliable.
# Example: use 32bit Python: export VERSIONER_PYTHON_PREFER_32_BIT=yes
def arch():
import ctypes
return {4: "i386", 8: "x86_64"}[ctypes.sizeof(ctypes.c_size_t)]
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 23, 2024 18:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@Starefossen
Starefossen / vim-cheats.md
Last active May 22, 2024 13:14
My vim cheat sheet for working with tabs and window splits.

Tabs

New Tab

  • :tabnew - new blank tab
  • :tabedit [file] - open file in tab

Cursor Movement

  • gt (:tabn) - next tab
@debloper
debloper / userChrome.css
Last active December 28, 2015 22:39
Sexy Tabs. Take that, Curvy Tabs! #firefoxAustralis :P
/* set default namespace to XUL */
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
.tabbrowser-tab[selected] { margin-top: -1px !important; }
.tab-background-middle {
border-left: none !important;
border-right: none !important;
margin: 0 -0.5px !important;
}
@nemunaire
nemunaire / dmarc-report-display.pl
Last active April 23, 2021 17:23
Parse and display DMARC reports for human review.
#!/usr/bin/env perl
#=============================================================================
#
# FILE: dmarc-report-display.pl
#
# USAGE: ./dmarc-report-display.pl REPORT
#
# DESCRIPTION: Parse and display a DMARC report
#
# REQUIREMENTS: Perl 5.10; File::LibMagic, Term::ANSIColor; XML::LibXML
@taylor
taylor / gist:8701482603d44a7c0057
Created September 19, 2014 18:39
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.
@jbenet
jbenet / Makefile
Last active August 29, 2015 14:16
boot-to-ipfs
vmname="IPFS"
iso=/ipfs/QmdTmSQtCz9D6vt2AbvQkYo3edFcTYoU7FDmDD7bPWDccA/ipfs.iso
define notfound
$(iso) not found
make sure the daemon is running and mounted:
ipfs daemon &
ipfs mount
endef
export notfound
@orschiro
orschiro / tlp
Created March 25, 2015 08:06
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.
@squarism
squarism / iterm2.md
Last active May 22, 2024 12:52
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
#!/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