Skip to content

*sh and Unix

Anton Istomin edited this page Feb 24, 2021 · 7 revisions

*sh and Unix

Terminal signals

^\ sends SIGQUIT.

Firejail filesystem overlay

There's a Firejail utility for Linux that allows you to run programs in an overlay filesystem in which programs may change any files, but any changes are only saved within that overlay. It's also very easy to use:

$ firejail --overlay ./very-suspicious-program.sh

CheckInstall

There's a tool called CheckInstall that automagically creates .deb/.rpm/.tgz packages from your install scripts. I never used it personally, so I don't know how well does it work.

sed in-place

sed(1) may edit a file in-place with -i flag. The -i flag accepts a parameter that is a backup suffix so you don't lose old file's content.

$ sed -i bak 's/foo/bar/g' *

macOS secure delete

rm -P overwrites file 3 times before deleting: with 0x00s, 0xFFs, and 0x00s again

  push(%rbp)
  %rbp = %rsp
  push(%r13)
  push(%rax)
  %rbp[-0x10] = $0x0, 
  %rbp[-0x10] = %r13, 
  %eax = 0
  %edi = 0
  callq 0x10f5109f0
  %r13 = %rax
  %rdi = %r13
  main()
  %rsp += $0x8
  popq   %r13
  popq   %rbp
  retq

Clone this wiki locally