Tag: shell

Windows Subsystem for Linux and tmux

If you don’t know by now, Microsoft has created Windows Subsystem for Linux (WSL). I am not going to do a deep dive into how this works (read here to know more), but I will offer a simple what does this mean to us. It means Windows users now have a native (Ubuntu) Linux shell on Windows without using additional virtualization software such as VirtualBox or VMware’s vSphere Desktop. You can use all the things like sed, awk, grep, ssh, and more within Windows. This is all awesome, however the one thing that sucks is the terminal. It’s pretty basic and doesn’t allow tabbing or panes and there really isn’t an alternative terminal for WSL. You could use a Cygwin based solution, but then you’re getting away from the point of WSL. So, I offer you to take the time and learn how to use tmux! This is actually geared toward allowing multiple connections into the same shell. Think of it as having multiple users all connected to the same terminal session. It’s great for getting help from someone remotely or showing others how to do something in shell without everyone hovered over a single screen. Now here is where it becomes really neat for WSL, tmux allows for multiple windows (think tabs) and panes! This instantly makes the generic WSL Terminal much more usable. You can now open up a WSL Terminal and fire up tmux (which is already installed) and start creating multiple windows and panes to work more efficiently.

  • To start a tmux session use: tmux new -s <session name>
  • To create another windows: ctrl + b then c
  • To change to the next window: ctrl + b then n
  • To split panes horizontally: ctrl + b then 
  • To split panes vertically: ctrl + b then %
  • To switch the active pane: ctrl + b then o

Here is a decent tmux cheat sheet that will provide most of your needs -> https://tmuxcheatsheet.com/

Here is an example where I have created 2 windows (named window1 and window2), then I split the first window into 3 panes. Excuse the crappy drawing..

More info:

https://blogs.msdn.microsoft.com/wsl/

https://blogs.msdn.microsoft.com/commandline/2017/04/11/windows-10-creators-update-whats-new-in-bashwsl-windows-console/

https://en.wikipedia.org/wiki/Tmux

 

Create indexes for Splunk automatically.

Our Splunk environment uses nearly a thousand indexes per region or cluster with many more being added daily. Why so many indexes, well it’s all about administration. Let us say you have 5 separate websites or apps and each of the sites are managed by a separate team. Maybe each of these sites has a test and production instance, so for each site there is an index for test and an index for production. This means we have 10 indexes now for these 5 sites and those indexes can be specifically assigned to individual teams. Now imagine our environment with hundreds of sites with different environments and most of these managed by different teams. That is how we have such a large number of indexes with more being added every day. So the standard process of adding indexes just doesn’t make sense for our needs. So, I created some bash scripts that are run by cron jobs to automate the process.

Read more

Otterbox for Motorola XOOM now available.

Otterbox the company known for making cases to overly protect our mobile electronic devices has released one for the XOOM.  As their website states “A high quality polycarbonate shell snaps around your tablet, while an impact absorbing silicone skin wraps around the outside of the shell to complete the case. The removable shield includes a pop up stand that has two angles great for typing or viewing videos. These all add up to rugged protection that keeps your XOOM safe from harm no matter where you use it.” Enough said? Actually there’s more, unlike almost all the cases currently out for the XOOM Otterbox made small and easy opening doors to get access to the external ports and the microSD slot. That alone sets this case apart from most. Is it worth $89.95, well I guess if your a little rough on devices like this then $89.95 is more than worth it to protect a $500+ purchase. -Greg

Otterbox for XOOM