Category: CLI and tools
-
[FIX] Clean up old puppet reports and reclaim mysql space (ibdata)
MySQL for puppet dashboard gets BIG. You can make this smaller by deleting old records. Source for this article is here. To get the size in GB of the dashboard: # mysql -uroot -ppassword > SELECT CONCAT ( ROUND( ( ( SUM(DATA_LENGTH)+SUM(INDEX_LENGTH) ) / 1024 / 1024 / 1024 ) ,2 ), ” GB”) as…
-
Bash get full path of file
Get the full path of a file via: $ readlink -f ./file Tip: make an alias: alias fullpath=’readlink -f’
-
Dell Linux Dock display switcher script
This might be helpful for someone. A quick script I made for changing output modes on my Dell laptop. There are different configurations. laptop: laptop screen only vga: vga output + laptop screen mix: hdmi + vga output, laptop screen off dock: dell dock display setup #!/bin/bash LAPTOP=’LVDS-1′ DOCKLEFT=’DP-2′ DOCKRIGHT=’DP-1′ VGA=’VGA-1′ HDMI=’HDMI-1′ case $1 in…
-
Script: Puppet module create template
Adjust to your needs ;) #!/bin/bash # Create puppet module layout if [[ -z “$1” ]];then echo “$0 modulename” exit 1 fi if [[ -d $1 ]]; then echo “Dir already exists” exit 1 fi # Actual work M=$1 mkdir -p \ $M \ $M/files \ $M/manifests \ $M/templates # Files cat $M/manifests/${file}.pp done #…
-
A better todo.txt repeated task inserter
I have a scheduled.txt file like this: # Scheduled tasks for todo.txt # Format: # # a dow, Mon,Tue,Wed,… # b moy, Jan,Feb,Mar,… # d dom, 01..31 # D m/d/y 12/30/12 # F Y-m-d 2012-12-30 # j doy 001..366 # V woy 01..53 # # %2 = Division by 2 is possible # %N2= Devision…
-
Useful ‘command not found’ output for bash
Add this to your .bashrc: clippy() { echo “I see you’re trying to use the terminal …”; echo ” v “; echo ” ╭─╮”; echo ” ⌾ ⌾”; echo ” │▕│”; echo ” ╰─╯”; } function command_not_found_handle { clippy $1; } It will result in: $ adsf I see you’re trying to use the terminal…
-
Clear BASH history
Clear the BASH history easily via: $ >~/.bash_history Remember to log out after doing this.