Skip to content

Instantly share code, notes, and snippets.

Tricks

Command Description
dd if=/dev/<sdx> bs=<bs> count=1 | hexdump -C hexdump -C -n <bytes> <dev> Print hexdump of a drive

Directory indexing

  1. Set hashed b-trees to speed up lookup for large dirs: tune2fs -O dir_index /dev/<SDX>
  2. Optimize directories (reindexing/sorting and compressing): e2fsck -D /dev/<SDX>

Low Cython version

Makefile:2019: recipe for target 'src/cython/vapoursynth.c' failed
make: *** [src/cython/vapoursynth.c] Error 1

recipe for target 'src/cython/vapoursynth.c' failed

Probably due to Cython version 0.25.2 (Debian stretch default)

Arch

Fix alsa 1.2.x:

pacman -U https://archive.archlinux.org/packages/a/alsa-lib/alsa-lib-1.1.9-2-x86_64.pkg.tar.xz
pacman -U https://archive.archlinux.org/packages/a/alsa-utils/alsa-utils-1.1.9-1-x86_64.pkg.tar.xz

Old

Extract bluray audio

ffmpeg -i VIDEO.m2ts -map 0:<stream> -acodec <pcm_s24le|libmp3lame> audio.<wav|mp3>
Description Command Reference
Store credentials git config credential.helper store
Allow no comment on commit git config --global alias.nccommit 'commit -a --allow-empty-message -m ""' Source
Undo a commit git reset HEAD~
List remotes git remote -v
Change remote git remote set-url origin <URL> Reference
Append to last commit git commit --amend

Fresh start

Force display errors

error_reporting(E_ALL);
ini_set('display_errors', 1);

Disable caching in php.ini

opcache.enable=0
  1. sudo apt-get remove openssh-server && sudo apt-get install openssh-server

  2. /etc/ssh/sshd_config:

    Change - PermitRootLogin no
    Add - AllowUsers yourusername
    Change - PasswordAuthentication yes
    Add - UsePrivilegeSeparation no
    Change - ListenAddress 0.0.0.0
    

Change - Port 2200

var check = OBJECT.find(function(obj) {
return obj.id == id;
});