Monday, 20 October 2025

fcron

http://fcron.free.fr/doc/en/fcrontab.5.html


        Entries based on elapsed system up time
----------------------------------------------------
# Get our mails every 30 minutes
@ 30 getmails -all

# make some security tests every 48 hours of system up time,
# force a mail to be sent to root even if there is no output
@mailto(root),forcemail 2d /etc/security/msec/cron-sh/security.sh

        Some examples of entries based on time and date
----------------------------------------------------
# run mycommand at 12:05, 12:35, 13:05, 13:35,
# 14:05 *and* 14:35 everyday
& 05,35 12-14 * * * mycommand -u me -o file

# get mails every hour past 20, 21, 22, and 24 minutes.
20-24~23 * * * * getmail

# save our work of the day every night at 03:45 with a low priority
# unless we are sunday, mail the output to jim and run that job
# at startup if computer was down at 03:45
&nice(10),mailto(jim),bootrun 45 03 * * *~0 "save --our work"

        Entries run periodically
----------------------------------------------------
# will run the command once each night either between 21:00 and 23:59, or between 3:00 and 5:59
# (it will run as soon as possible. To change that, use option random) and won't send mail (because option mail is set to "no").
%nightly,mail(no) * 21-23,3-5 echo "a nightly entry"

# Run once a day whenever system is up.
%daily * 1-23 sh /root/bin/automysqlbackup
%daily * 1-23 sh /root/bin/ntpupdate
%daily * 1-23 sh /root/bin/tmpwatch

fcrondyn - dialog dyn-namically with a running fcron daemon
As root:
fcrondyn
>ls root   # to list scheduled jobs.

Sunday, 5 October 2025

tmpwatch

tmpwatch - removes files which haven't been accessed for a period of time

# remove files which were modified earlier than 14 days
/sbin/tmpwatch -m 14d /tmp
/sbin/tmpwatch -m 14d /home/username/Documents/tmp/changepct
/sbin/tmpwatch -m 14d /home/username/tmp

 

Saturday, 30 August 2025

TermRecord

TermRecord is a simple terminal session recorder with easy-to-share self-contained HTML output!

TermRecord -o /tmp/session.html

Sunday, 24 August 2025

tmux

tmux - terminal multiplexer

ctrl + b prefix key
 - prefix key followed by % will split pane vertically 
 - prefix key followed by " will split pane horizontally
 - prefix key followed by arrow key will allow to move between panes
 - prefix key followed by [ will allow to scroll with up/down & page up/down keys
 - prefix key followed by x will kill the active pane

Resize pane using the resize-pane command:
 - Press your tmux prefix key (default is Ctrl + B).
 
- D to resize downwards.
 - Press the colon key (:). This opens a command prompt at the bottom of your screen.
 - Type resize-pane followed by a direction and an optional number of cells to resize by.
    - U to resize upwards.
       
- L to resize left.
    - R to resize right.
Example: resize-pane -D 5 will resize the current pane downwards by 5 cells. 

Saturday, 23 August 2025

awscli

AWS_SHARED_CREDENTIALS_FILE=/home/user/aws_cli/.aws/credentials
export AWS_SHARED_CREDENTIALS_FILE
AWS_CONFIG_FILE=/home/user/aws_cli/.aws/config
export AWS_CONFIG_FILE
aws configure
aws configure list
aws s3 ls
# get size
aws s3 ls s3://bucketname/Photos/  --recursive --human-readable --summarize
# download file
aws s3 cp s3://bucketname/Photos/holidays_2025.7z  /tmp

 

 

cat  /home/user/aws_cli/.aws/credentials
[default]
aws_access_key_id = <key id>
aws_secret_access_key = <secret access key>
[S3_bucketname]
aws_access_key_id = <key id>
aws_secret_access_key = <secret access key>


cat /home/user/aws_cli/.aws/config
[default]
region = us-east-1 

btop

 a terminal based resource monitor

Tuesday, 19 August 2025

utimer

 command-line "timer" tool which features a timer, a countdown and a stopwatch.

 utimer --countdown=600s;play ~/Music/Gangsta\'s\ Paradise\ -\ Coolio.mp3

ccze

 ccze - log colorizer  sudo tail -f /var/log/syslog | ccze