Posts

Showing posts with the label cli

Disable WSL shell beeps in Windows

Set bell-style none in ~/.inputrc to silence all shell beeps. This stops the annoying tones if you attempt to tab-complete under WSL(2) in Windows 10

Docker information

docker inspect - f \ '{{range $index, $value := .Config.Env}}{{$value}} {{end}}' container_name

Get network transfer information from linux

Whilst attempting to find some information for a project necessary on calculating (guesstimating) a budget for bandwidth used by a machine in the cloud I had to know where we were with current usage. Unfortunately the cloud services this VM sits in don't have any method exposed to show my usage and as such I turned to AskJeeves to find out some linux tools to help me out. First off the rank is  vnStat  which seems to be part of most of my Ubuntu boxes after looking at a few of them. Actually, that's the only necessary tool I used to get my data. By invoking vnstat with no parameters I got a nice printout of: ~$ vnstat Database updated: Mon Sep  4 00:17:31 2017    ens3 since 05/22/2017           rx:  1.25 TiB      tx:  21.85 TiB      total:  23.10 TiB    monthly                      rx      |  ...

Command-line installation of OpenVPN

OpenVPN’s installer allows for command-line based (silent) installation, but this feature is not actually documented explicitly anywhere. Here’s all I could find – hope this list will help someone in the same situation I was in. The installer allows you to specify is the installation should be “silent” (i.e. no GUI, nothing to click on), to specify custom installation directory (esp. useful if included in another installer, e.g. NSIS, and installing in the same directory as the target app), and components to install. The parameters can be used even when you’re not using the silent installation, to customize behavior of the graphical installer. /S      - silent installation /D=path - specify a custom installation path Note – the /D parameter has to appear last on the command line, and the path may not be inclosed in quotes. The installer simply takes all of the command line left, and uses it as path (thus supporting spaces in the path). To select individual OpenV...

My Windows PC doesn't keep time on the domain

Reports of users complaining of time not being correct on Windows 10 may have the time service not running. Open CMD prompt as an Administrator net stop w32time w32tm /unregister w32tm /register net start w32time Confirm the Windows Time service running via services.msc afterwards.

Check for duplicates in text file

cat normalFile.txt | uniq -c

Restart Apache 2

Command to restart apache2 on my development server. /etc/init.d/apache2 restart

Show large files - Linux

Specify the directory to list large files in du -h | grep '[0-9]G' and it will output size in GB and the path. Like so: 77G /var/lib/mysql 77G /var/lib 68G /var/log/mysql 69G /var/log 146G /var