Posts

Working through the golang tour

Exercise: rot13Reader https://tour.golang.org/methods/23 This was was tougher than I thought,  Mainly because you really have to understand the implied pieces that are needed.  I ended up solving this with a map rather than the github answer key I found. package main import ( "io" "os" "strings" ) type rot13Reader struct { r io.Reader } func main() { s := strings.NewReader("Lbh penpxrq gur pbqr!") r := rot13Reader{s} io.Copy(os.Stdout, &r) } func (rot13 rot13Reader) Read(b []byte) (n int, err error) { n,err = rot13.r.Read(b) for i:=0;i<n;i++ { b[i] = m[b[i]] } return n,err } var m = map[byte]byte{ 'A': 'N', 'B': 'O', 'C': 'P', 'D': 'Q', 'E': 'R', 'F': 'S', 'G': 'T', 'H': 'U', 'I': 'V', 'J': 'W', 'K': 'X', 'L': ...

Restoring a file backed up through dump from an encrypted home directory

https://help.ubuntu.com/community/EncryptedPrivateDirectory#Recovering_Your_Mount_Passphrase sudo mkdir /mnt/restore sudo chown yourid /mnt/restore sudo ecryptfs-add-passphrase --fnek # record output sudo mount -t ecryptfs /tmp/restore/home/.ecryptfs/yourid/.Private /mnt/restore aes 16 n (passthrough) y (encrypt filenames) (enter 2nd key from fnek above)

My first stab at: Unreal Engine 4 and Linux Gaming

I have almost no time these days but I am desperately interested in learning UE4 and especially excited to see how far I can get writing and playing a game in Linux. I have poked at a few books through Safari but finally settled on buying a course from udemy to help jump start my learning. So far I have a working UE4 Editor and have done some playing with blueprint.  The next step with be trying to something in C++ to work. Starting here:  https://wiki.unrealengine.com/Building_On_Linux#First_Time_Setup I have  working UE4 Editor.  It is going to be interesting adapting the course work which is on Microsoft to work under my Xubuntu desktop. I'll try to record the more memorable steps in this blog. Codelite looks like a  good IDE for use with UE4.  I installed it (sudo apt-get install codelite codelite-plugins).  Next using https://wiki.unrealengine.com/Running_On_Linux as a reference I'm editing Engine/Config/Linux/LinuxEngine.ini and set...

p4v logging, why are you so hard to figure out

I have tried in vain to find out how to get p4v to log the entire command so I can better understand p4. I think people call it google-foo, and normally I'm pretty good at getting the search right, but this has eluded me. My p4 log file was lttered with  "{ 2 additional argument(s) suppressed}"  But man I need that info. Finally got the search right which led me to this page: http://forums.perforce.com/index.php?/topic/3368-having-the-actual-p4v-log-on-my-harddrive/ So simple, just change debug level to :1 in the log.config for p4v. Alleluia!

Finding non ascii characters in a text file

stackoverflow link http://stackoverflow.com/questions/3001177/how-do-i-grep-for-all-non-ascii-characters-in-unix My favorite out of this: grep -P "[\x80-\xFF]" file.xml This was really useful when compiling AWS Cloudformation templates since you can't have certain characters in the JSON.

Ubuntu thunar-like disk mounting from the command line

I always forget how to do this, so why not create a quick page to remind myself. Logged in through the GUI it is easy to use thunar, but from the command line I use these steps: # create the luks volume sudo cryptsetup luksOpen /dev/sdc1 Verbatim1TB # mount the disk like thunar udisksctl mount -b /dev/mapper/Verbatim1TB Voila!

Arbitrary cpu load on linux

https://www.devin.com/lookbusy/ Lookbusy is super awesome. It doesn't just take the CPU to 100% like other utilities.. Wtih AWS, especially t2.small instances, I want to play with the cpu around the credit burning limit and this tool allows me to do that so easily.  I'm not sure how the curve works yet, but I'm going to explore that next.     wget 'https://www.devin.com/lookbusy/download/lookbusy-1.4.tar.gz'     tar zxvf lookbusy-1.4.tar.gz     ./configure     make     ./lookbusy --cpu-uti=45-55 --cpu-mode=curve     ./lookbusy --cpu-uti=15-25 --cpu-mode=curve  # t2.small     ./lookbusy --cpu-uti=19