-
Archives
- May 2026
- April 2026
- November 2025
- December 2024
- November 2024
- June 2024
- September 2023
- March 2023
- August 2022
- April 2022
- September 2021
- September 2020
- March 2019
- March 2018
- June 2017
- May 2017
- November 2016
- September 2016
- July 2016
- June 2016
- May 2016
- April 2016
- March 2016
- February 2016
- January 2016
- December 2015
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- April 2015
- December 2014
- October 2014
- September 2014
- May 2014
- April 2014
- March 2014
- January 2014
- November 2013
- October 2013
- October 2012
- September 2012
- August 2012
- July 2012
- June 2012
- March 2012
- February 2012
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
-
Meta
Category Archives: Operating System
Using grep as highlighter
1$ grep –color -E ‘^|pattern1|pattern2’ file name
TCL programming
A reusable expect dispatcher I kept around for running the same kind of operation across a list of servers — untar an index, restart a service, patch a config file. The trick is that the script reads the first command-line … Continue reading
Posted in Linux, TCL/Expect
Comments Off on TCL programming
Simple unit test is bash file
Consider the following 3 files: 1. shellTestFramework.sh 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647#!/bin/bash # Copyright (c) Ronald Pringadi # Before each Test function setUpTest(){ #"Please overwrite this function on your unit test. Something that need to be done before each test" … Continue reading
Posted in Bash
Comments Off on Simple unit test is bash file
Compare File Permission Recussively on Linux Directories
Scan 12345678910111213141516171819202122#!/usr/bin/perl use File::Find; my $directory1 = ‘/root/rpmbuild/RPMSX’; my $directory2 = ‘/root/rpmbuild/RPMSX.bak’; find(\&hashfiles, $directory1); sub hashfiles { my $file1 = $File::Find::name; (my $file2 = $file1) =~ s/^$directory1/$directory2/; return(0) if (! -f $file2) ; … Continue reading
Posted in Linux
Comments Off on Compare File Permission Recussively on Linux Directories
Linux find files and total their size
1find ./ -type f -newerct "1 May 2015" ! -newerct "1 Jul 2015" -print0 | du –files0-from=- -hc| tail -n1
Wireshark filters
Filter by ip dst or source using wildcard on the last 3 digits: (ip.dst == 192.168.0.0/24) || (ip.src == 192.168.0.0/24)
Posted in Linux
Comments Off on Wireshark filters
Allowing a linux/unix user all sudo access without password
/etc/sudoers yourusername ALL=(ALL) NOPASSWD:ALL
Find with xargs
Search all files under current directory, look for xml node ‘‘, copy and print that node. Send the output to a file. find . |xargs -n1 xmlstarlet sel -t -c “//processorInfo[@ruleType=’store’]” 2>/dev/null > /cygdrive/b/allstore.txt
Posted in Linux
Comments Off on Find with xargs
XMLStartlet – Command line xml queries
xmlstarlet sel -t -c “//YOUR_NODE_ELEMENT_TAG_NAME[@ATTRIBUTE_NAME=’ATTRIBUTE_VALUE’]” YOUR_XML_FILE.xml
Posted in Linux
Comments Off on XMLStartlet – Command line xml queries