Gibbserv.net

Icon

A slow updating blog I write for no particular reason.

^[[O and ^[[I Haunts me!!!

So I noticed today that if I detach a tmux session and then switch between my terminal (iTerm2) and other windows, ^[[O gets printed to the terminal when focus changes and ^[[I when focus returns to the terminal. This bugged the hell out of me. Particularly when jumping into another tmux session with vim running. Now if I enter Insert Mode and jump to Chrome to look at something, or in my case today jumping into an email with some code I wanted to copy, and I jump back to my terminal running tmux and vim I paste from my clipboard – everything gets crazy. Since ^[[O and ^[[I get sent to vim when leaving and returning, vim drops out of Insert Mode (and Visual Mode blah blah blah) and pasting is a shit show. I spent an hour just remembering to re-enter the mode I was in when I refocused to my terminal but it got old fast. Killing iTerm2 would return expected behavior until I detached a tmux session again. Hitting Ctrl+R in iTerm2 would resolve the issue until again, a tmux session was detached. Thanks to the following links below I was able to find that a ticket was recently opened with the tmux developer over at sourceforge and a fix was pushed up to master to correct an issue where tmux was keeping focus enabled after detaching a session.

https://github.com/sjl/vitality.vim/issues/2
http://sourceforge.net/p/tmux/tickets/176/

Here is the diff of what fixed it.

diff --git a/tty.c b/tty.c
index 9f57c36..534d239 100644
--- a/tty.c
+++ b/tty.c
@@ -290,7 +290,7 @@ tty_stop_tty(struct tty *tty)
if (tty_term_has(tty->term, TTYC_XT)) {
if (tty->flags & TTY_FOCUS) {
tty->flags &= ~TTY_FOCUS;
- tty_puts(tty, "\033[?1004l");
+ tty_raw(tty, "\033[?1004l");
}
}

If you installed tmux via Homebrew you can do what I did and remove tmux_1.9a and instead run brew install --HEAD tmux to build from master instead of using the tarball from 2014.

Talk like a Yarr!!!

My pirate name is:
Mad Sam Kidd

Every pirate is a little bit crazy. You, though, are more than just a little bit. Even though you’re not always the traditional swaggering gallant, your steadiness and planning make you a fine, reliable pirate. Arr!

Get your own pirate name from piratequiz.com.
part of the fidius.org network

Discovering New Disks Without Rebooting

This is going to be a quick post. If you just added a disk to an online Linux node and you don’t have the luxury of rebooting so the system and discover the new disk you can simply run the following:

echo "- - -" > /sys/class/scsi_host/host#/scan

Replace host# with what appears in /sys/class/scsi_host/. Kicking off an fdisk -l will show your new unformatted disk.

I tend to use this when I need to grow an partition created under a logical volume on a Linux VM.

Online resize of Raid 6 post reshape

Previously I described the process I followed to move my Raid 5 to a newer version of CentOS as well as a newer version of MDADM. I outlined how I recovered the raid and LVM sitting on top of it and showed how to convert it to a raid 6. Now I am going to lay out the steps I took to grow the Logical Volume and resize the filesystem once the raid had completed the reshape process.

I started by resizing the physical volume:
# pvresize /dev/md127
Physical volume "/dev/md127" changed
1 physical volume(s) resized / 0 physical volume(s) not resized

I then verified that I could see Free Extents:
# pvdisplay
--- Physical volume ---
PV Name /dev/md127
VG Name lvm_data
PV Size 4.55 TiB / not usable 3.44 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 1192333
Free PE 238466
Allocated PE 953867
PV UUID VT8iLZ-3J04-mT0Z-S2dd-1lxS-vl5X-rcMlLo

Read the rest of this entry »

MDADM Raid5 + LVM migration to Centos 6.3

So time had come to do something about my raid.  I had been limping along for sometime now nursing 100GB free on my 4TB software raid and had purchased two additional WD 1TB Caviar Black drives bringing my device count up to 7 physical disks (the two new drives currently added as hot-spares).  It then dawned on me that maybe now would be a good time to migrate my raid level to raid6.  But as with most things in life, things eventually hit a speed bump.  Seems my trusty do-it-all storage server was unable to change the raid level of /dev/md0 due to a limitation between kernel and mdadm versions I was running on a dated Centos 5.8 install.  I decided to do several things.

  1. Move to Centos 6.3
  2. Run a newer version of MDADM (3.0+)
  3. Migrate current raid and LVM config to new install
  4. Not loose years of data.

Read the rest of this entry »

And Gibbling Sed “/s *Let their be non-standard ssh/Ports/”

We are working to automate as much as we can in regards to environment provisioning so naturally we began looking at some automation tools like Pupppy and Chef.  We hope to assign all the little things that need to be done to a fresh install of CentOS before we can give it to a team of devs.  One of these things is uncommenting Port 22 from /etc/ssh/sshd_config and configuring a nonstandard port.  With Chef I can have a recipe that can simply run a command or it can pulldown and install packages, modify attributes, generate users and a hell of alot more.  Depending on your Ruby knowledge you can automate almost anything.  I simply wanted to run a command to replace #Port 22 with Port 2202. This is where sed comes into play. I can simply have a recipe run sed -i.backup "s/^ *.*Port .*/Port 2202/" /etc/ssh/sshd_config and I’m that much closer to simply kicking off a knife bootstrap and watching all the little mundane things that need to be done to a minty fresh install.

Packet loss gifted by the gods of hate.

So after I spent an entire day cleaning my room and dismantling a old bunk bed, I was able to free up 40% of my room back.  This means I wont be sleeping on the floor but in a real bed.  It also means that I will be able to actually move around my room and store all my shit in an orderly fashion instead of my current Jenga like method where I need to pull the item I need carefully out of the giant stack I have been forced to store items in.

With all this new space on the right side of my room I could not keep the left side looking as bad as it was.  With two decomissioned servers being used as impromptu tables and old PC cases and a large 19in CRT monitor that had not seen the light of day in 8 years in a dust covered grave under my workbench, I decided to clean up everything on that side as well.  Starting with my workbench, I was able to strip and dispose of three PCs/cases and the monitor cleaning up all of the space under the desk and almost all of the workbench.  After a quick trip to Walmart to grab some plastic storage containers and I was able to tuck away all my spare parts and cables out of the way and out of sight under the desk.  Then it was a simple matter of re-arranging all the miscellaneous junk around and on my computer desk into a neat little set of drawers.  So while I had all this space and my two online servers in the same area I decided to relocate my 24 port Gigabit switch and my little embedded wrap board running pfSense.  So after some wire-fu I was able to get everything neat and clean looking but Oh No, I can’t hit anything with my browser.  A quick couple of pings confirmed that I was experiecing massive packet loss in the range of 50% – 75%.  I eventually narrowed it down to either the WAN port on the pfSense device or the ONT outside where the fiber terminates.  I luckily have two different ONTs outside each with a Cat5e handoff.  One was from residential TV server back in the day when they could not server TV VOD data over an account with a static IP.  I ran outside and swapped the network cables between the ONT’s and ran back upstairs to see if the cable was the issue.  I received the same massive amount of dropped packets.  Just to ease my mind I re-crimped the the shoddy job done on the Cat5e cables running outside to the ONT’s but no change in connectivity.  At this time it was 3am and time for me to give up for the night.

Read the rest of this entry »

Sailing the high seas of Alyria

So I recently go back into Materia Magica, a text based game I started playing way back when I was 14.  It is a dangerously large world that is ever growing with many amazing features not seen in any graphical MMO.  There will probably be some posts about this game in the near future as I get back into the swing of questing and doing other fun things like killing pirates.  Thats right, killing dirty pirates on the high seas.

Although sailing has been apart of MM for close to 5 years I never really had the balls to take an expensive ship out on the high seas where it can be destroyed by poor captaining  like running aground on some tiny island.  And there was always the threat of pirates.  But about a year ago the urge to have a speedy way of getting from continent to continent quickly without worrying about waiting for the NPC controlled ships (they spent 20 minutes irl at a port before disembarking which can really eat into your time when you are on a quest or trying to get somewhere to help out a friend.  Plus there is still so much of the world I haven’t see because the NPC ships do not go there.  So i ponied  up the RU (reward units- points reward for donating to help pay for server costs, can be used to purchase donation items and vouchers for ship if you done have the millions of gold they normally cost) and purchased a Dromond.  Its a fast mid sized ship that can have decent armaments.  I spent a few million getting her decked out with full weapon bays and magic shields and upgraded hulls and set out to kill pirates and loot the sunked remains of their vessels.  This yields gold ingot which can be sold for cash (a decent ammount and a nice fun way of earning back some of gold it costs to deck out a ship so it can survive the high seas.  Well after a year away I decided that I was comfortable enough with my seafaring skills that I would suck up the hit to my bank account and get a Super Dreadnought.  This is the largest ship in the game capable of carrying the most cargo and more than double the weapons of my Dromond while providing more staying power so more pirates can be killed before needing to refuel, repair, re-arm and recharge your shields.  I took the plunge and after a close call with a pirate Corsair after sailing down the Whirlpool to the underworld to spend around 10 million gold on upgraded hulls and magic shields, I now have a newly christened Super Dreadnought proudly bearing the flag of my clan, Clan 138 The Separatists.  Ships stats after the break.

Read the rest of this entry »

Materia Magica and the Lost Scripts

So I have been playing a MUD named Materia Magica off and on for several years now.  Well, basically since the start end of middle school / start of high school when I got my first PC (my very own that I built with my own two hands).  And I started off using zMud since it was one of the best know windows MUD clients at the time , still is actually.  I had some basic scripts for that client.  Simple things that would automatically get a water-skin from a bag and drink it when it saw the text “You are thirsty”.  It was fairly easy to set up these Triggers as they are called.  And I had a few macro’s for automatically talking on the different channels in the MUD (formation talk, say, Yell, shout, dream) but I never got into the more hardcore stuff.  And after many years of playing and growing as I have in what OS’s I run, I needed to broaden my horizons for a Linux client.  Something awesome that would let me script some complex things but still be easy to use.  So after a lot of searching I found Tiny Fugue (tf for short).  Its a light weight client that has a robust scripting language and can be run via screen which is awesome.  This meant I could install it on one of my servers and setups a screen session and just let it run.  I could stay connected with a keep alive script if I needed to idle in game for a bit.  Not to be abused mind you but when you have been camping the top floor of the Verity for 2 hours waiting for an angle to spawn so you can kill for the courage mark, you don’t want to let that slip away because you timed out while making a sandwich.  And all of this was lost when I suffered a double drive failure on my web-server where I was running tf from.  And of course I didn’t back any of it up.  That would of been responsible.  So I have slowly been rebuilding my script directory.  Most of it consists of the same time consuming searching of old forums related to MUDs or trying to pick apart code from scripts made by other people in other MUDs.  I did catch a  break in one respect.  Several months ago I wanted to see how my old clan was doing so while at work I searched and found thier forums.  And it turns out I had posted several of my scripts there.  Most importantly was my ship sailing script with some automated actions like equipping the title to your ship when you board it and several macros for listing/creating ship marks.  And all sailing can be done with the numpad.  This means I can kill pirates with less risk of doing something stupid or misspelling a command at a vital moment in the fight.

So anyway.  Most of my current scripts are either entirely someone elses or someone made something I liked and I cut it apart to suit me needs.  So I will eventually post my sailing script and any others I make once I get all the kinks worked out.

Exalted Character Concept: Eclipse Caste

This is a rough, rough idea for an Eclipse caste PC for an Exalted game I might play in.  I will post a fleshed out concept as well as some specifics about the character when I have them done.

I am the son of wealthy family who produced and exported exotic fragrances and exquisite alcholic beverages across the land.  My family was framed by a group of nobleman and royal who secretly are trying to privatize all trade so they can set pricing across the entire land and can effectively manipulate the economy as they see fit.  They framed my father, stating he was manufacturing poisons for some unnamed guild of assassins or something equally preposterous.  There was never any evidence and no charges where officially presented but the rumors where enough to hurt our business enough to the point where my father was forced to sell at a fraction of what it was worth.  My father killed himself shortly after and I have been taking care of my mother and living off the money we were given for the sale of our company for the last three years.  The money wont last for ever and my need for vengeance is to great so I have joined with a thief and I attempt to make a profit from stealing.  Always on the lookout for companies that could be owned by the men who ruined my family and trying to rob them blind.  My epic quest is to ruin all of them financially.