DNS / host commands

Want a few simple DNS details for a domain from the command line?

Robs-iMac:~ roblacey$ host -t mx robl.me
robl.me mail is handled by 9 xen1.robl.me.
robl.me mail is handled by 10 mailforward.lcn.com.

Robs-iMac:~ roblacey$ host -t txt robl.me
robl.me descriptive text "google-site-verification=E4g5ZQVgm9j01RsxbiGISNBaOvtH614IHSF1RGHHGJE"

Robs-iMac:~ roblacey$ host -t a robl.me
robl.me has no A record

Robs-iMac:~ roblacey$ host -t a www.robl.me
www.robl.me is an alias for xen1.robl.me.
xen1.robl.me has address 207.192.74.149

Robs-iMac:~ roblacey$ host -t cname www.robl.me
www.robl.me is an alias for xen1.robl.me.

today's challenge ActionView::Template::Error: not opened for reading

ActionView::Template::Error:
  not opened for reading

that awk syntax I can never remember

[production] rails@thisserver ~ $ ps -ef | grep resque:work | awk '{print $2;}'
25350
25370
25396
28377

MATOTU - Machines Are Taking Over The Universe - Teaser Video

The new project I have been working on is nearing launch, nice little teaser for you. M.A.T.O.T.U. – Machines Are Taking Over The Universe it would appear.

Need to learn something new....2D Platformer it is.

1 x Getting Started with Unity 5 [eBook] – £7.69
1 x Unity Game Development Blueprints [eBook] – £3.84
1 x Learning Unity 2D Game Development by Example [eBook] – £3.84
1 x Mastering Unity 2D Game Development [eBook] – £3.84
1 x NW.js Essentials [eBook] – £3.84
1 x Node Web Development – Second Edition [eBook] – £3.84

PacktPub Skillup Bundles are dirty cheap if you want to try something new.

Ruby objects and no dup-ing.

Got to remember that when you pass an object to method, that the object is still the same object in memory and it change the object in memory changes, leading to potentially unexpected behaviour. So if you really need to manipulate the arguments a method receives, perhaps think about call blah.dup to clone it before you make changes to it.

options = { :node => 'MyNodeThing' }

def url(options)
  node = options.delete(:node)
  puts node
end

url(options)

puts options[:node]
#=> nil

Hash#slice and Hash#except

Because I can never remember this…

2.1.2 :005 > {:dave => :terry, :peanuts => 1, :pickles => :eleventy_two}.slice(:dave, :peanuts)
 => {:dave=>:terry, :peanuts=>1} 

And it’s nemesis

2.1.2 :006 > {:dave => :terry, :peanuts => 1, :pickles => :eleventy_two}.except(:dave, :peanuts)
 => {:pickles=>:eleventy_two} 

Renaming existing branch with Git

In order to rename an existing branch locally and remotely….

Robs-iMac:core roblacey$ git branch -m feature/something feature/something/trunk
Robs-iMac:core roblacey$ git push origin :feature/something
To git@github.com:/username/core.git
 - [deleted]         feature/something
Robs-iMac:core roblacey$ git push origin feature/something/trunk
Counting objects: 225, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (72/72), done.
Writing objects: 100% (74/74), 8.16 KiB | 0 bytes/s, done.
Total 74 (delta 55), reused 0 (delta 0)
To git@github.com:/username/core.git
 * [new branch]      feature/something/trunk -> feature/something/trunk

Sublime Editor settings

{
	"color_scheme": "Packages/User/Monokai (SL).tmTheme",
	"ensure_newline_at_eof_on_save": true,
	"font_size": 12,
	"ignored_packages":
	[
		"Vintage"
	],
	"tab_size": 2,
	"translate_tabs_to_spaces": true,
	"trim_trailing_white_space_on_save": true
}

How to delete a remote tag in Git.

git tag -d tagtoremove
git push origin :refs/tags/tagtoremove