Skip to content

Instantly share code, notes, and snippets.

@danielcompton
danielcompton / gist:5582392
Last active June 5, 2018 15:48
List directory with up to 8 million files. Script taken from https://coderwall.com/p/h6rifq Download the file, compile it: gcc listdir.c -o listdir And use it like this: ./listdir [target dir] > target-ls.txt
#define _GNU_SOURCE
#include <dirent.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#define handle_error(msg) \
@esolitos
esolitos / README.md
Last active December 7, 2018 19:20 — forked from magnetikonline/README.md
@akavel
akavel / dualboot.md
Created March 21, 2017 16:47
Instructions for Genode / NixOS dual-and-a-half-boot

Genode/NixOS dual-and-a-half-boot

If you've never used Genode or NixOS, or installed Gentoo, stop and consider what you are about to do.

The goal is too create a NixOS installation and a Genode installation, with the option of booting into NixOS, booting into Genode, and booting into Genode then booting the same NixOS install again in a virtual machine.

@promovicz
promovicz / README.txt
Last active November 16, 2021 03:07
Enhanced dmenu for use with qubes and i3
Example use:
# qubes control
bindsym $mod+u exec --no-startup-id "qubes-i3-dmenu-shell --start"
bindsym $mod+Shift+u exec --no-startup-id "qubes-i3-dmenu-shell --pause"
bindsym $mod+i exec --no-startup-id "qubes-i3-dmenu-shell --shutdown"
bindsym $mod+Shift+i exec --no-startup-id "qubes-i3-dmenu-shell --unpause"
# qubes launching
bindsym $mod+o exec --no-startup-id "qubes-i3-dmenu-shell --global"
@ruario
ruario / check-user-namespace.sh
Last active May 20, 2022 17:21
A bourne shell function to check for the presence of user namespace support in the linux kernel by calling the unshare command to set one up
check-user-namespace () {
if ! command -v unshare >/dev/null 2>&1; then
echo "The unshare command is not available. Install the util-linux package to fix this." >&2
return 2
fi
if unshare -U true >/dev/null 2>&1; then
echo "User namespace support enabled"
return 0
else
echo "User namespace support not enabled"
@rmi1974
rmi1974 / how_to_control_virtualbox_from_the_command_line.md
Last active November 13, 2022 02:02
How to control VirtualBox from the command line #commandlinefu #virtualbox

How to control VirtualBox from the command line

Some of the command line examples for interacting with Windows VMs require credentials. The examples assume they are exported in the current shell environment for convience:

export VBOXUSER=vboxuser
export VBOXPASS=vboxuser
@Hellowlol
Hellowlol / whatthefork
Last active November 21, 2022 07:55
Check all forked branches if they are ahead of master/self open in browser
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Dirty script to check if any forks in ahead of master and open that branch commitlist
Warning: Uses alot of api calls
"""
import requests
from requests.auth import HTTPBasicAuth
@palaniraja
palaniraja / Tinderizer-Bookmarklet.js
Last active February 27, 2023 17:32
Tinderizer - Send to kindle bookmarklet
javascript: (function () {
var setupDiv = function () {
var id = 'Tinderizer';
var div = document.getElementById(id);
var body = document.getElementsByTagName('body')[0];
if (null != div) {
body.removeChild(div);
}
div = document.createElement('div');
div.id = id;
@Firsh
Firsh / install-vivaldi-custom-css.bat
Last active March 3, 2023 21:22
Install Vivaldi Custom CSS
@set installhooks_args=%*& set installhooks_self=%~f0& powershell -c "(gc \"%~f0\") -replace '@set installhooks_args.*','#' | Write-Host" | powershell -c -& goto :eof
$srcdir = split-path $env:installhooks_self
$vivpath = "c:\Program Files\Vivaldi\Application\"
Try {
$dstdir = split-path ((Get-ChildItem -path $vivpath -recurse browser.html | Sort-Object -property CreationTime -descending | Select-Object -first 1).FullName)
write-host "Destination directory: $dstdir"
$encoding = (New-Object System.Text.UTF8Encoding($False))
@fedme
fedme / Ionic Android Development on WSL.md
Last active May 7, 2023 16:21
Ionic Android Development on WSL (Windows Subsystem for Linux)

Ionic Android Development on WSL

Installing the required software

Execute the following commands to install Node, npm, git, Java, Ionic, Cordova and Angular CLI:

cd ~
sudo apt update
sudo apt upgrade