Skip to content

Instantly share code, notes, and snippets.

penn201500 /
Created September 17, 2020 09:07 — forked from P7h/
tmux 2.0 and tmux 2.3 installation steps for Ubuntu. Or build from tmux source v2.5 for Ubuntu and CentOS.
# Steps to build and install tmux from source.
# Takes < 25 seconds on EC2 env [even on a low-end config instance].
sudo yum -y remove tmux
sudo yum -y install wget tar libevent-devel ncurses-devel
tar xzf tmux-${VERSION}.tar.gz
rm -f tmux-${VERSION}.tar.gz
cd tmux-${VERSION}
penn201500 / toggle_keybindings.tmux.conf
Created September 17, 2020 08:10 — forked from samoshkin/toggle_keybindings.tmux.conf
tmux.conf excerpt to toggle on/off session keybindings and prefix handling
bind -T root F12 \
set prefix None \;\
set key-table off \;\
set status-style "fg=$color_status_text,bg=$color_window_off_status_bg" \;\
set window-status-current-format "#[fg=$color_window_off_status_bg,bg=$color_window_off_status_current_bg]$separator_powerline_right#[default] #I:#W# #[fg=$color_window_off_status_current_bg,bg=$color_window_off_status_bg]$separator_powerline_right#[default]" \;\
set window-status-current-style "fg=$color_dark,bold,bg=$color_window_off_status_current_bg" \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S \;\
bind -T off F12 \
penn201500 / Restore the GRUB
Created September 11, 2020 07:37 — forked from dianjuar/Restore the GRUB
Restore the GRUB Bootloader on Manjaro Linux. Usefull when your fresh windows install eats your grub and can not boot into your linux installation, or for some how your grub is missing

Restore the GRUB Bootloader on Manjaro

  1. Chroot into your linux instalation
    1. The easiest way is with mhwd-chroot
      1. Install it yaourt -S mhwd-chroot
      2. Run it sudo mhwd-chroot
      3. DONE, you have chrooted into your linux installation (open a root console of your installed linux OS, is like just open a console with root access)
  2. Restore your GRUB
    1. Install a new GRUB bootloader with grub-install /dev/sda
  3. Recheck to ensure the that installation has completed without any errors grub-install --recheck /dev/sda
penn201500 / github.css
Created September 9, 2020 11:01 — forked from theconektd/github.css
Github Markdown CSS - for Markdown Editor Preview
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
penn201500 /
Created March 18, 2020 15:45 — forked from enihsyou/
Create a RamDisk backup DMG image on macOS, detail in Chinese 中文:
#!/usr/bin/env bash
sudo hdiutil create -srcfolder $DISK_LOCATION $IMAGE_LOCATION -ov
sudo chown enihsyou $IMAGE_LOCATION
penn201500 /
Created March 18, 2020 15:14 — forked from scottsb/
Create and manage a case-sensitive disk-image on macOS (OS X).
# ---------------------------------------------------------
# Customizable Settings
# ---------------------------------------------------------
penn201500 /
Created March 13, 2020 13:42 — forked from adammorris/
Example snippet on how to sync from JIRA to OmniFocus.
Example snippet on how to sync from JIRA to omnifocus.
The main function is OmniFocus.sync_jira_to_omnifocus().
OmniFocus.process_jira_data() is customized to filter projects based on my own needs and will need updating.
from applescript import AppleScript, ScriptError
from datetime import datetime
from json import JSONDecoder
from logging import getLogger
penn201500 /
Created March 10, 2020 15:55 — forked from koshigoe/
Like tmpfs in Mac OSX
# This program has two feature.
# 1. Create a disk image on RAM.
# 2. Mount that disk image.
# Usage:
# $0 <dir> <size>
penn201500 / proj2ram
Created March 9, 2020 15:14 — forked from redguardtoo/proj2ram
script to copy project to tmpfs
if [ -z "$1" ];then
echo "Usage:"
echo " proj2ram proj-name"
echo " proj2ram restore proj-name"
exit 1
penn201500 /
Created December 10, 2019 05:51 — forked from ezekg/
iTerm key bindings

Open the iTerm preferences ⌘+, and navigate to the Profiles tab (the Keys tab can be used, but adding keybinding to your profile allows you to save your profile and sync it to multiple computers) and keys sub-tab and enter the following:

Delete all characters left of the cursor

⌘+←Delete Send Hex Codes:

  • 0x18 0x7f – Less compatible, doesn't work in node and won't work in zsh by default, see below to fix zsh (bash/irb/pry should be fine), performs desired functionality when it does work.
  • 0x15 – More compatible, but typical functionality is to delete the entire line rather than just the characters to the left of the cursor.

Delete all characters right of the cursor

⌘+fn+←Delete or ⌘+Delete→ Send Hex Codes:

  • 0x0b