Category: Uncategorized
Security researcher Linus Henzedemoed a zero-day macOS exploit impacting the Keychain password management system which can store passwords for applications, servers, and websites, as well as sensitive information related to banking accounts. All the data stored in the macOS Keychain app is encrypted by default, blocking other users or third-party apps from gaining access to it without proper …
Start reading Security Flaw in MacOSIf you have a HyperSQL (HSQL) database stored in a file, it is often useful to be able to query that database from the command line. This can be done using the following command: By default, user SA with no password will exist for each database file. If the database does not exist, it will be created …
Start reading Querying a HSQL database on the command line with hsqldb-sqltoolThere are many ways in the linux terminal to print the nth word of a given file or output. One way to do this without worrying about tabs, extra spaces or word length is to use awk. With awk, this can be done on one line by using the {print $<n>} syntax. For example, the ps command may print this: To …
Start reading Printing the nth word on each line using awkWith Docker, you can specify the command to run inside the container on the command line. But what if you want to run multiple commands? You can’t escape the && syntax, or wrap the command in quotes, as Docker won’t recognise it. The trick here is to use For example, to run date and whoami in a vanilla ubuntu container, we would run …
Start reading Running multiple programs in a Docker container from the command lineAwk is a useful language for many command line tasks. Often awk is used on the command line on its own or with strings piped to it, but it is possible to turn that awk code into an executable script. Consider the following script. This file contains awk code with a shebang of awk -f. The -f is …
Start reading Executable awk scripts in LinuxIn awk, fields are accessed by number; $1 for the first field, $2 for the second, etc. But sometimes the field number you want to access is not known until run time. In these cases, you can access the field using the $(<index>) syntax. The constant NF contains the number of fields available. For example, you can print all fields with their field …
Start reading Accessing fields by index in AwkEver wanted to have a real-time clock on your linux terminal? We can create one with a single line of bash, like so: Let’s look at how this works: date is a common unix tool used to print the current date and time. The $(…) means that the date command is run, and the output is placed here instead. For …
Start reading Linux Terminal ClockThere are a number of ways to read keyboard input with python. One easy option is to use the curses library, using the getch() method, as shown below: The program above initialises the curses library, then sits in an infinite loop, printing a message whenever any keyboard buttons are pressed. Use ctrl-c to interrupt the loop and clean up curses before exiting gracefully. Note that …
Start reading Reading keyboard input with Python