Month: December 2020

Random Strings and Password Generator

Python 3: secrets module string module secrets module See: https://docs.python.org/3/library/secrets.html Random Strings for Bash For macOS, add env LC_ALL=C to avoid error: tr: Illegal byte sequence Example Strong Password with tr and /dev/urandom For macOS, add env LC_ALL=C to avoid error: tr: Illegal byte sequence Also see: https://gist.github.com/earthgecko/3089509

WordPress Backup Scripts

backup-wordpress-dir.sh Assume wordpress directory set up in /var/www/<domain>/wordpress format backup-wordpress-site.sh Assume wordpress directory is under /home/$USER/<domain> for shared hosting like DreamHost. backup-database.sh restore-database.sh

Git Cheat Sheet & Visual

git diff –  changes in working directory. git diff –cached – changes in staging area. git diff HEAD – changes in working directory and staging area. Also See https://git-scm.com/docs/git-log https://education.github.com/git-cheat-sheet-education.pdf https://www.atlassian.com/git/tutorials/atlassian-git-cheatsheet

Kernel Coding Style

The following sections from kernel coding style can be applied to almost all programming languages. 6) Functions Functions should be short and sweet, and do just one thing. They shouldfit on one or two screenfuls of text (the ISO/ANSI screen size is 80×24,as we all know), and do one thing and do that well. The …

Kernel Coding Style Read More »

Windows 10: Dev Tools

Windows Subsystem for Linux (WSL) Visual Studio Code with WSL winget – discover, install, upgrade, remove and configure applications on Windows 10 Windows Terminal PowerShell Oh my Posh – theme engine for PowerShell PowerToys See: https://www.hanselman.com/blog/scott-hanselmans-2021-ultimate-developer-and-power-users-tool-list-for-windows

Perl: Generate Random Value

Using perl -e Using debugger as REPL with perl -de x (x can be anything) See: https://perldoc.perl.org/perlfaq3#How-can-I-use-Perl-interactively? Also see http://www.perlmeme.org/howtos/perlfunc/rand_function.html

Perl Programming Language: Intro

Perl Intro Basic syntax overview Perl variable types Variable scoping Conditional and looping constructs Builtin operators and functions Files and I/O Regular expressions Writing subroutines OO Perl and Using Perl modules