Skip to content

Instantly share code, notes, and snippets.

@johtela
johtela / settings.json
Last active September 8, 2021 14:47
ModalEdit keybindings
"modaledit.keybindings": {
"\n": [
"lineBreakInsert",
{
"command": "modaledit.typeNormalKeys",
"args": {
"keys": "ku"
}
}
],
@bradtraversy
bradtraversy / docker-help.md
Last active May 4, 2024 14:32
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@estorgio
estorgio / Mounting VirtualBox shared folders on Ubuntu Server 16.04 LTS.md
Last active March 8, 2024 17:34
Mounting VirtualBox shared folders on Ubuntu Server 16.04 LTS

Update 28 July 2019: An updated version of this guide for Ubuntu Server 18.04 LTS is now available. Feel free to check it out.

Update 23 May 2020: This guide is ALREADY OUTDATED and might no longer work with new versions of Ubuntu and VirtualBox. Please consider switching to the updated guide instead. I will no longer respond to the replies to this gist. Thank you.

Mounting VirtualBox shared folders on Ubuntu Server 16.04 LTS

This guide will walk you through steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest. Tested on Ubuntu Server 16.04.3 LTS (Xenial Xerus)

@posener
posener / go-shebang-story.md
Last active March 29, 2024 08:38
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@bekce
bekce / ntfs_fix.md
Last active October 22, 2021 10:32
NTFS filename fix

If you happen to write to NTFS partitions using non-windows operating systems (such as with ntfs-3g, see this thread for more info), some of your files may have got written containing invalid characters in their names. When such a thing happen, the fix of chkdsk is just to delete them but clearly no one would ever want to have their files deleted to 'fix'!

This little script that I wrote aims to fix the invalid NTFS characters in batch and automatically by renaming the files with invalid characters to valid ones. It only fixes the characters in this set: <>:"\|?* which is pretty enough for most of the problems, but for advanced cases (like reserved names 'com', 'lpt') you must fix manually. Always double check the batch mv commands before running.

Fallacies:

  • Does not fix reserved names in Windows (like CON, PRN, AUX, NUL, COM1, COM2, etc).
  • Does not fix other illegal combination of characters like 'directory name cannot end with
@enotodden
enotodden / s.py
Last active November 20, 2021 10:05
Command line string replace with Python regex and format strings.
#!/usr/bin/env python
import os
import sys
import re
import argparse
if sys.version_info.major == 3:
from io import StringIO
else:
from StringIO import StringIO
@foca
foca / gist:3148204
Created July 20, 2012 02:03
Git hook to detect if a file changed after a checkout/merge/rebase and show the diff.
#!/usr/bin/env bash
#
# Install into:
# - .git/hooks/post-merge
# - .git/hooks/post-rewrite
# - .git/hooks/post-checkout
#
# And make sure all are executable.
#
# Then change the $file appropriately. Enjoy.