PowerShell Reference

Wednesday, 07 October 2020


Command Alias Comment
'string' String literal, not expanded
"string=$a" String literal with variable expansion
"math=$(2+3)" Embedded calculation
"result=$($value)" Embedded variable
> Keep reading

SQL Server BCP reference

Tuesday, 11 August 2020

bcp Database.dbo.TableName out savefile.bcp -S server -T -N -k

Exports data from a certain server and table to a savefile. -T means trusted connection (using Windows authentication), -N uses the database's native storage with Unicode values (specifically designed for server-to-server copy),...

> Keep reading

Ufw (firewall) Reference

Sunday, 26 January 2020

Enable or disable the firewall:

ufw enable ufw disable

Allow all incoming HTTP traffic and reject telnet globally (normally 'deny' is used but 'reject' will explicitly reject a connection):

ufw allow in http ufw reject telnet comment 'telnet is not encrypted'


> Keep reading

Docker Reference

Wednesday, 13 November 2019

Command/option | Description ----------------------------------- | ----------------   | Containers | Containers are light-weight virtual machines docker create image [cmd] | Create container from image docker rename container newname | Rename container docker rm container | Remove a container    -f | Force    -v | Also delete volumes   | `docker...

> Keep reading

sed and awk Reference

Thursday, 10 October 2019

Argument | Description -- | -   | awk '{print $1}' | Print 1st word from lines separated by space awk -F: '{print $1}' | Print 1st word from lines separated by colons   | sed -n | Don't display input lines in output sed '5d'...

> Keep reading

Common TcpDump Parameters

Wednesday, 04 September 2019

Argument Description
-A Print packet in ASCII
-e Print MAC address (link-level info)
-x Print packet in hex
--print Print parsed output even if saving packets to file
-w file Write raw packets to...
> Keep reading

Common CURL Parameters

Wednesday, 21 August 2019

Argument | Description -- | -   | Protocols | --http1.0 | Use HTTP 1.0 --http1.1 | Use HTTP 1.1 --http2 | Use HTTP 2 -4 | Resolve domain names to IPv4 -6 | Resolve domain names to IPv6 -k | Allow insecure connections in SSL   | **HTTP...

> Keep reading

My List of Ubiquitous Software

Thursday, 15 August 2019

(Really just a list for myself when I reinstall a new computer.)


> Keep reading

Common wget Parameters

Wednesday, 31 July 2019

Argument | Description -- | -   | Requests | --header=x | Insert custom header --method=x | Use custom HTTP method --post-data=STR | Set POST data from string --post-file=FILE | Set POST data from file --referer=x | Use custom referer -t n | Number of retries (0=unlimited)   | Authentication/TLS | --http-user=x...

> Keep reading

Windows CMD reference

Saturday, 25 August 2018

ATTRIB [/s] [/d]

Changes file attributes. /s makes it recursive, /d makes it operate on directories as well. I didn't know about these switches before. Handy.

CALL :label arguments

Neither did I know you could call a label in a batch...

> Keep reading