Tag Cloud
Currently Reading
Latest Book Reviews
- Certified Kubernetes Application Developer (CKAD) Study Guide, 2nd Edition Posted on January 11, 2025
- Rancher Deep Dive Posted on March 31, 2023
- Leveraging Kustomize for Kubernetes Manifests Posted on March 24, 2023
- Automating Workflows with GitHub Actions Posted on October 13, 2022
- Deep-Dive Terraform on Azure Posted on August 30, 2022 All Book Reviews
Latest Posts
- PF syntax check Posted on March 28, 2015
- Restarting single network interface in FreeBSD Posted on February 13, 2015
- Logging your terminal output using script Posted on February 5, 2015
- System Update using Ansible Posted on October 5, 2014
- Perl - Remove all blank lines from a file Posted on October 4, 2014
March 28, 2015
PF syntax check
by Alpha01
[root@freebsd10 /etc]# pfctl -nf /etc/pf.conf
/etc/pf.conf:4: syntax error
freebsd
pf
networking
]
February 13, 2015
Restarting single network interface in FreeBSD
by Alpha01
service netif restart em0
freebsd
networking
]
February 5, 2015
Logging your terminal output using script
by Alpha01
I remember when I first discovered the tab key autocomplete in Bash and being absolutely jollied because of it. Having just found the existence of the script
utility, it feels almost identical.
script
gives you the capability of logging every thing within your current shell session. In the past, I would always resort to manually copying the text output of my terminal window to a file. In some cases, I would have a really long command line session that I wanted its output saved, which resulted in the entire terminal window crashing when being manually copied due to the extremely large output buffer! Thankfully with script
those problems are a thing of the past.
Example
Its usage is dead simple:
tony@alpha05:~$ script logmyshit.log
Script started, file is logmyshit.log
tony@alpha05:~$ echo "script is fucking awesome!"
script is fucking awesome!
tony@alpha05:~$ exit
Contents of logmyshit.log:
Script started on Wed 04 Feb 2015 10:15:32 PM PST
tony@alpha05:~$ echo "script is fucking awesome!"
script is fucking awesome!
tony@alpha05:~$ exit
Script done on Wed 04 Feb 2015 10:16:00 PM PST
bash
]
October 5, 2014
System Update using Ansible
by Alpha01
CentOS
ansible centosbox -m yum -a 'name=* state=latest'
Ubuntu
ansible debianbox -m apt -a 'update_cache=yes name=* state=latest'
ansible
centos
ubuntu
]
October 4, 2014
Perl - Remove all blank lines from a file
by Alpha01
Remove all blank lines from a file using Perl:
perl -ne 'print unless /^\s+$/ ' test.txt
perl
]