Throttle IO for testing slow downloads
To test a slow download rate for your application, you can use: wget –limit-rate 64k https://test/somePath
Computer and Software Engineering
To test a slow download rate for your application, you can use: wget –limit-rate 64k https://test/somePath
Perspective All commands are written (unless explicitly stated) from the perspective of a non-root user with sudo permissions. The intent is to create a user which will run the application … Continue Reading Setting up Ruby on Rails with Passenger + Nginx in a CentOS 7 VM running on Google Cloud Platform
A script to test if files are different, and to further test if the differences in those files are the expected differences: #!/bin/bash echo “text to find” | tee subject.log … Continue Reading How to test if files differ in BASH and test that those differences are expected
To run a bunch of jobs concurrently in CSH run: #!/bin/csh set i = 1 while ( $i <= 30 ) set name = “run_name_${i}” do_something $name & @ i++ … Continue Reading Run a bunch of jobs at the same time locally
To Max out memory use: #!/usr/bin/python # To eat 40GB of RAM and hold it for 5 seconds type: #./memconsume.py 5 40 import time import sys seconds = int(sys.argv[1]) gb … Continue Reading Saturate (max out) Memory Utilization
To max out a 4 CPU machine run: #!/bin/bash function clean_up { kill $pids exit } trap clean_up SIGHUP SIGINT SIGTERM pids=”” for i in {1..4}; do while : ; … Continue Reading Saturate (max out) CPU Utilization
It’s pretty simple: cd ~/my_dir && tar –exclude=my_dir.tar.gz -czf my_dir.tar.gz ./* The -c argument says to compress, z tells tar to create a gz type, f is to specify the … Continue Reading Creating a Directory Archive (.tar.gz/tar ball) in that Same Directory
If you aren’t aware, there are a lot of useful internal BASH variables, some of which can be found here: https://www.tldp.org/LDP/abs/html/internalvariables.html One of particular use is PIPESTATUS. This can be … Continue Reading Internal Bash Variable – PIPESTATUS
If you want something to happen when you login, then there are several ways to do that, but that is not what this post is about. With a Raspberry PI … Continue Reading How to auto-run a script on boot with Linux / Raspberry PI
To figure out where libraries are being loaded from, if you have your environment already setup in the same way for which you want to test, then you can run: … Continue Reading How can I see where libraries are being loaded from on Linux?
To see what programs are installed use: rpm -qa If you just installed a program and want to know where it went then grep for it: $ rpm -qa | … Continue Reading Using rpm to find an installed program (RedHat, CentOS, Fedora)
TL;DR Here is the alias: How do I use it? Here is how I use it: How does it work? find This search alias uses find as follows to … Continue Reading Searching large source trees in an efficient way on Linux
One of the fastest ways to search your previous commands is to use CTRL+R and start typing, once you’ve entered enough text you can use CTRL+R again and again to … Continue Reading How can I easily access my Linux command history? Is there a hot key?
SSH stands for Secure Shell and it is a protocol which enables secure network service connections over unsecured networks. For most users they think of SSH as a way to … Continue Reading How do you SSH without a password and what permissions are needed on the .ssh files?
I often need to run several commands which can take an hour or more and I won’t necessarily be present the entire time. It is nice to be able to … Continue Reading How do you chain commands in BASH or CSH?
I found this little gem a while ago and a coworker identified it as useful too, so I’m posting it: Let’s say you want to copy a file from a … Continue Reading How to easily manipulate long paths in Linux