Skip to content

Instantly share code, notes, and snippets.

@NicholasTD07
NicholasTD07 / i3config
Created October 31, 2012 07:32
i3config file
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@NicholasTD07
NicholasTD07 / i3status.conf
Created October 31, 2012 07:34
i3status config file
general {
colors = true
interval = 5
}
#order += "ipv6"
order += "load"
order += "ethernet eth0"
@adammorris
adammorris / JiraOmniFocus.py
Created April 10, 2015 21:34
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
@enihsyou
enihsyou / backupRamDisk.sh
Last active March 18, 2020 15:45
Create a RamDisk backup DMG image on macOS, detail in Chinese 中文: https://enihsyou.com/2019/02/04/48
#!/usr/bin/env bash
DISKNAME=${1-RAM}
IMAGE_LOCATION=${2-"/Users/enihsyou/Library/RAM.dmg"}
DISK_LOCATION=/Volumes/${DISKNAME}
sudo hdiutil create -srcfolder $DISK_LOCATION $IMAGE_LOCATION -ov
sudo chown enihsyou $IMAGE_LOCATION
@aubricus
aubricus / create-new-file.ahk
Created August 16, 2011 00:00
AutoHotkey script to create a new file.
; create new file
; installation:
; 1. you must be running autohotkey: http://www.autohotkey.com
; 2. double click on script to run
; [pro-tip] add this script to your startup folder to run when windows start
; [pro-top] you can add this script to another .ahk script file.
; hotkey is set to control + alt + n
; more on hotkeys: http://www.autohotkey.com/docs/Hotkeys.htm
@P7h
P7h / tmux__CentOS__build_from_source.sh
Last active November 22, 2023 11:28
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].
VERSION=2.7
sudo yum -y remove tmux
sudo yum -y install wget tar libevent-devel ncurses-devel
wget https://github.com/tmux/tmux/releases/download/${VERSION}/tmux-${VERSION}.tar.gz
tar xzf tmux-${VERSION}.tar.gz
rm -f tmux-${VERSION}.tar.gz
cd tmux-${VERSION}
@scottsb
scottsb / casesafe.sh
Last active January 16, 2024 08:47 — forked from Hais/workspace.sh
Create and manage a case-sensitive disk-image on macOS (OS X).
#!/bin/bash
# ---------------------------------------------------------
# Customizable Settings
# ---------------------------------------------------------
MOUNT_POINT="${CASE_SAFE_MOUNT_POINT:-${HOME}/casesafe}"
VOLUME_PATH="${CASE_SAFE_VOLUME_PATH:-${HOME}/.casesafe.dmg.sparseimage}"
VOLUME_NAME="${CASE_SAFE_VOLUME_NAME:-casesafe}"
VOLUME_SIZE="${CASE_SAFE_VOLUME_SIZE:-60g}"
@samoshkin
samoshkin / toggle_keybindings.tmux.conf
Last active February 5, 2024 02:26
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 \
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active April 2, 2024 15:59
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1
@dianjuar
dianjuar / Restore the GRUB Bootloader.md
Last active April 9, 2024 12:56
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