Skip to content

Instantly share code, notes, and snippets.

@satyaog
satyaog / cleanup_test.sh
Last active January 8, 2020 13:04
git-annex_test_hardlinks
#!/bin/bash
datalad remove *
cd .annex-cache/
git-annex uninit
cd ..
rm -rf .annex-cache/
@desaiuditd
desaiuditd / git-squash.md
Last active August 20, 2021 10:31
Git Squash Commits and Change Timestamp

Let's say, 5 commits are made in develop branch.

  • Commit 4 => 2017/06/23
  • Commit 3 => 2017/06/22
  • Commit 2 => 2017/06/21
  • Commit 1 => 2017/06/20

Now we want to squash these commits into one commit (i.e., the latest commit on 2017/06/23).

git rebase -i HEAD~4

@AdrianKoshka
AdrianKoshka / make_ipxe_uefi_usb.md
Last active April 30, 2024 17:42
Making a UEFI bootable iPXE USB drive

Making a UEFI bootable iPXE USB drive

Build the UEFI executable for iPXE

# First we'll clone iPXE
$ git clone git://git.ipxe.org/ipxe.git
# Go into the src directory of the cloned git repo
$ cd ipxe/src
# Compile the UEFI iPXE executable
@nicolasembleton
nicolasembleton / restart_bluetooth.sh
Last active May 11, 2024 17:43
Restart Bluetooth Daemon on Mac OS X without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@Paxa
Paxa / _wget.md
Last active April 1, 2020 04:25
Cross-compiling wget for blackberry 10 (QNX)

How to compile wget for blackberry 10

Prepare

  1. Download from here http://ftp.gnu.org/gnu/wget/
  2. Extract sources archive, (using extract for example)
  3. Or run tar xf wget-1.15.tar.xz
  4. Copy file bb10_compile from this gist to source folder

Compile

@martijnvermaat
martijnvermaat / ssh-agent-forwarding-screen.md
Created December 21, 2013 15:06
SSH agent forwarding and screen

SSH agent forwarding and screen

When connecting to a remote server via SSH it is often convenient to use SSH agent forwarding so that you don't need a separate keypair on that server for connecting to further servers.

This is enabled by adding the

ForwardAgent yes

option to any of your Host entries in ~/.ssh/config (or alternatively with the -A option). Don't set this option in a wildcard Host * section since any user on the remote server that can bypass file permissions can now als use keys loaded in your SSH agent. So only use this with hosts you trust.

@mnewt
mnewt / print_dom_tree1.js
Created December 18, 2012 20:12
print dom tree
<SCRIPT LANGUAGE="JavaScript">
<!--
// F. Permadi 2005.
// (C) F. Permadi
// Print DOM tree
////////////////////////////////////////////
// This function traverses the DOM tree of an element and prints the tree.
// This function called recursively until the DOM tree is fully traversed.
//
// Parameters:
@larswittenberg
larswittenberg / .htaccess
Created June 27, 2012 09:26
MediaElement.js with autoplay
AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/webm .webm
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 27, 2024 09:43
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@k1000
k1000 / git-rm-from-history.sh
Created August 17, 2011 09:04
permanently delete files/folders from your git repository
#!/bin/bash
set -o errexit
# Author: David Underhill
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-delete-history path1 path2
if [ $# -eq 0 ]; then
exit 0