When should we use secure practices and when not to? Like all good advice secure practices need to be weighed against practicality. In a perfect world your system will have full test coverage, automated testing, database migration scripts, automated…
Do you ever want to take some lines from the middle of a file say, lines 300-400? You can do that in a kludgey way with Unix head and tail: cat ids.csv | head -400 | tail -100 The take command from vbin tools does just that. cat ids.csv |take 300 400 Here we…
CSV files can be used on the Unix command line like database tables. grep can act as a where-clause, and awk can be used as column selector. However the csv utility from vbin makes it easier. Here it is. $csv -p books.csv id, isbn, name, publicated, type 1…
That's wizardry for you. How many times have you typed grep '^$' ? Do you grep ? grep, the Unix command that searches files for patterns, is one of the most useful Unix utilities. This example here grep '^$' passes a regular expression with two characters: a…
vbin has a very useful command called sav . You always need to make a backup copy of a file before messing with it. A simple $ cp book.xml -p book.xml.sav will do. The -p preserves the original date and ownership of the file. sav does this for you. In other…
vbin is a collection of very useful Unix Bash utilities. Available on github: https://github.com/dlink/vbin It is easy to install - See instructions in the README
Here are some more examples of beautiful things you can do in Unix. 1.) Execute an SQL script against a database called db3, translate the output into CSV and report how long it took to execute. $ time cat usage.sql | db3 |tr '\t' ',' > usage.csv real 0m0.605s…
Unix with the Bash shell is beautiful because you can string a list of simple commands together to instruct computers to do complex things. Folks sometimes refer to this as " sed , grep , awk" . Those are Unix commands with cryptic names - they sound like…
The Unix Operating System, born 45 years ago, and the Bash Shell, born 25 years ago - are the two most powerful programming tools ever created. Unix was the brain child of Ken Thompson and Dennis Ritchie while working in the mid-1960s. Today most of us use a…