Author Archives: ronaldpringadi

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

Posted in Bash, Linux | Leave a comment

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 | Leave a comment

MSBuild common errors and how to fix them

Building with MSBuild produced an error or warning Run MSBuild with (d)etailed verbose mode and capture the output to a file: 1msbuild someproject.csproj /t:Clean;Build;Transfer /p:OutputPath=bin\autobuild;BuildNumber=-1;Configuration=Debug /v:d >build.txt Open build.txt and search for the MSBxxxx error or warning code. For example: … Continue reading

Posted in C# | Tagged | Leave a comment

Allowing a linux/unix user all sudo access without password

/etc/sudoers yourusername ALL=(ALL) NOPASSWD:ALL

Posted in Linux | Tagged , | Leave a comment

Solaris Notes

Extracting a solaris package without installing it. #http://serverfault.com/questions/287469/extract-files-out-of-solaris-pkg-file-without-installing pkgtrans filename.pkg /home/user/temporary_package_prefix

Posted in Operating System | Leave a comment

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 | Leave a comment

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 | Leave a comment

Bash Scripting templates

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859# ========================== # Bash tips # ========================== # Run bash by $ /bin/bash scriptname.sh $ /bin/bash scriptname.sh +x  # debug mode # Or put the next line on the 1st line of your file. #!/bin/bash -x ## Double round braket … Continue reading

Posted in Linux | Leave a comment

Python Sample Script

You inherit a folder full of bash scripts. They source each other, they call each other through pipelines, and after a while nobody remembers who depends on whom. You want a picture — “if I touch deploy.sh, what else might … Continue reading

Posted in Python | Leave a comment

Enabling SSH (https) for Apache 2 in Ubuntu/Mint/Possibly other Debian distro

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051# Intall apache $ sudo apt-get install apache2   # Enable SSL module $ sudo a2enmod ssl # Restart Apache $ sudo service apache2 restart # Create a directory to store the SSLCertificateFile and SSLCertificateKeyFile $ mkdir  /etc/apache2/ssl # Generate … Continue reading

Posted in Linux, Ubuntu, Web Development | Leave a comment