Skip to content

Instantly share code, notes, and snippets.

@sijad
sijad / story.md
Created March 21, 2016 18:35
Disaster with disabled csrutil Mac OS X EL Capitan 10.11
  • accidently run chmod 644 -R /
  • csrutil was disabled

solution:

  • command + s on boot
  • run mount -u / to allow writing
  • change chmod etc to make its content run-able
  • sudo /usr/libexec/repair_packages --verify --standard-pkgs /
  • sudo /usr/libexec/repair_packages --repair --standard-pkgs /

Keybase proof

I hereby claim:

  • I am sijad on github.
  • I am sijad (https://keybase.io/sijad) on keybase.
  • I have a public key whose fingerprint is 7311 4431 117B 6A51 4282 414C E538 A6D3 41A6 177D

To claim this, I am signing this object:

#!/usr/bin/env bash
# if [[ $(id -u) -ne 0 ]] ; then sudo -s ; fi
CONFIG="$HOME/proximac.json"
if [ ! -z $1 ]; then
CONFIG="$1"
fi
@sijad
sijad / .vimrc
Last active November 5, 2016 17:38
My Vim instalaltion
set nocompatible
set backspace=2
filetype off
execute pathogen#infect()
filetype plugin indent on
syntax on
set background=dark
#!/usr/bin/env bash
sudo chown nginx:nginx -R $1
cd $1
# File permissions, recursive
find . -type f -exec chmod 0644 {} \;
# Dir permissions, recursive
find . -type d -exec chmod 0755 {} \;
@sijad
sijad / ir
Last active December 16, 2016 16:44
modified /usr/share/X11/xkb/symbols/ir to be similar to macOS layout
// Iranian keyboard layout
////////////////////////////////////////
// Persian layout,
// based on
// Information Technology – Layout of Persian Letters and Symbols on Computer Keyboards
// ISIRI 9147 – 1st Edition
// Institute of Standards and Industrial Research of Iran
// http://www.isiri.org/UserStd/DownloadStd.aspx?id=9147
// http://behnam.esfahbod.info/standards/isiri-keyboard-9147.pdf
@sijad
sijad / convertToPersian.js
Created March 5, 2017 10:36
conveer English to Persian number
function convertToPersian(str) {
var newStr = '';
for (var i = 0; i < str.length; i++)
{
var c = str.charCodeAt(i);
if (c >= 48 && c <= 57) {
c += 1728;
}
newStr += String.fromCharCode(c);
}
@sijad
sijad / fisherman-ls.txt
Created April 1, 2017 23:16
`fisherman ls` output
$ fisher ls | awk '{print $1}'
imajes
await
bang-bang
fnm
get_file_age
getopts
gitignore
last_job_id
menu
@sijad
sijad / exercis.fish
Created April 2, 2017 19:56
having fun with exercises suitable for small places
#!/usr/bin/env fish
# it's based on https://www.reddit.com/r/Fitness/comments/2t1su3/does_anyone_jump_rope_in_their_small_apartment/cnv6way/
set -l exercis_time 60
set -l exercis_circles 5
set -l exercises "mountain climbers" "push ups" "crunches" "bodyweight squats" "Now rest for $exercis_time seconds!"
set -l sleep_exercis_time (math $exercis_time + 5)
for _ in (seq 1 $exercis_circles)