Help
RSS
API
Feed
Maltego
Contact
Domain > blog.carloslima.name
×
More information on this domain is in
AlienVault OTX
Is this malicious?
Yes
No
DNS Resolutions
Date
IP Address
2020-10-11
104.28.29.27
(
ClassC
)
2025-10-08
172.67.129.186
(
ClassC
)
Port 443
HTTP/1.1 200 OKDate: Wed, 08 Oct 2025 14:09:52 GMTContent-Type: text/html; charsetutf-8Transfer-Encoding: chunkedConnection: keep-aliveServer: cloudflarelast-modified: Sun, 31 May 2015 12:40:13 GMTaccess-control-allow-origin: *expires: Wed, 08 Oct 2025 14:19:52 GMTCache-Control: max-age600Report-To: {group:cf-nel,max_age:604800,endpoints:{url:https://a.nel.cloudflare.com/report/v4?sjlIaArpBpWhUiCyE7JnTPfLq9OGqPf1I5iPYMtknnbi2wzFC%2BePm1gg9DjBQ9slFcLJ6Qrurs%2BnJ8NGsTKyjQ02%2FA4cSsdErjFQd3vpG0vIOnv8P}}x-proxy-cache: MISSx-github-request-id: FAB4:10ABE2:3D1FC8:3EE4CF:68E670B0Nel: {report_to:cf-nel,success_fraction:0.0,max_age:604800}Age: 0via: 1.1 varnishx-served-by: cache-pdx12334-PDXx-cache: MISSx-cache-hits: 0x-timer: S1759932593.759371,VS0,VE95vary: Accept-Encodingx-fastly-request-id: f981840a80af13c09a55fcd2a6ec83361ad337f6cf-cache-status: DYNAMICCF-RAY: 98b637f099f01561-PDXalt-svc: h3:443; ma86400 !DOCTYPE html>!--if IEMobile 7 >html classno-js iem7>!endif-->!--if lt IE 9>html classno-js lte-ie8>!endif-->!--if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)>!-->html classno-js langen>!--!endif-->head> meta charsetutf-8> title>carlos@blog ~/notes>/title> meta nameauthor contentCarlos Lima> meta namedescription contentWhile editing code, I frequently cycle between changing the code and running some commands: runningunit tests, linting tools, style checker, …> !-- http://t.co/dKP3o1e --> meta nameHandheldFriendly contentTrue> meta nameMobileOptimized content320> meta nameviewport contentwidthdevice-width, initial-scale1> link relcanonical hrefhttps://blog.carloslima.name> link href/favicon.png relicon> link href/stylesheets/screen.css mediascreen, projection relstylesheet typetext/css> link href/atom.xml relalternate titlecarlos@blog ~/notes> typeapplication/atom+xml> script src/javascripts/modernizr-2.0.js>/script> script src//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js>/script> script>!window.jQuery && document.write(unescape(%3Cscript src./javascripts/lib/jquery.min.js%3E%3C/script%3E))/script> script src/javascripts/octopress.js typetext/javascript>/script> !--Fonts from Googles Web font directory at http://google.com/webfonts -->link href//fonts.googleapis.com/css?familyPT+Serif:regular,italic,bold,bolditalic relstylesheet typetext/css>link href//fonts.googleapis.com/css?familyPT+Sans:regular,italic,bold,bolditalic relstylesheet typetext/css> script> (function(i,s,o,g,r,a,m){iGoogleAnalyticsObjectr;irir||function(){ (ir.qir.q||).push(arguments)},ir.l1*new Date();as.createElement(o), ms.getElementsByTagName(o)0;a.async1;a.srcg;m.parentNode.insertBefore(a,m) })(window,document,script,//www.google-analytics.com/analytics.js,ga); ga(create, UA-44955327-1, carloslima.name); ga(send, pageview); /script>/head>body > header rolebanner>hgroup> h1>a href/>carlos@blog ~/notes>/a>/h1> h2>\o//h2> /hgroup>/header> nav rolenavigation>ul classsubscription data-subscriptionrss> li>a href/atom.xml relsubscribe-rss titlesubscribe via RSS>RSS/a>/li> /ul> form action//google.com/search methodget> fieldset rolesearch> input typehidden nameq valuesite:blog.carloslima.name /> input classsearch typetext nameq results0 placeholderSearch/> /fieldset>/form> ul classmain-navigation> li>a href/>Blog/a>/li> li>a href/blog/archives>Archives/a>/li>/ul>/nav> div idmain> div idcontent> div classblog-index> article> header> h1 classentry-title>a href/blog/2015/05/31/external-commands-vim-tricks/>External Commands - Vim Tricks/a>/h1> p classmeta> time datetime2015-05-31T13:37:00+08:00 pubdate data-updatedtrue>May 31span>st/span>, 2015/time> /p> /header> div classentry-content>p>While editing code, I frequently cycle between changing the code and running some commands: runningunit tests, linting tools, style checker, restarting services, etc./p>p>I generaly do that directly from inside vim with code>:!command/code> and then repeating it with code>:!(up arrow)/code>/p>p>While this is good, I learned a trick a while ago that still ranks as one of my favorites./p>h1>The trick/h1>p>Add this to your code>.vimrc/code>/p>figure classcode>div classhighlight>table>tr>td classgutter>pre classline-numbers>span classline-number>1/span>/pre>/td>td classcode>pre>code class>span classline>map \ :wa<bar><UP><CR>/span>/code>/pre>/td>/tr>/table>/div>/figure>p>Then run your command as code>:wa|!command/code> and repeat it with just code>\/code> directly on normal mode./p>p>If code>\/code> and code>/code> are not next to each other on your keyboard layout, just change the mappingto something that is very easy and convenient to type :)/p>h1>The advantage/h1>p>This is quicker to type, it saves all the files before running the command and it still allows youto run that one-off code>:!command/code> in between your cycle without it getting in the way of your repetition./p>p>That’s it.Happy Vimming!/p>/div> /article> article> header> h1 classentry-title>a href/blog/2015/05/21/idrac-virtual-console-crashing-on-linux/>iDrac Virtual Console Crashing on Linux/a>/h1> p classmeta> time datetime2015-05-21T02:13:00+08:00 pubdate data-updatedtrue>May 21span>st/span>, 2015/time> /p> /header> div classentry-content>h2>iDrac/h2>p>a hrefhttps://en.wikipedia.org/wiki/Dell_DRAC>iDrac/a> (or any other a hrefhttps://en.wikipedia.org/wiki/Intelligent_Platform_Management_Interface>IPMI/a>) is great and can really save your time and your life, butit is really frustrating to find out that your out-of-band virtual console crashes on you atthe moment you need it the most./p>p>Given that this particular problem has struck me a few times already I decided to write apost to my future self and save me some trouble./p>h2>Scenario/h2>p>After receiving an alert and failing to connect to the host, you log into the iDrac’s webinterface and click “Launch” on the Virtual Console option.br/>It downloads a file called code>viewer.jnlp/code>.br/>You start it with code>javaws viewer.jnlp/code> and, after a few confirmation dialogs, it explodes!/p>figure classcode>div classhighlight>table>tr>td classgutter>pre classline-numbers>span classline-number>1/span>span classline-number>2/span>span classline-number>3/span>span classline-number>4/span>span classline-number>5/span>span classline-number>6/span>span classline-number>7/span>span classline-number>8/span>span classline-number>9/span>span classline-number>10/span>span classline-number>11/span>span classline-number>12/span>span classline-number>13/span>span classline-number>14/span>span classline-number>15/span>span classline-number>16/span>span classline-number>17/span>span classline-number>18/span>span classline-number>19/span>span classline-number>20/span>span classline-number>21/span>span classline-number>22/span>span classline-number>23/span>span classline-number>24/span>span classline-number>25/span>span classline-number>26/span>/pre>/td>td classcode>pre>code class>span classline>carlos@multi ~/Downloads> javaws viewer.jnlp/span>span classline>This application does not specify a Codebase in its manifest. Please verify with the applets vendor. Continuing. See: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html for details./span>span classline>This application does not specify a Codebase in its manifest. Please verify with the applets vendor. Continuing. See: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html for details./span>span classline>Application title was not found in manifest. Check with application vendor/span>span classline>KVM/VM Client Version: 5.01.01 (Build 22)/span>span classline>ProtocolAPCP.receieveSessionSetup : reconType 101/span>span classline>capabilities..4/span>span classline>#/span>span classline># A fatal error has been detected by the Java Runtime Environment:/span>span classline>#/span>span classline># SIGSEGV (0xb) at pc0x00007f1268a72550, pid14296, tid139717301577472/span>span classline>#/span>span classline># JRE version: OpenJDK Runtime Environment (8.0_45-b14) (build 1.8.0_45-b14)/span>span classline># Java VM: OpenJDK 64-Bit Server VM (25.45-b02 mixed mode linux-amd64 compressed oops)/span>span classline># Problematic frame:/span>span classline># C 0x00007f1268a72550/span>span classline>#/span>span classline># Failed to write core dump. Core dumps have been disabled. To enable core dumping, try ulimit -c unlimited before starting Java again/span>span classline>#/span>span classline># An error report file with more information is saved as:/span>span classline># /home/carlos/Downloads/hs_err_pid14296.log/span>span classline>#/span>span classline># If you would like to submit a bug report, please visit:/span>span classline># http://bugreport.java.com/bugreport/crash.jsp/span>span classline>#/span>span classline>fish: Job 1, “javaws viewer.jnlp ” terminated by signal SIGABRT (Abort)/span>/code>/pre>/td>/tr>/table>/div>/figure>p>Looking into the log file gives no better clue./p>figure classcode>div classhighlight>table>tr>td classgutter>pre classline-numbers>span classline-number>1/span>span classline-number>2/span>span classline-number>3/span>span classline-number>4/span>span classline-number>5/span>span classline-number>6/span>span classline-number>7/span>span classline-number>8/span>span classline-number>9/span>span classline-number>10/span>span classline-number>11/span>span classline-number>12/span>span classline-number>13/span>span classline-number>14/span>span classline-number>15/span>span classline-number>16/span>span classline-number>17/span>/pre>/td>td classcode>pre>code class>span classline>--------------- T H R E A D ---------------/span>span classline>/span>span classline>Current thread (0x00007f1289ae0000): JavaThread iDRAC7 Virtual Console Client _thread_in_native, id14329, stack(0x00007f1278112000,0x00007f1278213000)/span>span classline>/span>span classline>siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x00007f1268a72550/span>span classline>/span>span classline>Registers:/span>span classline>RAX0x00007f1268a72550, RBX0x0000000000000378, RCX0x0000000000000000, RDX0x00007f12782102cf/span>span classline>RSP0x00007f12782102e8, RBP0x00007f1278210550, RSI0x00007f12698cf477, RDI0x00007f12698cf590/span>span classline>R8 0x00007f1298984908, R9 0x0000000000000000, R100x00007f1268d5e380, R110x0000000000000202/span>span classline>R120x0000000000000000, R130x00007f1269e15eb0, R140x00007f12782107b8, R150x00007f1289ae0000/span>span classline>RIP0x00007f1268a72550, EFLAGS0x0000000000010206, CSGSFS0x0000000000000033, ERR0x0000000000000014/span>span classline> TRAPNO0x000000000000000e/span>span classline>/span>span classline>Top of Stack: (sp0x00007f12782102e8)/span>span classline>0x00007f12782102e8: 00007f1269800440 0000000000000000/span>span classline>(...)/span>/code>/pre>/td>/tr>/table>/div>/figure>p>There is a lot of information there but going thru java stacktraces of your virtual console tool whileyour server is down is undesired at best./p>h2>Solution/h2>p>Fortunately the solution is simple./p>p>Open the code>viewer.jnlp/code> file.br/>There will be a bunch of OS and architecture-specific lines like this:/p>figure classcode>div classhighlight>table>tr>td classgutter>pre classline-numbers>span classline-number>1/span>span classline-number>2/span>span classline-number>3/span>span classline-number>4/span>span classline-number>5/span>span classline-number>6/span>span classline-number>7/span>span classline-number>8/span>span classline-number>9/span>/pre>/td>td classcode>pre>code class>span classline> <resources osWindows archx85>/span>span classline> <nativelib hrefhttps://server.example.com:443/software/avctKVMIOWin32.jar downloadeager/>/span>span classline> <nativelib hrefhttps://server.example.com:443/software/avctVMAPI_DLLWin32.jar downloadeager/>/span>span classline> </resources>/span>span classline> <resources osWindows archamd64>/span>span classline> <nativelib hrefhttps://server.example.com:443/software/avctKVMIOWin64.jar downloadeager/>/span>span classline> <nativelib hrefhttps://server.example.com:443/software/avctVMAPI_DLLWin64.jar downloadeager/>/span>span classline> </resources>/span>span classline> (...)/span>/code>/pre>/td>/tr>/table>/div>/figure>p>Delete all of them, except for the relevant one. In my case:/p>figure classcode>div classhighlight>table>tr>td classgutter>pre classline-numbers>span classline-number>1/span>span classline-number>2/span>span classline-number>3/span>span classline-number>4/span>/pre>/td>td classcode>pre>code class>span classline> <resources osLinux archx86_64>/span>span classline> <nativelib hrefhttps://server.example.com:443/software/avctKVMIOLinux64.jar downloadeager/>/span>span classline> <nativelib hrefhttps://server.example.com:443/software/avctVMAPI_DLLLinux64.jar downloadeager/>/span>span classline> </resources>/span>/code>/pre>/td>/tr>/table>/div>/figure>p>That’s it. Running code>javaws viewer.jnlp/code> should work fine now./p>p>I believe this is not the “correct” solution but it gets you going./p>/div> /article> article> header> h1 classentry-title>a href/blog/2014/07/08/talk-feedback/>Talk: Feedback/a>/h1> p classmeta> time datetime2014-07-08T01:01:00+08:00 pubdate data-updatedtrue>Jul 8span>th/span>, 2014/time> /p> /header> div classentry-content>p>em>This is a talk I gave at work. It’s the second time I give a similar talk so I’ve decided to post it up. Unfortunately I have no slides nor video so I’m posting my notes :–)/em>/p>h1>Feedback/h1>blockquote>p>Feedback: collecting information about present and past ofa process to drive changes to the process itself/p>/blockquote>p>Crucial to improve, if you don’t know at what speed you’rerunning you can’t adjust to the speed limit.br/>If you’re not aware of problems, you can’t fix them.br/>If you don’t see logs and exception stacktraces you won’tknow that your application crashes every time someone fromRussia visits your website./p>p>Phrased like this sounds like a good thing but when youthink about the actual process of giving/receiving feedbackit changes a bit.br/>Who likes performance appraisals? Code reviews?Submitting the system you worked on for 6 months to 3rd party review and scrutiny?/p>h1>Why are we afraid of giving feedback?/h1>p>When we ask for opinion/review, generally get “it’s ok/cool/nice”.br/>People point out obvious problems but it usually doesn’t go further./p>p>There are usually something that could be different.br/>A better way, an alternative way, an experimental way.br/>Not necessarily better but if you look at something andthink “I would have done it differently”, maybe you shouldsay that.br/>The other person might like your idea or it might triggeranother idea in her head./p>p>Another example.br/>You know that person who always do something when presentingthat distracts people from the presentation?br/>They repeat thesame phrase again and again or they mispronounce a word orwhatever and at the end of the talk everybody is whisperingabout how many times he did this or that?br/>That person could be a much better presenter if he could fixthat behavior but it won’t happen if he is not aware of it!/p>p>So, why are we so bad at giving feedback?/p>p>To answer that we need to look at another question./p>h1>Why are we so bad at receiving feedback?/h1>p>People don’t like being criticized.br/>Humans are wired like that :(br/>Hearing criticism doesn’t change who you are but we don’t like it anyway.br/>We go into defensive mode, we need to show we did the bestthing. We need to prove the person wrong!/p>p>To avoid confrontation, nobody wants to give nor receive feedback./p>h1>Why is it bad?/h1>p>If you both don’t give feedback not to hurt or make others angryand you don’t actively seek feedback, it only happens when a problemoccurs (or someone explodes). That’s the time when emotions are highand openness is low./p>p>That makes people less willing to seek improvement generating a vicious cycle./p>h1>How to fix it, then?/h1>p>Ermm../p>ul>li>Improve on how we provide feedback/li>li>Improve on how we receive feedback/li>/ul>h1>How to receive feedback/h1>p>You can’t force people to be nicer or to do things in a way that pleases you.br/>But you can improve on how you handle it, so focus on that./p>p>First, don’t take it personally.br/>Face everything as an opportunity to revisit a topic and think if anythingcould be improved.br/>Be open. You don’t have to agree but be willing to consider ideas.br/>If it is a complain or an aggressive criticism, try to filter out theoffending part and think about the root cause of that complain; Could youhave done anything different so that there would be no complain?/p>h1>How to give feedback/h1>p>Avoid doing it if you’re angry or in bad mood.br/>Consider what is the goal of your feedback and focus on having aconstructive conversation.br/>Don’t expect the person to agree. You willbe lucky if they at least listen :–)br/>Consider that your idea/suggestion might not be better or might bemissing parts of the picture.br/>Even better, assume you’re wrong; that there is something you don’t know.br/>Guide the conversation to try to understand where you’re wrong./p>h1>Wrap up/h1>p>Feedback is good, is crucial to improve (as person, as professional, as team).br/>Most people are bad at both giving and receiving and avoid it as much as possible.br/>There is no silver bullet, no easy solution.br/>Be aware of the problem. Consider how you could do it better.br/>Search about the topic, find more information :)br/>And most important, practice. Stop avoiding it./p>h1>Extra/h1>h2>Focus on the right stuff!/h2>blockquote>p>Criticism is driven by the frustration and fears of the giver, not from the needs of the recipient. The underlying assumption is that the recipient somehow “should know better” and needs to be set straight. The implied message is that the recipient’s intentions are questionable, that there is something wrong with the recipient that the giver of criticism knows how to fix. In criticism, the problem is all in the recipient.br/>In contrast, feedback has an air of caring concern, respect, and support. Far from being a sugar cookie, feedback is an honest, clear, adult to adult exchange about specific behaviors and the effects of those behaviors. The assumption is that both parties have positive intentions, that both parties want to be effective and to do what is right for the company and other people. Another assumption is that well-meaning people can have legitimate differences in perception. The person offering the feedback owns the feedback as being his reaction to the behavior of the other person. That is, the giver recognizes the fact that what is being offered is a perception, not absolute fact.br/>— Gary R. Casselman & Timothy C. Daughtry/p>/blockquote>p>div />/p>blockquote>p>Punishing honest mistakes stifles creativity. I want people moving and shaking the earth and they’re going to make mistakes.br/>— Ross Perot/p>/blockquote>h2>Links/h2>ul>li>a hrefhttp://www.drjeffspar.com/fearoffeedback.pdf>http://www.drjeffspar.com/fearoffeedback.pdf/a>/li>li>a hrefhttp://www.lifehack.org/articles/productivity/how-give-constructive-feedback-and-avoid-ugly-confrontations.html>http://www.lifehack.org/articles/productivity/how-give-constructive-feedback-and-avoid-ugly-confrontations.html/a>/li>/ul>p>Those are generally written for managers but the reasoning is the same./p>/div> /article> article> header> h1 classentry-title>a href/blog/2013/11/05/running-perl-workers-on-iron-dot-io/>Running Perl Workers on Iron.IO/a>/h1> p classmeta> time datetime2013-11-05T00:37:00+08:00 pubdate data-updatedtrue>Nov 5span>th/span>, 2013/time> /p> /header> div classentry-content>p>Despite not being listed as an option on their documentation, it is possible to run a hrefhttp://www.perl.org/>perl/a> on their a hrefhttps://www.iron.io/worker>IronWorker/a> service./p>blockquote>p>TL;DR (or Show Me The Code): a hrefhttps://github.com/carloslima/iron-play>working example, full sources/a>./p>/blockquote>h1>Quick start/h1>h2>IronWorkerNG (their upload/management tool)/h2>p>We will need their management tool to upload code./p>pre>code>gem install iron_worker_ng/code>/pre>h2>The credentials/h2>p>IronWorkerNG reads the credentials from a file named code>iron.json/code>.br/>To get it, we need to login to a hrefhttps://hud.iron.io/dashboard,>https://hud.iron.io/dashboard,/a> click on the key-icon and download code>iron.json/code> to the root directory of the project./p>h2>Resolving dependencies on CPAN modules/h2>p>Iron.IO doesn’t come with any perl module other than what is in a hrefhttp://perldoc.perl.org/5.14.2/index-modules-A.html>core/a>, so we need to bring in all our dependencies./p>p>For that we will use a hrefhttps://metacpan.org/pod/Carton>Carton/a>/p>pre>code>$ cpanm -nq Carton # install carton/code>/pre>p>add our dependencies to code>cpanfile/code>/p>pre>code>$ cat cpanfilerequires Data::Printer;requires File::Slurp;requires Mojolicious;/code>/pre>p>and install them to a ./local/ directory/p>pre>code>$ carton install/code>/pre>h2>Seting up the worker/h2>p>The configuration for the worker is defined in a code><service>.worker/code> file, so we create a simple one that tells it to run our perl script and to upload our dependencies (generated by Carton, above) together with the code./p>pre>code>$ cat iron-pl.workerruntime perlexec iron-pl.pldir local/lib/perl5/code>/pre>p>This will upload our code together with the code>./local/lib/perl5/code> directory (as code>./perl5/code> on their system)/p>p>For more information, check the a hrefhttps://dev.iron.io/worker/reference/dotworker/>.worker documentation/a>./p>h2>Writing the code!/h2>p>This is what will be run when you schedule some tasks.br/>We can go crazy on that one, but here I’d like to highlight just a few things:/p>pre>code>#!/usr/bin/env perluse 5.010; use utf8; use strict; use warnings;(...)use lib perl5;/code>/pre>p>We need to load the dependencies from the local directory, thus the code>use lib/code> above./p>pre>code>(...)my %args @ARGV;/code>/pre>p>They pass arguments as code>(-d, /task/, -e, production, -id, 5277ca9ed16f93360109d0aa, -payload, /task/task_payload.json)/code> so we can load them as a Hash and access it as code>$args{-d}/code> :–)/p>p>The data passed from the scheduled task to the worker comes in a code>.json/code> file, so we need to parse that/p>pre>code>my $payload Mojo::JSON->new->decode( read_file($args{-payload}) );/code>/pre>p>For more info (and executable code), check the a hrefhttps://github.com/carloslima/iron-play>full sources/a> on github./p>h2>Deploy/h2>p>With all pieces ready, we can upload the code to their platform using their management tool./p>pre>code>$ iron_worker upload iron-pl.worker ------> Creating client Project ironing-board with id5277a2b987a3b90005000044 ------> Creating code package Found workerfile with pathiron-pl.worker Detected exec with pathiron-pl.pl and args{} Merging dir with pathlocal/lib/perl5 and dest Code package name is iron-pl ------> Uploading code package iron-pl Code package uploaded with id5277af07c7abc62bd5098755 and revision4 Check https://hud.iron.io/tq/projects/5277a2b987a3b90005000044/code/5277af07c7abc62bd5098755 for more info/code>/pre>h2>Add tasks to the queue/h2>pre>code>$ iron_worker queue iron-pl -p {tags:iron.io,perl} ------> Creating client Project ironing-board with id5277a2b987a3b90005000044 ------> Queueing task Code package iron-pl queued with id5277ca9ed16f93360109d0aa Check https://hud.iron.io/tq/projects/5277a2b987a3b90005000044/jobs/5277ca9ed16f93360109d0aa for more info/code>/pre>h2>Check results/h2>p>We can either go straight to the web interface using the url listed above or use their management tool:/p>pre>code> $ iron_worker log 5277ca9ed16f93360109d0aa ------> Creating client Project ironing-board with id5277a2b987a3b90005000044 ------> Getting log for task with id5277ca9ed16f93360109d0aa Iron-Play v0.0.1 2013-11-04T16:26:10 Environment: { HOME /task, LANG en_US.UTF-8, LD_LIBRARY_PATH .:./lib:./__debs__/usr/lib:./__debs__/usr/lib/x86_64-linux-gnu:./__debs__/lib:./__debs__/lib/x86_64-linux-gnu, LOGNAME nobody, MAIL /var/mail/nobody, OLDPWD /task, PATH .:./bin:./__debs__/usr/bin:./__debs__/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games, PWD /task, SHELL /bin/sh, SUDO_COMMAND /usr/bin/ruby run.rb --sleep 60 -e production -n 1 -j /mnt/iron-jail, SUDO_GID 1000, SUDO_UID 1000, SUDO_USER ubuntu, TERM unknown, USER nobody, USERNAME root } Arguments: { -d /task/, -e production, -id 5277ca9ed16f93360109d0aa, -payload /task/task_payload.json } Payload (/task/task_payload.json): \ { tags 0 iron.io, 1 perl } Top users for tag iron.io: AnaelFavre: 417 thousandsofthem: 446 Travis R: 6935 Top users for tag perl: ikegami: 106098 mpapec: 10324 TLP: 40585 Done./code>/pre>h2>But, but../h2>p>Of course, this example is not very useful, manually scheduling tasks and getting results from calling code>iron_worker log <id>/code> is not really something interesting :–)/p>p>To be useful it would need to be automatically triggered by some event and produce usable results (updating a databse, notifying another service, etc..) but I assume you already know this if you’re searching for how to run perl on IronWorker./p>p>So, go crazy and drop me a hello on the comments bellow if this post was somehow helpful./p>p>Cheers! \o//p>/div> /article> article> header> h1 classentry-title>a href/blog/2013/10/18/dns-and-ptr-records-quick-notes/>Dns and Ptr Records Quick Notes/a>/h1> p classmeta> time datetime2013-10-18T03:18:00+08:00 pubdate data-updatedtrue>Oct 18span>th/span>, 2013/time> /p> /header> div classentry-content>p>Every once in a blue moon I get to troubleshoot, help someone with or explain how reverse dns works but somehow it keeps getting misplaced inside my brain./p>p>So, for my future self, here it is:/p>p>As example, lets pick github’s IP./p>pre>code>carlos@multi ~$ host github.comgithub.com has address 192.30.252.129/code>/pre>p>The key thing to remember is that it is the same as forward dns, just on a “funny” zone name./p>p>In our example, the reverse dns record is: code>129.252.30.192.in-addr.arpa/code>br/>(and the zone code>252.30.192.in-addr.arpa/code>)/p>h2>Find the authority over that zone:/h2>pre>code>carlos@multi ~$ dig 129.252.30.192.in-addr.arpa; <<>> DiG 9.8.1-P1 <<>> 129.252.30.192.in-addr.arpa;; global options: +cmd;; Got answer:;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21414;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0;; QUESTION SECTION:;129.252.30.192.in-addr.arpa. IN A;; AUTHORITY SECTION:252.30.192.in-addr.arpa. 60 IN SOA ns1.p16.dynect.net. ops.github.com. 7 3600 600 604800 60;; Query time: 72 msec;; SERVER: 127.0.1.1#53(127.0.1.1);; WHEN: Fri Oct 18 03:25:41 2013;; MSG SIZE rcvd: 113/code>/pre>h2>Get the PTR record for that ip:/h2>pre>code>carlos@multi ~$ dig PTR 129.252.30.192.in-addr.arpa; <<>> DiG 9.8.1-P1 <<>> PTR 129.252.30.192.in-addr.arpa;; global options: +cmd;; Got answer:;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29787;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0;; QUESTION SECTION:;129.252.30.192.in-addr.arpa. IN PTR;; ANSWER SECTION:129.252.30.192.in-addr.arpa. 3189 IN PTR ip1b-lb3-prd.iad.github.com.;; Query time: 29 msec;; SERVER: 127.0.1.1#53(127.0.1.1);; WHEN: Fri Oct 18 03:28:44 2013;; MSG SIZE rcvd: 86/code>/pre>h3>Directly from authority/h3>p>And if you’re trying to troubleshoot whether your ISP correctly updated the PTR records you requested, you can ask the authority directly and avoid waiting for propagation:/p>pre>code>carlos@multi ~$ dig PTR 129.252.30.192.in-addr.arpa @ns1.p16.dynect.net; <<>> DiG 9.8.1-P1 <<>> PTR 129.252.30.192.in-addr.arpa @ns1.p16.dynect.net;; global options: +cmd;; Got answer:;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51495;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 0;; WARNING: recursion requested but not available;; QUESTION SECTION:;129.252.30.192.in-addr.arpa. IN PTR;; ANSWER SECTION:129.252.30.192.in-addr.arpa. 3600 IN PTR ip1b-lb3-prd.iad.github.com.;; AUTHORITY SECTION:252.30.192.in-addr.arpa. 86400 IN NS ns1.p16.dynect.net.252.30.192.in-addr.arpa. 86400 IN NS ns3.p16.dynect.net.252.30.192.in-addr.arpa. 86400 IN NS ns2.p16.dynect.net.252.30.192.in-addr.arpa. 86400 IN NS ns4.p16.dynect.net.;; Query time: 476 msec;; SERVER: 2001:500:90:1::16#53(2001:500:90:1::16);; WHEN: Fri Oct 18 03:31:39 2013;; MSG SIZE rcvd: 172/code>/pre>h2>Just simple resolution/h2>p>Now, for completeness sake, if all you want is the reverse dns, remember that code>host/code> works on both ip and name./p>pre>code>carlos@multi ~$ host github.comgithub.com has address 192.30.252.130github.com mail is handled by 30 ASPMX3.GOOGLEMAIL.com.github.com mail is handled by 30 ASPMX2.GOOGLEMAIL.com.github.com mail is handled by 20 ALT1.ASPMX.L.GOOGLE.com.github.com mail is handled by 10 ASPMX.L.GOOGLE.com.github.com mail is handled by 20 ALT2.ASPMX.L.GOOGLE.com.carlos@multi ~$ host 192.30.252.130130.252.30.192.in-addr.arpa domain name pointer ip1c-lb3-prd.iad.github.com.carlos@multi ~$ /code>/pre>/div> /article> article> header> h1 classentry-title>a href/blog/2013/10/16/git-submodules-how-not-to-use-it/>Git Submodules: How (Not) to Use It./a>/h1> p classmeta> time datetime2013-10-16T01:35:00+08:00 pubdate data-updatedtrue>Oct 16span>th/span>, 2013/time> /p> /header> div classentry-content>h1>Intro (or What’s a git submodule?)/h1>p>On our system, /dev/SuperFoo/sub-bar is a submodule of SuperFoo.git repository./p>pre>code>carlos@carlosdev /d/SuperFoo (master)> git log -1commit c2abbad057a02a2bd0d7c1e1c74048da6ef88234Author: Chuck Norris <a href/cdn-cgi/l/email-protection class__cf_email__ data-cfemail0a69627f69614a6f726b677a666f24696567>email protected/a>>Date: Thu Oct 10 02:35:16 2013 +0000 Updated to latest translation/code>/pre>p> /p>pre>code>carlos@carlosdev /d/SuperFoo (master)> cd sub-barcarlos@carlosdev /d/S/sub-bar ((2279a91))> git log -1commit 2279a9187b023f79cf274f52a76fe5059f119914Merge: fc57e1a a3110e8Author: Chuck Norris <a href/cdn-cgi/l/email-protection class__cf_email__ data-cfemailb3d0dbc6d0d8f3d6cbd2dec3dfd69dd0dcde>email protected/a>>Date: Thu Oct 10 02:24:15 2013 +0000 Merge branch master into currenttranslations/code>/pre>h1>so what?/h1>p>They are disconnected, despite being shown/accessible as a regular subdirectory of your main project./p>h2>again?/h2>pre>code>carlos@carlosdev /d/SuperFoo (master)> vi sub-bar/templates/home/login.html.haml cgi/fooish.cgi..(change change change)..carlos@carlosdev /d/SuperFoo (master)> git status# On branch master# Changes not staged for commit:# (use git add <file>... to update what will be committed)# (use git checkout -- <file>... to discard changes in working directory)# (commit or discard the untracked or modified content in submodules)## modified: sub-bar (modified content)# modified: cgi/fooish.cgi#no changes added to commit (use git add and/or git commit -a)/code>/pre>p>sub-bar/ files em>are not/em> part of your repository!/p>p>Look again:/p>pre>code>carlos@carlosdev /d/SuperFoo (master)> git diffdiff --git a/sub-bar b/sub-bar--- a/sub-bar+++ b/sub-bar@@ -1 +1 @@-Subproject commit 2279a9187b023f79cf274f52a76fe5059f119914+Subproject commit 2279a9187b023f79cf274f52a76fe5059f119914-dirtydiff --git a/cgi/fooish.cgi b/cgi/fooish.cgiindex c607f79..2b1ce17 100755--- a/cgi/fooish.cgi+++ b/cgi/fooish.cgi@@ -1,4 +1,3 @@-#!/usr/bin/perl use strict; use warnings;carlos@carlosdev /d/SuperFoo (master)> /code>/pre>h1>Ok, got it. But what’s the deal? (or, What could possibly go wrong?)/h1>p>This em>happened/em> before, more than once. Not hypothetical./p>pre>code>carlos@carlosdev /d/SuperFoo (bugfixes)> git status# On branch bugfixes# Your branch is behind origin/bugfixes by 1813 commits, and can be fast-forwarded.#nothing to commit (working directory clean)carlos@carlosdev /d/SuperFoo (bugfixes)> git rebase -pSuccessfully rebased and updated refs/heads/bugfixes./code>/pre>p>All good. Let’s go fix our ticket!/p>pre>code>carlos@carlosdev /d/SuperFoo (bugfixes)> vi lib/README.txt carlos@carlosdev /d/SuperFoo (bugfixes)> git diffdiff --git a/sub-bar b/sub-barindex 8b6fa45..eac1423 160000--- a/sub-bar+++ b/sub-bar@@ -1 +1 @@-Subproject commit 8b6fa45a258e37293d472c81844a3c37e921b6f9+Subproject commit eac1423fcb1812e0ff958712231dddc06687733cdiff --git a/lib/README.txt b/lib/README.txtindex 293a71f..e9a6e01 100644--- a/lib/README.txt+++ b/lib/README.txt@@ -1,4 +1,4 @@ This directory holds shared code between all sub-projects. Please keep it clean.-See https://internal.example.com/wiki/code-rules+See https://example.thirdparty-inthecloud.net/wiki/code-rules/code>/pre>p>Looks good, simple enough./p>pre>code>carlos@carlosdev /d/SuperFoo (bugfixes)> git commit -am Fix wrong urlbugfixes 9ecfc7d Fix wrong url 2 files changed, 2 insertions(+), 2 deletions(-)/code>/pre>p>Cheers! We just rolled back sub-bar by 1 month./p>pre>code>carlos@carlosdev /d/S/sub-bar ((eac1423))> git log -1 8b6fa45a258e37293d472c81844a3c37e921b6f9commit 8b6fa45a258e37293d472c81844a3c37e921b6f9Author: Michelle Yeoh <a href/cdn-cgi/l/email-protection class__cf_email__ data-cfemailb5d8dcf5d0cdd4d8c5d9d09bd6dad8>email protected/a>>Date: Thu Oct 3 11:52:38 2013 +0000 Translated using Weblate (Portuguese) Currently translated at 100.0% (448 of 448 strings)/code>/pre>p> /p>pre>code>carlos@carlosdev /d/S/sub-bar ((eac1423))> git log -1 eac1423fcb1812e0ff958712231dddc06687733ccommit eac1423fcb1812e0ff958712231dddc06687733cAuthor: Angelina Jolie <a href/cdn-cgi/l/email-protection class__cf_email__ data-cfemaildabbb4bdb3bf9abfa2bbb7aab6bff4b9b5b7>email protected/a>>Date: Mon Sep 2 02:10:57 2013 +0000 Tidy/code>/pre>p>Next time bugfixes gets released, the version of sub-bar in production will be from 1 month ago./p>p>Not just minor changes../p>pre>code>carlos@carlosdev /d/S/sub-bar ((eac1423))> git diff --stat eac1423..8b6fa45.. snip ..78 files changed, 5871 insertions(+), 1435 deletions(-)/code>/pre>h1>Why did that happen?/h1>p>Because it is a separate repository, git only tracks three things about the submodule:/p>ul>li>url of the external repository/li>li>path where the files will be put/cloned/li>li>the commit id from that repository that you want to use./li>/ul>p>They are:/p>pre>code>carlos@carlosdev /d/SuperFoo (bugfixes)> cat .gitmodulessubmodule sub-bar path sub-bar url a href/cdn-cgi/l/email-protection class__cf_email__ data-cfemail43242a3703212a372136202826376d2c3124>email protected/a>:exampledotcom/sub-bar.gitcarlos@carlosdev /d/SuperFoo (bugfixes)> git ls-tree bugfixes..snip..100644 blob 2d918f0b794c059d6900e7211cd34e22aa395a77 Makefile ← file040000 tree 486d5dafd1d4fd7ff4f8cf3b273d5912e84666ae api ← directory160000 commit eac1423fcb1812e0ff958712231dddc06687733c sub-bar ← submodule (commit id to use)..snip../code>/pre>p>When we did the rebase, the changes included updates to the version of sub-bar that the SuperFoo repository should be using.br/>But git em>DOES NOT/em> checkout that new version inside the sub-bar directory./p>p>Git knows we should be using commit 8b6fa45br/>But on sub-bar directory we have eac1423 (from before the rebase)/p>p>It doesn’t know (or care) if the commits are newer, older, etc.br/>So, when we did code>git commit -am.../code> without paying attention to that sub-bar mention that appeared on code>git diff/code> or code>git status/code>, we told git that we want it to use commit eac1423, which is what we have checked out at the moment./p>h1>This is really confusing. I don’t care about sub-bar and I’m not touching it, how do I avoid breaking things?/h1>p>First and foremost, when code>git status/code> or code>git diff/code> shows sub-bar, em>do not ignore it/em>./p>p>The root cause is that when you move your repository to a different state, git won’t automatically move the submodule to the new expected commit.br/>So we fix it with code>git submodule update/code>./p>p>The name might be counter-intuitive, but code>git submodule update/code> doesn’t change/write/commit/push the submodule, it just runs a checkout of the expected commit./p>p>Second, don’t code>git add sub-bar/code>;br/>(Unless updating the submodule to a new version is what you’re trying to do.)/p>h2>Caveats/h2>h3>Bitbucket/h3>p>Bitbucket (as of 2013-10-10) won’t show changes to submodules on their diff.br/>That means reviewers won’t be able to see that you made a mistake!/p>h3>git commit -a / git commit ./h3>p>Please, don’t do it. Ever.br/>This will happily commit every change you have on disk.br/>It is an horrible practice, much more dangerous when submodules are involved.br/>Always review your changes with code>git status/code> and code>git diff/code>.br/>Don’t commit anything you didn’t mean to./p>/div> /article> article> header> h1 classentry-title>a href/2010/03/methodmissing-and-respondto-doing-it.html>Method_missing and Respond_to?: Doing It Properly/a>/h1> p classmeta> time datetime2010-03-09T00:00:00+08:00 pubdate data-updatedtrue>Mar 9span>th/span>, 2010/time> /p> /header> div classentry-content>p>Sometime ago while using code>method_missing/code> to implement some functionality I got the weird behavior that it would work onlyem>most/em> of the time but not always.br/>In retrospect it’s now pretty obvious but in the heat of the moment it took me about half a day of investigation and talkingbefore I figured it out./p>p>What happened is that I did only half of the work.br/>I defined code>method_missing/code> but I forgot to define code>respond_to?/code> accordingly.br/>The result is that it worked when I called it directly on the instance, but failed if an association was involved./p>p>To give an example, say you have a class like this:/p>figure classcode>figcaption>span>/span>/figcaption>div classhighlight>table>tr>td classgutter>pre classline-numbers>span classline-number>1/span>span classline-number>2/span>span classline-number>3/span>span classline-number>4/span>span classline-number>5/span>span classline-number>6/span>span classline-number>7/span>span classline-number>8/span>span classline-number>9/span>span classline-number>10/span>span classline-number>11/span>span classline-number>12/span>span classline-number>13/span>/pre>/td>td classcode>pre>code classruby>span classline>span classk>class/span> span classnc>A/span> span classo></span> span classss>ActiveRecord/span>span classp>:/span>span classss>:Base/span>/span>span classline> span classk>def/span> span classnf>example/span>/span>span classline> span classkp>true/span>/span>span classline> span classk>end/span>/span>span classline>/span>span classline> span classk>def/span> span classnf>method_missing/span>span classp>(/span>span classnb>method/span>span classp>,/span> span classo>*/span>span classn>args/span>span classp>)/span>/span>span classline> span classk>if/span> span classnb>method/span>span classo>./span>span classn>to_s/span> span classo>~/span> span classsr>/example//span>/span>span classline> span classn>example/span>/span>span classline> span classk>else/span>/span>span classline> span classk>super/span>/span>span classline> span classk>end/span>/span>span classline> span classk>end/span>/span>span classline>span classk>end/span>/span>/code>/pre>/td>/tr>/table>/div>/figure>p>Calling em>example/em> directly on your instance works just fine./p>figure classcode>figcaption>span>/span>/figcaption>div classhighlight>table>tr>td classgutter>pre classline-numbers>span classline-number>1/span>span classline-number>2/span>span classline-number>3/span>span classline-number>4/span>span classline-number>5/span>/pre>/td>td classcode>pre>code classirb>span classline>span classgp>>> /span>span classn>A/span>span classo>./span>span classn>new/span>span classo>./span>span classn>my_example/span>/span>span classline>span classgo>> true/span>/span>span classline>/span>span classline>span classgp>>> /span>span classn>A/span>span classo>./span>span classn>create!/span>span classo>./span>span classn>example_me?/span>/span>span classline>span classgo>> true/span>/span>/code>/pre>/td>/tr>/table>/div>/figure>p>All fine, but as soon as you get an association in the middle of things:/p>figure classcode>figcaption>span>/span>/figcaption>div classhighlight>table>tr>td classgutter>pre classline-numbers>span classline-number>1/span>span classline-number>2/span>span classline-number>3/span>/pre>/td>td classcode>pre>code classruby>span classline>span classk>class/span> span classnc>B/span> span classo></span> span classss>ActiveRecord/span>span classp>:/span>span classss>:Base/span>/span>span classline> span classn>belongs_to/span> span classss>:a/span>/span>span classline>span classk>end/span>/span>/code>/pre>/td>/tr>/table>/div>/figure>p>It just doesn’t go well anymore:/p>figure classcode>figcaption>span>/span>/figcaption>div classhighlight>table>tr>td classgutter>pre classline-numbers>span classline-number>1/span>span classline-number>2/span>span classline-number>3/span>span classline-number>4/span>span classline-number>5/span>span classline-number>6/span>span classline-number>7/span>span classline-number>8/span>span classline-number>9/span>span classline-number>10/span>span classline-number>11/span>span classline-number>12/span>span classline-number>13/span>span classline-number>14/span>span classline-number>15/span>/pre>/td>td classcode>pre>code classirb>span classline>span classgp>>> /span>span classn>b/span> span classo>/span> span classn>B/span>span classo>./span>span classn>new/span>span classp>(/span>span classss>:a/span>span classo>>/span>span classn>A/span>span classo>./span>span classn>new/span>span classp>)/span>/span>span classline>span classgo>> #<B id: nil, a_id: nil, created_at: nil, updated_at: nil>/span>/span>span classline>/span>span classline>/span>span classline>span classgp>>> /span>span classn>b/span>span classo>./span>span classn>a/span>span classo>./span>span classn>example?/span>/span>span classline>span classgo>NoMethodError: undefined method example?' for #<A id: nil, created_at: nil, updated_at: nil>/span>/span>span classline>span classgo> from /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/associations/association_proxy.rb:220:inmethod_missing’/span>/span>span classline>span classgo>from (irb):55/span>/span>span classline>/span>span classline>span classgp>>> /span>span classn>b/span> span classo>/span> span classn>B/span>span classo>./span>span classn>create!/span>span classp>(/span>span classss>:a/span>span classo>>/span>span classn>A/span>span classo>./span>span classn>create!/span>span classp>)/span>/span>span classline>span classgo>> #<B id: 4, a_id: 7, created_at: “2010-03-08 21:15:01”, updated_at: “2010-03-08 21:15:01”>/span>/span>span classline>span classgp>>> /span>span classn>b/span>span classo>./span>span classn>a/span>span classo>./span>span classn>failing_example/span>/span>span classline>span classgo>NoMethodError: undefined method failing_example' for #<ActiveRecord::Associations::BelongsToAssociation:0xb70491d0>/span>/span>span classline>span classgo> from /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/associations/association_proxy.rb:220:inmethod_missing’/span>/span>span classline>span classgo>from (irb):57/span>/span>/code>/pre>/td>/tr>/table>/div>/figure>p>Now, this last error is a bit clearer but I don’t remember running into it at the time.br/>If I had just followed the association_proxy:220 hint right away… ;)/p>p>What happens is that code>b.a/code> doesn’t return the instance but rather an a hrefhttp://apidock.com/rails/ActiveRecord/Associations/AssociationProxy>AssociationProxy/a> instance that provides ActiveRecord’sextended functionality and this proxy relies on code>A#respond_to?/code> to correctly forward method calls to the actual instance./p>p>What I should have done is:br>/p>figure classcode>figcaption>span>/span>/figcaption>div classhighlight>table>tr>td classgutter>pre classline-numbers>span classline-number>1/span>span classline-number>2/span>span classline-number>3/span>span classline-number>4/span>span classline-number>5/span>span classline-number>6/span>span classline-number>7/span>span classline-number>8/span>span classline-number>9/span>span classline-number>10/span>span classline-number>11/span>span classline-number>12/span>span classline-number>13/span>span classline-number>14/span>span classline-number>15/span>span classline-number>16/span>span classline-number>17/span>span classline-number>18/span>span classline-number>19/span>span classline-number>20/span>span classline-number>21/span>/pre>/td>td classcode>pre>code classruby>span classline>span classk>class/span> span classnc>A/span> span classo></span> span classss>ActiveRecord/span>span classp>:/span>span classss>:Base/span>/span>span classline> span classk>def/span> span classnf>example/span>/span>span classline> span classkp>true/span>/span>span classline> span classk>end/span>/span>span classline>/span>span classline> span classk>def/span> span classnf>method_missing/span>span classp>(/span>span classnb>method/span>span classp>,/span> span classo>*/span>span classn>args/span>span classp>)/span>/span>span classline> span classk>if/span> span classnb>method/span>span classo>./span>span classn>to_s/span> span classo>~/span> span classsr>/example//span>/span>span classline> span classn>example/span>/span>span classline> span classk>else/span>/span>span classline> span classk>super/span>/span>span classline> span classk>end/span>/span>span classline> span classk>end/span>/span>span classline>/span>span classline> span classk>def/span> span classnf>respond_to?/span>span classp>(/span>span classnb>method/span>span classp>,/span> span classn>include_private/span> span classo>/span> span classkp>false/span>span classp>)/span>/span>span classline> span classk>if/span> span classnb>method/span>span classo>./span>span classn>to_s/span> span classo>~/span> span classsr>/example//span>/span>span classline> span classkp>true/span>/span>span classline> span classk>else/span>/span>span classline> span classk>super/span>/span>span classline> span classk>end/span>/span>span classline> span classk>end/span>/span>span classline>span classk>end/span>/span>/code>/pre>/td>/tr>/table>/div>/figure>figure classcode>figcaption>span>/span>/figcaption>div classhighlight>table>tr>td classgutter>pre classline-numbers>span classline-number>1/span>span classline-number>2/span>span classline-number>3/span>span classline-number>4/span>/pre>/td>td classcode>pre>code classirb>span classline>span classgp>>> /span>span classn>B/span>span classo>./span>span classn>create!/span>span classp>(/span>span classss>:a/span>span classo>>/span>span classn>A/span>span classo>./span>span classn>create!/span>span classp>)/span>span classo>./span>span classn>a/span>span classo>./span>span classn>example?/span>/span>span classline>span classgo>> true/span>/span>span classline>span classgp>>> /span>span classn>B/span>span classo>./span>span classn>new/span>span classp>(/span>span classss>:a/span>span classo>>/span>span classn>A/span>span classo>./span>span classn>new/span>span classp>)/span>span classo>./span>span classn>a/span>span classo>./span>span classn>failing_example/span>/span>span classline>span classgo>> true/span>/span>/code>/pre>/td>/tr>/table>/div>/figure>p>There are some much better write-ups on this topic, if you want to read more:/p>ul>li>a hrefhttp://technicalpickles.com/posts/using-method_missing-and-respond_to-to-create-dynamic-methods/>Using method_missing and respond_to? to create dynamic methods/a>/li>li>a hrefhttp://coderrr.wordpress.com/2008/07/11/solving-the-method_missing-respond_to-problem/>Solving the method_missing/respond_to? problem/a>/li>/ul>p>Now, I must be honest here: what I was doing was a strong>big/strong> code smell :)br/>It taught me the lesson to use method_missing properly and was even quite fun to debug and all that but what I really needed andend up doing in that case was a group of a hrefhttp://apidock.com/rails/Module/delegate>delegates/a> here and there and voilà, it was all cool and clean./p>/div> /article> article> header> h1 classentry-title>a href/2010/03/solutionatic-pair-programming.html>Solutionatic Pair Programming/a>/h1> p classmeta> time datetime2010-03-02T00:00:00+08:00 pubdate data-updatedtrue>Mar 2span>nd/span>, 2010/time> /p> /header> div classentry-content>div classpost>h1>Remote Pair Programming/h1>A few weeks ago, a hrefhttp://www.knowing.net>Larry O’Brien/a> and I set out to experiment with Remote Pair Programming.br />He wrote about it on his SDTimes column: a hrefhttp://www.sdtimes.com/WINDOWS__NET_WATCH_PROBLEMATIC_PAIR_PROGRAMMING/By_Larry_O_Brien/About_EXTREMEPROGRAMMING/34158>Windows & .NET Watch: Problematic pair programming/a>br />br />We both liked the experience and would be rather happy to be able to work on a long term project that way (anyone hiring a remote pair?), but since his column gives more emphasis to the down sides, I thought I could write my point of view which is more on the up side ;)br />br />In general, I agree on the down sides but I got so excited with the advantages I saw that I would barely remember mentioning the problems if asked.br />br />h2>The focus/h2>br />Working in pair forces you to focus on the work.br />There is just no way you can be there and not be paying attention to whatever it is that you’re supposed to do.br />You get so focused in the work and the communication that the environmental noise that would otherwise annoy you just seem to disappear.br />The speed in which you make progress can vary with a lot of factors but you are *guaranteed* to make some progress. All. The. Time.br />br />h2>The challenge/h2>br />The fact that someone is watching your every step means that you keep challenging yourself to do things the best way you can.br />You just can’t look sloppy to your pair.br />That means you avoid cutting corners or knowingly doing the wrong thing out of laziness or “to fix it later”.br />If you do something that feels wrong, you’ll be called on it and have to defend your point, so, unless it’s worth the trouble, you just work a bit harder and go for the right thing.br />br />h2>The safety feeling/h2>br />You certainly feel more confident about every line of code you write.br />Anything absurdly wrong will surely get catch by one or the other.br />Even the small errors or typos get spotted really fast.br />Sure, things can still be wrong, bugged or bad designed but the fact that the code was co-created and reviewed by at least one more person gives you a comforting feeling.br />br />h2>The learning/h2>br />Working with someone else full time means you’re continuously learning or at least exercising a different approach than your own.br />You learn new tricks.br />You get to defend your points.br />And you question everything.br />At the end of the day, you feel actively improving in many things.br />Even your English, if you’re not a native speaker ;)br />br />h2>The loneliness/h2>br />Working remotely means you’re almost always alone.br />When your clients are in different countries, thousands of miles away, that’s guaranteed.br />It’s just too expensive, time consuming and a tiresome task to travel for a meeting.br />If there is something I miss every now and then it’s having someone at close reach that I can share work stuff and work together.br />Working in a pair was a comforting step in that direction.br />br />h2>The results/h2>br />We shared the resulting project on Github.br />If you’d like to poke around, it’s available at a hrefhttps://github.com/carloslima/pasteme>http://github.com/carloslima/pasteme/a>br />br />Overall, I consider it was a big win over the solo experience.br />There is only one thing that could be much better and that’s the IDE/Tools support.br />While sharing a VM using VNC mostly worked, it didn’t come close to the experience you get when you use Saros, Bespin or even Google Wave.br />Being able to use all your monitors, drag windows around and organize it the way you like better would definitely improve the experience.br />br />Have a different opinion or want to suggest a different tool?br />Just drop me a comment!/div>/div> /article> article> header> h1 classentry-title>a href/2010/03/rsnapshot-style-backups-on-dreamhost.html>RSnapshot-style Backups on Dreamhost/a>/h1> p classmeta> time datetime2010-03-02T00:00:00+08:00 pubdate data-updatedtrue>Mar 2span>nd/span>, 2010/time> /p> /header> div classentry-content>div classpost>h1>DHSnapshot/h1>A while ago I needed to find a good setup for backing up some machines.br />br />I wanted to use a hrefhttp://samba.anu.edu.au/rsync/>RSync/a> to do a hrefhttp://www.mikerubel.org/computers/rsync_snapshots/>snapshots-like backups/a>.br />br />This setup is:br />* Off-sitebr />* Storage efficient (the bulk of my backup was unlikely to ever change)br />* Network efficient (only transfer changed files)br />* Keeps versions going back a few monthsbr />br />Now, a hrefhttp://www.dreamhost.com>DreamHost/a> offers 50GB of free space for personal backups and that seemed a good fit for this particular situation.br />br />Then I found a hrefhttp://rsnapshot.org/>RSnapshot/a> and it was exactly what I needed.br />Unfortunately, RSnapshot doesn’t backup to an external server. br />It’s meant to work in a setup where the server hosting the backups connects to your data sources and pull the files.br />That totally makes sense and is probably the best setup but it wouldn’t work for me.br />br />DreamHost doesn’t have RSnapshot installed on their backup servers and the only access users have to that machine is SFTP and RSync. br />I needed something that would work with just that.br />br />I came across a post about a hrefhttp://blog.wangling.me/2009/07/meta-backup-dreamhost-on-dreamhost-backups/>backing up DreamHost websites to DreamHost Backups/a> that showed a workaround to the lack of SSH access to the backups service.br />br />So I took the idea, mixed it up with the stuff I wanted from RSnapshot and wrote a small perl script to do it.br />br />It’s called a hrefhttps://github.com/carloslima/dhsnapshot>dhsnapshot/a> and is published at GitHub: a hrefhttps://github.com/carloslima/dhsnapshot>http://github.com/carloslima/dhsnapshot/a> br />br />At this moment, it’s not very flexible: it’s hardwired to keep 7 daily, 4 weekly and 6 monthly backups and it’s also limited to a single backup source (you can only point it to one source directory)br />But it’s not hard to change, or even make it configurable.br />I might do it if I ever get the need or motivation :)br />br />One way or the other, it should be reasonably simple to setup (a hrefhttps://github.com/carloslima/dhsnapshot#readme>instructions on GitHub/a>).br />br />I’d be glad to know if it helped anyone.br />So, please, drop me a comment if you fnd it useful./div>/div> /article> article> header> h1 classentry-title>a href/2010/02/hosting-your-git-repository-on.html>Hosting Your GIT Repository on DreamHost/a>/h1> p classmeta> time datetime2010-02-25T00:00:00+08:00 pubdate data-updatedtrue>Feb 25span>th/span>, 2010/time> /p> /header> div classentry-content>p>A few weeks ago I needed a private remote a hrefhttp://git-scm.com>Git/a> repository.br/>Since I already have a a hrefhttp://www.dreamhost.com>DreamHost/a> account, I didn’t want to pay for a hrefhttps://github.com>GitHub/a> just to be able to set my repository as private./p>p>DreamHost does not officially support Git on their Web Panel, so you must set things up manually./p>p>There is a a hrefhttp://wiki.dreamhost.com/Git>Git entry on their Wiki/a> but it looked a bit messy, so I decided to write a cleaner tutorial./p>p>Keep in mind that I’m using a hrefhttp://www.kernel.org/pub/software/scm/git/docs/howto/setup-git-server-over-http.txt>WebDAV/a>.br/>It allows more than one user to push to the same repository, but it’s also slower./p>blockquote>p>You can use SSH but it’s a lot more complex to setup.br>If that’s what you want, read the a hrefhttp://wiki.dreamhost.com/Git#Setup_Three>DreamHost Wiki/a>./p>/blockquote>h2>Setup a WebDAV folder/h2>p>Login to a hrefhttps://panel.dreamhost.com/>DreamHost Web Panel/a>br/>Go to a hrefhttps://panel.dreamhost.com/index.cgi?treegoodies.webdav>Goodies –> Htaccess/WebDAV/a>br/>Select the domain name you want to usebr/>Click “Set Up A New Directory”/p>p>img src/images/hosting-your-git-repository-on-dreamhost/dh-webpanel.png altDH Panel/WebDAV />/p>h2>Create the remote repository/h2>p>Git cannot create the remote repository, it only operates on existing ones, so we need to create an empty repository locally andmanually upload it to DreamHost./p>p>So, there we go, open a console and../p>pre>code>carlos@ubuntu:~/dev$ mkdir blank.gitcarlos@ubuntu:~/dev$ cd blank.git/carlos@ubuntu:~/dev/blank.git$ git --bare initInitialized empty Git repository in /home/carlos/dev/blank.git/carlos@ubuntu:~/dev/blank.git$ touch git-daemon-export-okcarlos@ubuntu:~/dev/blank.git$ git --bare update-server-infocarlos@ubuntu:~/dev/blank.git$ mv hooks/post-update.sample hooks/post-updatecarlos@ubuntu:~/dev/blank.git$/code>/pre>h3>Upload the blank repository and rename it/h3>p>Use Nautilus or any other file manager that supports WebDAV to upload blank.git to Dreamhost and rename it to somethingmeaningful. For the purpose of this example, let’s call it project.git/p>p>On Ubuntu:/p>p>img src/images/hosting-your-git-repository-on-dreamhost/places-connect.png altPlaces->Connect />br/>img src/images/hosting-your-git-repository-on-dreamhost/connect-to-server.png altPlaces->Connect />br/>img src/images/hosting-your-git-repository-on-dreamhost/copy-files.png altPlaces->Connect />br/>img src/images/hosting-your-git-repository-on-dreamhost/copy-files2.png altPlaces->Connect />/p>p>After it finishes uploading, rename the folder from blank.git to project.git/p>blockquote>p>When I renamed the file, I got an error message saying it failed, but refreshing showed it actually worked./p>/blockquote>h2>Ready!/h2>p>If you’re starting fresh and all you need is a blank repository, then you’re set.br/>Just clone your repository and start working!/p>pre>code>carlos@ubuntu:~/dev$ git clone http://a href/cdn-cgi/l/email-protection class__cf_email__ data-cfemailf7959895b7808080d9928f969a879b92d994989a>email protected/a>/git/project.gitInitialized empty Git repository in /home/carlos/dev/project/.git/Password:warning: You appear to have cloned an empty repository.carlos@ubuntu:~/dev$ cd projectcarlos@ubuntu:~/dev/project$ (work, work, work)carlos@ubuntu:~/dev/project$ git add READMEcarlos@ubuntu:~/dev/project$ git commit -m your commit messagemaster (root-commit) 5bbe5f6 your commit message0 files changed, 0 insertions(+), 0 deletions(-)create mode 100644 READMEcarlos@ubuntu:~/dev/project$ git push origin masterPassword:Fetching remote heads...refs/refs/tags/refs/heads/updating refs/heads/masterfrom 0000000000000000000000000000000000000000to 5bbe5f6507fa39293bdc9674ca4ae2e0a1d2f15esending 3 objectsdoneUpdating remote server infocarlos@ubuntu:~/dev/project$ git pullPassword:From http://a href/cdn-cgi/l/email-protection class__cf_email__ data-cfemailaac8c5c8eadddddd84cfd2cbc7dac6cf84c9c5c7>email protected/a>/git/project* new branch master -> origin/masterAlready up-to-date.carlos@ubuntu:~/dev/project (master)$/code>/pre>h2>Optional: Push your project repository to DreamHost/h2>p>Otherwise, if you already have a project repository that you’ve been working locally, now is the time to push it toDreamHost./p>p>Instead of cloning the new repository, push your project there first:/p>pre>code>carlos@ubuntu:~/dev$ cd real_project/carlos@ubuntu:~/dev/real_project$ git config remote.upload.url http://a href/cdn-cgi/l/email-protection class__cf_email__ data-cfemail98faf7fad8efefefb6fde0f9f5e8f4fdb6fbf7f5>email protected/a>/git/project.git/ # It is important to put the last /; Without it, the server will send a redirect which git-http-push # does not (yet) understand, and git-http-push will repeat the request infinitely.carlos@ubuntu:~/dev/real_project$ git push upload masterPassword:Fetching remote heads...refs/refs/tags/refs/heads/updating refs/heads/masterfrom 0000000000000000000000000000000000000000to a10703d8e400ca9df1b19345975718935c083905sending 107 objectsdoneUpdating remote server infocarlos@ubuntu:~/dev/real_project$/code>/pre>p>Then confirm it worked and start fresh by cloning it./p>pre>code>carlos@ubuntu:~/dev/real_project$ cd ..carlos@ubuntu:~/dev$ git clone http://a href/cdn-cgi/l/email-protection class__cf_email__ data-cfemailfb999499bb8c8c8cd59e839a968b979ed5989496>email protected/a>/git/project.git/Initialized empty Git repository in /home/carlos/dev/project/.git/Password:got a10703d8e400ca9df1b19345975718935c083905walk a10703d8e400ca9df1b19345975718935c083905got 574596c4cc435461515aa1a4c3cdd0e93af947f3got 067f993be7432ac27e8a6e9636dea53dcc3d8632got 475be0881778acd2de7404175fa323823e4d1ac0walk 067f993be7432ac27e8a6e9636dea53dcc3d8632(...)got b7b5d32db9dd30c9ea28434b125781eb4a3e95b2carlos@ubuntu:~/dev$ cd project/carlos@ubuntu:~/dev/project$ git log --onelinea10703d Adds a beautiful whitespace! :)067f993 Adds project description.. or sort of80c2e22 removes rerun.txt07e3cd2 Initial commitcarlos@ubuntu:~/dev/project$ git pullPassword:Already up-to-date.carlos@ubuntu:~/dev/project$ git push origin masterPassword:Fetching remote heads...refs/refs/tags/refs/heads/refs/heads/master: up-to-datecarlos@ubuntu:~/dev/project$/code>/pre>p>And you’re good to resume working on your project :)/p>h2>Bonus: saving your WebDAV password/h2>p>Now, if you’re thinking that typing the WebDAV password over and over again kind of suck, you can save it so that git won’t askyou anymore./p>pre>code>carlos@ubuntu:~/dev$ echo machine www.example.com login bob password secret >> ~/.netrc/code>/pre>p>There is only one thing to keep in mind.When you save your password like this, you need to drop the code>bob@/code>from the urls.br/>So, instead of referring to your repository as code>http://a href/cdn-cgi/l/email-protection class__cf_email__ data-cfemail87e5e8e5c7f0f0f0a9e2ffe6eaf7ebe2a9e4e8ea>email protected/a>/git/project.git//code> you need to use just code>http://www.example.com/git/project.git//code>br/>If you do this after you finished everything and cloned your repository, then git will have already saved the “wrong” url intoits config file and will keep asking you for the password./p>p>To fix this you can either clone again using the correct url or fix git’s config manually by doing:/p>pre>code>carlos@ubuntu:~/dev/project$ git config remote.origin.url http://www.example.com/git/project.git/carlos@ubuntu:~/dev/project$/code>/pre>p>Now, just for reference :)/p>pre>code>carlos@ubuntu:~/dev$ more /etc/issue.netUbuntu 9.10carlos@ubuntu:~/dev$ git --versiongit version 1.6.3.3carlos@ubuntu:~/dev$ dateThu Feb 25 08:55:18 BRT 2010carlos@ubuntu:~/dev$/code>/pre>/div> /article> div classpagination> a href/blog/archives>Blog Archives/a> /div>/div>aside classsidebar> section> h1>Recent Posts/h1> ul idrecent_posts> li classpost> a href/blog/2015/05/31/external-commands-vim-tricks/>External Commands - Vim Tricks/a> /li> li classpost> a href/blog/2015/05/21/idrac-virtual-console-crashing-on-linux/>iDrac Virtual Console Crashing on Linux/a> /li> li classpost> a href/blog/2014/07/08/talk-feedback/>Talk: Feedback/a> /li> li classpost> a href/blog/2013/11/05/running-perl-workers-on-iron-dot-io/>Running Perl Workers on Iron.IO/a> /li> li classpost> a href/blog/2013/10/18/dns-and-ptr-records-quick-notes/>Dns and Ptr Records Quick Notes/a> /li> /ul>/section>section> h1>GitHub Repos/h1> ul idgh_repos> li classloading>Status updating…/li> /ul> a hrefhttps://github.com/carloslima>@carloslima/a> on GitHub script data-cfasyncfalse src/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js>/script>script typetext/javascript> $(document).ready(function(){ if (!window.jXHR){ var jxhr document.createElement(script); jxhr.type text/javascript; jxhr.src /javascripts/libs/jXHR.js; var s document.getElementsByTagName(script)0; s.parentNode.insertBefore(jxhr, s); } github.showRepos({ user: carloslima, count: 0, skip_forks: true, target: #gh_repos }); }); /script> script src/javascripts/github.js typetext/javascript> /script>/section> /aside> /div> /div> footer rolecontentinfo>p> Copyright © 2015 - Carlos Lima - span classcredit>Powered by a hrefhttp://octopress.org>Octopress/a>/span>/p>/footer> script typetext/javascript> var disqus_shortname endlessramblings; var disqus_script count.js; (function () { var dsq document.createElement(script); dsq.type text/javascript; dsq.async true; dsq.src // + disqus_shortname + .disqus.com/ + disqus_script; (document.getElementsByTagName(head)0 || document.getElementsByTagName(body)0).appendChild(dsq); }());/script> script typetext/javascript> (function(){ var twitterWidgets document.createElement(script); twitterWidgets.type text/javascript; twitterWidgets.async true; twitterWidgets.src //platform.twitter.com/widgets.js; document.getElementsByTagName(head)0.appendChild(twitterWidgets); })(); /script>/body>/html>
View on OTX
|
View on ThreatMiner
Please enable JavaScript to view the
comments powered by Disqus.
Data with thanks to
AlienVault OTX
,
VirusTotal
,
Malwr
and
others
. [
Sitemap
]