2016
09.29

sup

i decided to write this command line bar graph (with portions taken from here) that shows graphs based on the amount of files and extensions in a dir (recursive or non-recursive).

need came about due to not wanting to grep, sort and uniq certain folders at the time for what i was doing.

here is a link to the script.

here is the usage animation:
bargraph
click to enlarge

here is the usage:

NAME
    bargraph.sh - show bar graphs of dir file types

SYNOPSIS
    bargraph.sh [OPTION]...

DESCRIPTION
    This script shows a bar graph with the total count
    of files in a dir according to extension.

    -b [character]
            This is to specify what character you want to use to
            draw your bar graphs. If this option is used, place
            the character in quotes (ex: "#").
            Default is "#"

    -d [path]
            This is to specify the path to be used. Need to input
            this for the script to work.

    -e [ext{,ext,ext}]
            This option is to select a single or list of extensions
            to show in the bargraph.
            Usage is either { -e "foo" } for single extension or
            { -e "foo,bar,baz" } for multiple. Always comma separated.

    -h      Show this file (usage).

    -r      Recursive.

    -s      This sorts output according to most files.
            Default is sorted by name.

    -v      Show version.
2016
09.28

Sup all

so i finally decided to have a command run every time my terminal goes idle. after some searching, here is what i have come up with:
lock-after-time && lock-command

from the man pages:

lock-after-time number
        Lock the session (like the lock-session command) after number seconds of inactivity.  The default is not to lock (set to 0).
lock-command shell-command
        Command to run when locking each client.  The default is to run lock(1) with -np.

so in my .tmux.rc :

set -g lock-after-time 360
set -g lock-command "/usr/bin/asciiquarium"

asciiquarium is set to start after 6 minutes.

2016
09.08

now that i am back in i have decided to post an updated screenshot of the status page for no real reason.

fortiswitch-fortiswitch
Click to enlarge

2016
09.08

sup all

so i’ve been working with a fortiswitch 224d-poe at home for a while when the thing went bat shit on me. When i tried to access the admin console i realized that i had forgotten the password. Below are the steps i used for wiping switch back to factory default with latest (as of time of writing) firmware.

first things first, make sure that you have a properly pinned console cable :
10338-serial-cable-pinouts-for-console-access-to-fortinet-devices
click image to enlarge

then set up a tftp server. i used tftp-hpa in a non-daemonized mode since i only needed it for one time usage.

next restart the switch with console. i did this below:
sorry for the awful pics but it was 0400 in the morning when i did this
20160907_035650
click image to enlarge

since the default and data2 partitions were formatted and saved as default, this caused the factory default settings to be enabled.

once this was done:
fortiswitch-fortiswitch
click image to enlarge

and voila. back to defaults and regained access to the switch.