Linux Useful Things

Posted

Infinite Loop / While True One-liner

while :; do thing; done

Highlight a term from a program output

cat file | ack --passthru "TERM"

Replace text in a file

sed -i s/[find]/[replace]/g file

File / Directory Searching

Syntax: find [directory] <flags>

For each line do…

... | xargs -L1 -i{} echo Hello, {}!

Flags

Git Usefuls

git config --global core.autocrlf true
#!/bin/bash

cd "$(dirname "$0")"
while :
do
  echo "Making backup at `date`"
  git add . > /dev/null
  git commit -m "Backup :: `date`" > /dev/null
  sleep $((10 * 60)) # 10 min interval
done 

Disable Python .pyc files from being created

export PYTHONDONTWRITEBYTECODE=1

Auto-start a service

systemctl enable SERVICE_NAME

systemctl disable SERVICE_NAME

2FA Authentication Setup

See here

Software

Drop-in Replacements

More posts

DIY Teleprompter

Another round of shoddy handywork

Posted

PC Build: PeteC

I built a computer!

Posted