Skip to content

Instantly share code, notes, and snippets.

View stefanschmidt's full-sized avatar

Stefan stefanschmidt

  • Hamburg, Germany
View GitHub Profile
@gboudreau
gboudreau / smbln
Created January 3, 2012 22:23
smbln executable that allows the creation of symlinks on Samba shares mounted with the mfsymlinks option
#!/usr/bin/php
<?php
if ($argv[1] == '-s') {
$argv[1] = $argv[2];
$argv[2] = @$argv[3];
}
if (empty($argv[2])) {
$argv[2] = basename($argv[1]);
@lukasbesch
lukasbesch / disk-conversion-progress.sh
Last active March 31, 2022 15:52
View progress of long-running disk conversion tasks (en-/decryption) on macOS / OS X
function displaytime {
local T=$1
local D=$((T/60/60/24))
local H=$((T/60/60%24))
local M=$((T/60%60))
local S=$((T%60))
(( $D > 0 )) && printf '%3s' $D && printf ' days '
(( $H > 0 )) && printf '%2s' $H && printf ' hours '
(( $M > 0 )) && printf '%2s' $M && printf ' minutes '
if [ $D -lt 1 -a $H -lt 1 ]
@przemoc
przemoc / ssh-root-without-password-on-freebsd.md
Created March 24, 2017 12:00
ssh root without password on FreeBSD.

ssh root without password on FreeBSD

If you have some toy boards in your internal network, then you can happily live without password and key. As I learned today, setting following stuff in /etc/ssh/sshd_config is not enough:

PermitRootLogin yes
PermitEmptyPasswords yes
@n8henrie
n8henrie / chrome_se_export.py
Created November 4, 2015 22:50
Export your Chrome search engines to JSON.
"""chrome_se_export.py
Export your Chrome search engines to JSON.
"""
import os.path
import sqlite3
import re
import json
import click
@ttscoff
ttscoff / grab links.bookmarklet
Last active April 3, 2024 19:44
Create a bookmark and paste the code from `grab links.bookmarklet` into the url. Trigger it on a page containing links you want to save and then click the section of the page containing the links. A Markdown list of all links will be generated, and clicking the resulting list will select all for copying.
@endolith
endolith / Has weird right-to-left characters.txt
Last active April 7, 2024 01:38
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active April 25, 2024 04:16
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.