<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>rodolfo.ca</title>
    <description>Rodolfo Bandeira personal&apos;s website.</description>
    <link>https://rodolfo.ca/</link>
    <atom:link href="https://rodolfo.ca/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Wed, 25 Feb 2026 14:37:52 -0500</pubDate>
    <lastBuildDate>Wed, 25 Feb 2026 14:37:52 -0500</lastBuildDate>
    <generator>Jekyll v4.2.2</generator>
    
    
      <item>
        <title>Kids teaching us series - God&apos;s right time for things</title>
        <description>&lt;p&gt;Another day, my toddler son finished breakfast. We were having a good time, laughing and playing together, when suddenly he ran to the entrance of the house and started putting his boots on. He wanted to go to school. It was Saturday. No school was needed that day. But he didn’t understand that concept yet. When I told him we wouldn’t be going to school, he started crying with a very impressive level of frustration, as if the world was ending right then and there.&lt;/p&gt;

&lt;p&gt;I didn’t know whether to laugh or cry with him.&lt;/p&gt;

&lt;p&gt;And I thought: &lt;strong&gt;sometimes God looks at us the same way&lt;/strong&gt;. We want something desperately, but it’s clearly not the right time. We don’t understand why, but Someone bigger than us does.&lt;/p&gt;

&lt;p&gt;He doesn’t have the capacity to understand timing, or that sometimes “no” actually means “not yet.” He only knows what he wants, and he wants it &lt;em&gt;now&lt;/em&gt;. And honestly, aren’t we the same?&lt;/p&gt;

&lt;h3 id=&quot;gods-timing-is-perfect&quot;&gt;God’s Timing is Perfect&lt;/h3&gt;

&lt;p&gt;Let’s look at some Bible knowledge around this topic.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“In their hearts humans plan their course, but the LORD establishes their steps.” &lt;strong&gt;Proverbs 16:9&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;My son had a plan. Boots on, out the door. But I had different plans for him that morning.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“He has made everything beautiful in its time.” &lt;strong&gt;Ecclesiastes 3:11&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;My son wasn’t wrong to want to go to school. He loves it there. But it wasn’t time yet. He just didn’t know that.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“For my thoughts are not your thoughts, neither are your ways my ways,” declares the Lord. “As the heavens are higher than the earth, so are my ways higher than your ways and my thoughts than your thoughts.” &lt;strong&gt;Isaiah 55:8-9&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When my son cries because he can’t go to school on Saturday, it’s not that he doesn’t want to learn. It’s that he can’t see what I can. In the same way, when we pray and don’t get an immediate “yes,” it’s not that God doesn’t care. He just sees what we can’t.&lt;/p&gt;

&lt;h3 id=&quot;waiting-builds-faith&quot;&gt;Waiting Builds Faith&lt;/h3&gt;

&lt;blockquote&gt;
  &lt;p&gt;“Wait for the Lord; be strong and take heart and wait for the Lord.” &lt;strong&gt;Psalm 27:14&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Waiting is hard. It was hard for me as a child, it’s hard for me as an adult, and it’s impossibly hard for a toddler. But that’s kind of the point. Waiting builds something in us that getting things immediately never could: trust.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“The Lord is good to those who wait for him, to the one who seeks him.” &lt;strong&gt;Lamentations 3:25&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;“Be patient, therefore, brothers, until the coming of the Lord.” &lt;strong&gt;James 5:7&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So the next time your prayer hasn’t been answered, maybe it’s Saturday. Maybe it’s not time yet. And maybe God’s “not yet” is protecting you from something you can’t see.&lt;/p&gt;

&lt;p&gt;Trust the Father. He knows when it’s time to put on the boots and go.&lt;/p&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;em&gt;This post is part of the “Kids Teaching Us” series, where I share lessons I’ve learned from watching my children grow and discover the world.&lt;/em&gt;&lt;/p&gt;

</description>
        <pubDate>Sat, 21 Feb 2026 13:00:00 -0500</pubDate>
        <link>https://rodolfo.ca/kids/god/jesus/2026/02/21/kids-teaching-us-series-god-s-right-time-for-things.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/kids/god/jesus/2026/02/21/kids-teaching-us-series-god-s-right-time-for-things.html</guid>
        
        <category>kids</category>
        
        <category>God</category>
        
        <category>Jesus</category>
        
        
        <category>kids</category>
        
        <category>God</category>
        
        <category>Jesus</category>
        
      </item>
      
    
    
      <item>
        <title>Running Opencode with Ollama and Qwen3:8b</title>
        <description>&lt;p&gt;If you’ve been following along, in a &lt;a href=&quot;/ai/ollama/machine-learning/2025/08/08/running-ollama-with-qwen25-1-5b-locally.html&quot;&gt;previous post&lt;/a&gt; I covered how to run Ollama locally with the Qwen2.5:1.5b model. This time we’re taking it a step further by using Ollama to run &lt;strong&gt;Opencode&lt;/strong&gt;, an open-source AI coding assistant that lives entirely in your terminal.&lt;/p&gt;

&lt;p&gt;Opencode gives you an AI pair-programming experience similar to tools like GitHub Copilot or Cursor, but running locally on your own machine with no API costs and full privacy.&lt;/p&gt;

&lt;p&gt;Now the big question: Was it worth it? Can you do any AI-code assisted by Quen3:8b model? Well, I’ll leave that for you to try and figure out on your own. :)&lt;/p&gt;

&lt;h4 id=&quot;what-is-opencode&quot;&gt;What is Opencode?&lt;/h4&gt;

&lt;p&gt;Opencode is an open-source AI coding assistant that runs in your terminal. It can help with code generation, refactoring, debugging, and general programming questions, all powered by a local LLM through Ollama. Think of it as having an AI coding buddy right in your terminal session.&lt;/p&gt;

&lt;p&gt;One important note: Opencode recommends using a model with at least a &lt;strong&gt;64k token context window&lt;/strong&gt;, which is why Qwen3:8b is a solid choice here.&lt;/p&gt;

&lt;hr /&gt;

&lt;h4 id=&quot;the-easiest-way-ollama-launch&quot;&gt;The Easiest Way: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ollama launch&lt;/code&gt;&lt;/h4&gt;

&lt;p&gt;Ollama recently introduced the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;launch&lt;/code&gt; command which makes running Opencode incredibly simple. You don’t need to install Opencode separately or configure anything manually. Just run:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ollama launch opencode
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That’s it. Ollama will prompt you to choose a model. Select &lt;strong&gt;Qwen3:8b&lt;/strong&gt; and you’re up and running.&lt;/p&gt;

&lt;p&gt;If you haven’t pulled the model yet, Ollama will download it for you. The Qwen3:8b model is roughly 5GB, so the first launch will take a few minutes depending on your connection.&lt;/p&gt;

&lt;p&gt;If you want to go straight to configuration without launching:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ollama launch opencode &lt;span class=&quot;nt&quot;&gt;--config&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This opens the configuration file at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.config/opencode/opencode.json&lt;/code&gt; where you can tweak settings if needed.&lt;/p&gt;

&lt;hr /&gt;

&lt;h4 id=&quot;manual-setup-alternative&quot;&gt;Manual Setup (Alternative)&lt;/h4&gt;

&lt;p&gt;If you prefer setting things up manually, you can install Opencode directly:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl &lt;span class=&quot;nt&quot;&gt;-fsSL&lt;/span&gt; https://opencode.ai/install | bash
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then configure it to point to your local Ollama instance by editing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.config/opencode/opencode.json&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;provider&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;@ai-sdk/openai-compatible&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;options&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;baseURL&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;http://localhost:11434/v1&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;model&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;qwen3:8b&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Make sure Ollama is running (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ollama serve&lt;/code&gt;) before starting Opencode.&lt;/p&gt;

&lt;hr /&gt;

&lt;h4 id=&quot;why-qwen38b&quot;&gt;Why Qwen3:8b?&lt;/h4&gt;

&lt;p&gt;In my &lt;a href=&quot;/ai/ollama/machine-learning/2025/08/08/running-ollama-with-qwen25-1-5b-locally.html&quot;&gt;previous post&lt;/a&gt;, I used the much smaller Qwen2.5:1.5b model which worked great for simple queries. However, for a coding assistant like Opencode that needs to understand larger chunks of code and maintain context across a conversation, the 8 billion parameter Qwen3 model is a better fit:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Larger context window&lt;/strong&gt; to handle real code files and project context&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Better reasoning&lt;/strong&gt; for complex coding tasks like refactoring and debugging&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Thinking mode&lt;/strong&gt; where the model shows its reasoning process before answering (you can see this in the verbose output from the previous post, where Qwen3:8b reasons through its answer)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The trade-off is speed and resource usage. On my old laptop with the NVIDIA GeForce GTX 960M, Qwen3:8b ran at about 3.17 tokens/s, which is quite slow for interactive use. If you have a more modern GPU or an Apple Silicon Mac, the experience will be significantly better.&lt;/p&gt;

&lt;hr /&gt;

&lt;h4 id=&quot;quick-tips&quot;&gt;Quick Tips&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Check your hardware&lt;/strong&gt;: For a usable interactive experience with Qwen3:8b, you’ll want a GPU with at least 8GB VRAM or an Apple Silicon Mac with 16GB+ unified memory&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Model management&lt;/strong&gt;: Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ollama list&lt;/code&gt; to see your installed models and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ollama rm &amp;lt;model&amp;gt;&lt;/code&gt; to free up space&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Try different models&lt;/strong&gt;: If Qwen3:8b is too heavy for your hardware, you could try smaller models, though the coding experience may be less impressive&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ollama launch&lt;/code&gt; command is a great move by the Ollama team. It removes the friction of configuring tools manually and makes it simple to get started with AI-powered development tools running entirely on your own machine.&lt;/p&gt;

&lt;p&gt;Cheers, &lt;br /&gt;
Rodolfo&lt;/p&gt;
</description>
        <pubDate>Sun, 08 Feb 2026 13:00:00 -0500</pubDate>
        <link>https://rodolfo.ca/ai/ollama/developer-tools/2026/02/08/running-opencode-with-ollama-and-qwen3.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/ai/ollama/developer-tools/2026/02/08/running-opencode-with-ollama-and-qwen3.html</guid>
        
        <category>ollama</category>
        
        <category>opencode</category>
        
        <category>qwen</category>
        
        <category>local-ai</category>
        
        <category>llm</category>
        
        <category>coding-assistant</category>
        
        
        <category>ai</category>
        
        <category>ollama</category>
        
        <category>developer-tools</category>
        
      </item>
      
    
    
      <item>
        <title>Accelerating Development Velocity with Efficient Code Reviews</title>
        <description>&lt;p&gt;Software engineers often struggle with slow code review processes that create bottlenecks, reduce team velocity, and frustrate developers. Research shows that slow reviews don’t just delay features, they cause code to become stale, force context switching, and significantly impact overall productivity.&lt;/p&gt;

&lt;p&gt;The good news? Major tech companies like Google, Microsoft, and Meta have cracked the code on efficient reviews. Their practices, combined with insights from industry-leading books like “Accelerate” and “Code Complete,” provide a blueprint for teams to move faster while maintaining high quality standards.&lt;/p&gt;

&lt;h3 id=&quot;the-cost-of-slow-code-reviews&quot;&gt;The Cost of Slow Code Reviews&lt;/h3&gt;

&lt;p&gt;Here is the thing about slow code reviews. Slow code reviews create a cascade of issues:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Context switching overhead&lt;/strong&gt;: Developers lose momentum switching between tasks while waiting for reviews&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Stale code syndrome&lt;/strong&gt;: Long delays make changes harder to understand and merge&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Reduced team velocity&lt;/strong&gt;: Bottlenecks in the review process slow down the entire development pipeline&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Developer frustration&lt;/strong&gt;: Extended wait times diminish job satisfaction and team morale&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;According to research from Microsoft and other major tech companies, code review turnaround time is now considered one of the primary metrics for measuring developer productivity.&lt;/p&gt;

&lt;h3 id=&quot;lessons-from-industry-leaders&quot;&gt;Lessons from Industry Leaders&lt;/h3&gt;

&lt;h4 id=&quot;googles-lightweight-approach&quot;&gt;Google’s Lightweight Approach&lt;/h4&gt;

&lt;p&gt;Google’s engineering practices documentation reveals their systematic approach to efficient code reviews:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Principles:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Single reviewer default&lt;/strong&gt;: 75% of code changes at Google are reviewed by just one person, speeding up the process significantly&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Clear quality standards&lt;/strong&gt;: Reviewers focus on Design, Functionality, Complexity, Tests, Naming, Comments, Style, and Documentation&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Readability certification&lt;/strong&gt;: At least one reviewer must have demonstrated knowledge of readable, maintainable code&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Optimize for team productivity&lt;/strong&gt;: The process optimizes for collective team output rather than individual developer speed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Size management&lt;/strong&gt;: Google recommends 100 lines as a reasonable change size, with 1000 lines typically being too large. Smaller changes are faster to review and less likely to introduce bugs.&lt;/p&gt;

&lt;h4 id=&quot;metas-innovation-in-review-speed&quot;&gt;Meta’s Innovation in Review Speed&lt;/h4&gt;

&lt;p&gt;Meta (Facebook) has implemented several tools and processes to directly address review delays:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nudgebot Success&lt;/strong&gt;: This automated system identifies reviewers most likely to respond quickly and sends them contextual reminders with quick actions. Results:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;7% reduction in average Time In Review&lt;/li&gt;
  &lt;li&gt;12% decrease in changes waiting longer than three days&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Smart reviewer selection&lt;/strong&gt;: Instead of randomly assigning reviewers, Meta’s system analyzes reviewer availability and expertise to optimize assignment.&lt;/p&gt;

&lt;h4 id=&quot;microsofts-research-driven-practices&quot;&gt;Microsoft’s Research-Driven Practices&lt;/h4&gt;

&lt;p&gt;Through large-scale studies, Microsoft identified several evidence-based best practices:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Two-reviewer limit&lt;/strong&gt;: Research suggests adding only two active reviewers for optimal efficiency&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Test-first review strategy&lt;/strong&gt;: Starting reviews with test code helps reviewers understand intent and catch issues early&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Systematic approach&lt;/strong&gt;: Following consistent review patterns improves both speed and quality&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;insights-from-industry-leading-books&quot;&gt;Insights from Industry-Leading Books&lt;/h3&gt;

&lt;h4 id=&quot;accelerate-the-science-of-lean-software-and-devops&quot;&gt;“Accelerate: The Science of Lean Software and DevOps”&lt;/h4&gt;

&lt;p&gt;Authors Nicole Forsgren, Jez Humble, and Gene Kim found that:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Lightweight peer review&lt;/strong&gt; significantly outperforms formal change approval boards (CABs)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Teams using peer reviews&lt;/strong&gt; with no external approval process achieve higher software delivery performance&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;External approval bodies&lt;/strong&gt; don’t increase system stability but definitely slow things down&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Automated deployment pipelines&lt;/strong&gt; combined with peer review effectively detect and reject problematic changes&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;code-complete-by-steve-mcconnell&quot;&gt;“Code Complete” by Steve McConnell&lt;/h4&gt;

&lt;p&gt;McConnell’s research demonstrates the effectiveness of code reviews:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;55-60% defect detection rate&lt;/strong&gt; for design and code inspections&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Code reviews are the most effective code quality process&lt;/strong&gt; available to development teams&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Reviewed code is twice as likely&lt;/strong&gt; to be defect-free compared to unreviewed code&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Knowledge sharing&lt;/strong&gt; through reviews improves overall team capability&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;practical-implementation-guide&quot;&gt;Practical Implementation Guide&lt;/h3&gt;

&lt;h4 id=&quot;1-optimize-review-assignment&quot;&gt;1. Optimize Review Assignment&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Strategy&lt;/strong&gt;: Implement intelligent reviewer assignment instead of random selection&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Analyze reviewer workload and availability&lt;/li&gt;
  &lt;li&gt;Match expertise to code areas when possible&lt;/li&gt;
  &lt;li&gt;Limit to 1-2 reviewers per change&lt;/li&gt;
  &lt;li&gt;Create backup assignment rules for when primary reviewers are unavailable&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;2-size-your-changes-strategically&quot;&gt;2. Size Your Changes Strategically&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Best practices for change size&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Target 100-200 lines as the sweet spot for most changes&lt;/li&gt;
  &lt;li&gt;Break larger features into smaller, logical chunks&lt;/li&gt;
  &lt;li&gt;Each change should represent a single, complete concept&lt;/li&gt;
  &lt;li&gt;Use feature flags to merge incomplete features safely&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;3-establish-clear-review-standards&quot;&gt;3. Establish Clear Review Standards&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Focus areas for efficient reviews&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Functionality&lt;/strong&gt;: Does the code do what it’s supposed to do?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Design&lt;/strong&gt;: Is the approach sound and scalable?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Complexity&lt;/strong&gt;: Can this be simplified?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Tests&lt;/strong&gt;: Are the tests comprehensive and meaningful?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Readability&lt;/strong&gt;: Will other developers understand this in six months?&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;4-create-review-velocity-metrics&quot;&gt;4. Create Review Velocity Metrics&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Track these key indicators&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Time from PR creation to first review&lt;/li&gt;
  &lt;li&gt;Total time in review&lt;/li&gt;
  &lt;li&gt;MTTM (Mean Time To Merge): Measures the complete lifecycle from first commit to merge, indicating overall team velocity and work-in-progress management&lt;/li&gt;
  &lt;li&gt;Number of review cycles per change&lt;/li&gt;
  &lt;li&gt;Percentage of changes requiring multiple review rounds&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;5-implement-automation-support&quot;&gt;5. Implement Automation Support&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Automated checks to reduce review overhead&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Linting and formatting (eliminate style discussions)&lt;/li&gt;
  &lt;li&gt;Automated testing (catch functional issues early)&lt;/li&gt;
  &lt;li&gt;Security scanning (identify potential vulnerabilities)&lt;/li&gt;
  &lt;li&gt;Documentation checks (ensure necessary docs are updated)&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;6-foster-a-review-culture&quot;&gt;6. Foster a Review Culture&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Cultural practices that accelerate reviews&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Daily review time blocks&lt;/strong&gt;: Dedicate specific time for reviewing others’ code&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Review-first policy&lt;/strong&gt;: Check for pending reviews before starting new work&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Constructive feedback training&lt;/strong&gt;: Help team members give better, faster feedback&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Recognition for good reviewing&lt;/strong&gt;: Celebrate team members who provide excellent, timely reviews&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;advanced-strategies-for-high-velocity-teams&quot;&gt;Advanced Strategies for High-Velocity Teams&lt;/h3&gt;

&lt;h4 id=&quot;implement-review-triage&quot;&gt;Implement Review Triage&lt;/h4&gt;

&lt;p&gt;Not all code changes need the same level of scrutiny:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Fast track&lt;/strong&gt;: Simple bug fixes, documentation updates, configuration changes&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Standard track&lt;/strong&gt;: Most feature development and refactoring&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Deep review&lt;/strong&gt;: Architecture changes, security-sensitive code, performance-critical paths&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;use-draft-prs-effectively&quot;&gt;Use Draft PRs Effectively&lt;/h4&gt;

&lt;p&gt;Encourage developers to:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Open draft PRs early for design feedback&lt;/li&gt;
  &lt;li&gt;Share work-in-progress to reduce late-stage surprises&lt;/li&gt;
  &lt;li&gt;Get architectural approval before implementation details&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;create-review-guidelines&quot;&gt;Create Review Guidelines&lt;/h4&gt;

&lt;p&gt;Develop team-specific guidelines that address:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;When to approve vs. request changes&lt;/li&gt;
  &lt;li&gt;How to provide actionable feedback&lt;/li&gt;
  &lt;li&gt;What requires synchronous discussion vs. async comments&lt;/li&gt;
  &lt;li&gt;Escalation procedures for disagreements&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;measuring-success&quot;&gt;Measuring Success&lt;/h3&gt;

&lt;h4 id=&quot;key-performance-indicators&quot;&gt;Key Performance Indicators&lt;/h4&gt;

&lt;p&gt;Track these metrics to ensure your improvements are working:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Speed metrics&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Mean time to first review: Target &amp;lt; 4 hours&lt;/li&gt;
  &lt;li&gt;Total review time: Target &amp;lt; 24 hours for most changes&lt;/li&gt;
  &lt;li&gt;MTTM (Mean Time To Merge): Target &amp;lt; 24 hours for elite teams, &amp;lt; 7 days for high-performing teams&lt;/li&gt;
  &lt;li&gt;Review turnaround cycles: Aim to minimize back-and-forth&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Quality metrics&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Post-merge defect rate&lt;/li&gt;
  &lt;li&gt;Code quality scores (if using static analysis)&lt;/li&gt;
  &lt;li&gt;Developer satisfaction surveys&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Team velocity&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Feature delivery time&lt;/li&gt;
  &lt;li&gt;Deployment frequency&lt;/li&gt;
  &lt;li&gt;Time from code complete to production&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;common-pitfalls-to-avoid&quot;&gt;Common Pitfalls to Avoid&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Over-optimization&lt;/strong&gt;: Don’t sacrifice quality for speed&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Tool obsession&lt;/strong&gt;: Process matters more than perfect tools&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Ignoring team dynamics&lt;/strong&gt;: Consider personalities and working styles&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Metric gaming&lt;/strong&gt;: Focus on outcomes, not just numbers&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;One-size-fits-all&lt;/strong&gt;: Adapt practices to your team’s specific context&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The key is to start with one or two improvements rather than overhauling everything at once. Whether it’s implementing size limits, improving reviewer assignment, or creating dedicated review time blocks, small changes compound into significant velocity improvements.&lt;/p&gt;

&lt;p&gt;I hope this was useful for you,&lt;/p&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;

&lt;h3 id=&quot;references&quot;&gt;References&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Google Engineering Practices Documentation&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;https://google.github.io/eng-practices/review/&quot;&gt;Introduction to Code Review&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://google.github.io/eng-practices/review/reviewer/&quot;&gt;How to do a code review&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://google.github.io/eng-practices/review/reviewer/standard.html&quot;&gt;The Standard of Code Review&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Meta Engineering Blog&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;https://engineering.fb.com/2022/11/16/culture/meta-code-review-time-improving/&quot;&gt;Move faster, wait less: Improving code review time at Meta&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Microsoft Research&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Greiler, M. (2022). &lt;em&gt;30 Proven Code Review Best Practices from Microsoft&lt;/em&gt;. Retrieved from Dr. McKayla’s research on code reviews&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://www.michaelagreiler.com/code-reviews-at-google/&quot;&gt;Code Reviews at Google are lightweight and fast&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Industry Books&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Forsgren, N., Humble, J., &amp;amp; Kim, G. (2018). &lt;em&gt;Accelerate: The Science of Lean Software and DevOps: Building and Scaling High Performing Technology Organizations&lt;/em&gt;. IT Revolution Press.&lt;/li&gt;
      &lt;li&gt;McConnell, S. (2004). &lt;em&gt;Code Complete: A Practical Handbook of Software Construction, Second Edition&lt;/em&gt;. Microsoft Press.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Additional Research&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;https://www.swarmia.com/blog/a-complete-guide-to-code-reviews/&quot;&gt;A complete guide to code reviews&lt;/a&gt; - Swarmia&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://www.devzero.io/blog/inside-the-world-of-developer-productivity-best-practices-from-google/&quot;&gt;Google Developer Productivity: Key Insights &amp;amp; Best Practices&lt;/a&gt; - DevZero&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;
</description>
        <pubDate>Sat, 23 Aug 2025 01:33:00 -0400</pubDate>
        <link>https://rodolfo.ca/software-engineering/productivity/best-practices/2025/08/23/accelerating-development-velocity-with-efficient-code-reviews.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/software-engineering/productivity/best-practices/2025/08/23/accelerating-development-velocity-with-efficient-code-reviews.html</guid>
        
        <category>code-review</category>
        
        <category>developer-productivity</category>
        
        <category>team-velocity</category>
        
        <category>google</category>
        
        <category>microsoft</category>
        
        <category>meta</category>
        
        
        <category>software-engineering</category>
        
        <category>productivity</category>
        
        <category>best-practices</category>
        
      </item>
      
    
    
      <item>
        <title>USB KVM Switch: A Simple Solution for a Cleaner, More Productive Workspace</title>
        <description>&lt;p&gt;As someone who regularly switches between a work laptop and personal computer throughout the day, I was constantly dealing with the frustration of having two keyboards and two mouse cluttering my desk. The cable management was a nightmare, and I found myself reaching for the wrong keyboard more often than I’d like to admit. That’s when I decided to invest in a USB KVM switch from Amazon, a decision that has significantly improved both my workspace organization and daily productivity.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/IMG_0778.JPG&quot; alt=&quot;Clean workspace setup with KVM switch&quot; /&gt;
*My current clean workspace setup with my Kinesis Advantage2 keyboard, shared between my two main machines.&lt;/p&gt;

&lt;h3 id=&quot;the-problem-desktop-chaos&quot;&gt;The Problem: Desktop Chaos&lt;/h3&gt;

&lt;p&gt;Before the KVM switch, my desk looked like a technology graveyard. 
Two keyboards, two mouse, multiple USB cables snaking everywhere, 
and the constant stress to having no space available for a notebook, a book, etc.
This was particularly frustrating because I use a very specific keyboard, the Kinesis Advantage2, 
which I absolutely love for its ergonomic design and split layout. 
Having to switch to a different keyboard for my personal computer was not only inconsistent but 
also uncomfortable.&lt;/p&gt;

&lt;h3 id=&quot;the-solution-one-button-two-computers&quot;&gt;The Solution: One Button, Two Computers&lt;/h3&gt;

&lt;p&gt;The USB KVM switch I purchased allows me to share a single keyboard and mouse between both computers with just the press of a button on the device. The setup was straightforward: connect both computers to the switch via USB, plug in my keyboard and mouse to the switch, and that’s it. Now, with a simple button press, I can instantly switch my peripherals from my work computer to my personal computer and back.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/IMG_0777.JPG&quot; alt=&quot;UGREEN USB KVM Switch&quot; /&gt;
&lt;em&gt;The UGREEN USB KVM switch - a simple device that has transformed my workspace organization&lt;/em&gt;&lt;/p&gt;

&lt;h3 id=&quot;the-benefits-ive-experienced&quot;&gt;The Benefits I’ve Experienced&lt;/h3&gt;

&lt;h4 id=&quot;cleaner-more-organized-workspace&quot;&gt;Cleaner, More Organized Workspace&lt;/h4&gt;

&lt;p&gt;The most immediate benefit was the dramatic reduction in desk clutter. By eliminating duplicate peripherals, I freed up valuable desk space and drastically simplified cable management. My workspace now has a clean, minimalist aesthetic that I find much more conducive to focused work.&lt;/p&gt;

&lt;h4 id=&quot;seamless-use-of-my-preferred-keyboard&quot;&gt;Seamless Use of My Preferred Keyboard&lt;/h4&gt;

&lt;p&gt;Perhaps the biggest win for me personally was being able to use my Kinesis Advantage2 keyboard with both computers. This keyboard has a unique split ergonomic design that I’ve grown accustomed to over years of use. Before the KVM switch, I had to use a different keyboard for my personal computer, which always felt awkward and slowed down my typing. Now, I maintain the same comfortable, efficient typing experience regardless of which computer I’m using.&lt;/p&gt;

&lt;h4 id=&quot;enhanced-focus-and-productivity&quot;&gt;Enhanced Focus and Productivity&lt;/h4&gt;

&lt;p&gt;A clean, organized environment has a psychological effect that shouldn’t be underestimated. With less visual clutter and a more streamlined setup, I find it easier to maintain focus during work sessions. The mental overhead of managing multiple peripherals is gone, allowing me to concentrate on what actually matters, the work itself.&lt;/p&gt;

&lt;h3 id=&quot;a-small-investment-big-impact&quot;&gt;A Small Investment, Big Impact&lt;/h3&gt;

&lt;p&gt;While a USB KVM switch might seem like a simple, almost trivial purchase, its impact on daily workflow and workspace quality has been surprisingly significant. For anyone who regularly works with multiple computers, especially those who have invested in high-quality peripherals like specialized keyboards, a KVM switch is a worthwhile addition that pays dividends in organization, comfort, and productivity.&lt;/p&gt;

&lt;p&gt;Sometimes the best solutions are the simplest ones. In this case, a small device that costs less than a good keyboard has transformed my workspace from chaotic to organized, and made my daily computing experience much more enjoyable.&lt;/p&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Sun, 17 Aug 2025 13:31:00 -0400</pubDate>
        <link>https://rodolfo.ca/productivity/hardware/workspace/2025/08/17/usb-kvm-switch-productivity-boost.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/productivity/hardware/workspace/2025/08/17/usb-kvm-switch-productivity-boost.html</guid>
        
        
        <category>productivity</category>
        
        <category>hardware</category>
        
        <category>workspace</category>
        
      </item>
      
    
    
      <item>
        <title>Solo Engineers vs. Small Teams: A Trade-off in Parallelism and Focus</title>
        <description>&lt;p&gt;As engineering leaders, we constantly face a fundamental question of resource allocation. 
How do we structure our teams to maximize impact? A common dilemma is choosing between two distinct models:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;High Parallelism:&lt;/strong&gt; Assigning single engineers per projects, creating numerous parallel work streams.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;High Focus:&lt;/strong&gt; Creating small, dedicated teams of two or three engineers to tackle fewer, more substantial projects.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There is no single right answer, and the optimal choice often depends on your organization’s goals, 
maturity, and the nature of the work itself. Let’s explore the pros and cons of each approach, 
drawing on wisdom from known authors/books.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;the-solo-engineer-many-projects-model&quot;&gt;The Solo Engineer, Many Projects Model&lt;/h3&gt;

&lt;p&gt;This model is often tempting, especially in organizations that feel resource-constrained. 
It feels like you’re covering more ground by having every engineer working on something different.&lt;/p&gt;

&lt;h4 id=&quot;pros&quot;&gt;Pros:&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Clear Ownership:&lt;/strong&gt; There is no ambiguity about who is responsible for a project. That single engineer owns it, end-to-end.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Maximized Breadth:&lt;/strong&gt; This approach allows an organization to address a wide array of small features, bugs, and customer requests simultaneously.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Low Communication Overhead:&lt;/strong&gt; A solo engineer can often move faster on a small, well-defined task because they don’t need to sync with teammates, coordinate on design, or spend as much time in code reviews.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;cons&quot;&gt;Cons:&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;The “Bus Factor”:&lt;/strong&gt; This is the most significant risk. If the solo engineer gets sick, goes on vacation, or leaves the company, the project comes to a dead halt. Knowledge is siloed, creating a critical single point of failure.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Cognitive Overload &amp;amp; Context Switching:&lt;/strong&gt; As humans, we are notoriously bad at multitasking. An engineer juggling three or four distinct projects is constantly paying the mental tax of context switching, which erodes efficiency and leads to burnout.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Lack of Collaboration and Review:&lt;/strong&gt; Without a teammate, there’s no one to challenge assumptions, spot potential bugs, or suggest a better design. This can lead to lower-quality code and increased technical debt.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Blocked and Isolated:&lt;/strong&gt; A solo engineer is more likely to get stuck waiting on a dependency from another team. They lack a teammate to brainstorm with or to help push through a blocker.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;the-small-team-fewer-projects-model&quot;&gt;The Small Team, Fewer Projects Model&lt;/h3&gt;

&lt;p&gt;This model has become the standard for many high-performing tech organizations. It prioritizes focus and resilience over sheer parallelism.&lt;/p&gt;

&lt;h4 id=&quot;pros-1&quot;&gt;Pros:&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Increased Velocity on Key Projects:&lt;/strong&gt; As Will Larson notes in &lt;strong&gt;“An Elegant Puzzle: Systems of Engineering Management,”&lt;/strong&gt; the goal is to staff projects to &lt;em&gt;finish&lt;/em&gt; them, not just to start them. A team of two or three engineers can bring a significant feature to completion much faster than a single engineer ever could.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Higher Quality and Better Design:&lt;/strong&gt; With multiple engineers working together, you get the benefit of collaborative design, pair programming, and rigorous code review. This leads to more robust, maintainable, and well-architected solutions.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Resilience and Shared Knowledge:&lt;/strong&gt; The “bus factor” is mitigated. If one team member is unavailable, the project continues. Knowledge is naturally distributed among the team members.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Mentorship and Growth:&lt;/strong&gt; This model creates a natural environment for mentorship. Junior engineers learn from seniors, and even senior engineers learn from each other, fostering a culture of continuous improvement.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;cons-1&quot;&gt;Cons:&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Higher Communication Overhead:&lt;/strong&gt; More people working together requires more coordination. This can mean more meetings, more time spent in discussion, and a more formal planning process.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Less Breadth:&lt;/strong&gt; While the team is moving quickly on its primary objective, other smaller tasks and bugs may get less attention. This requires a clear process for prioritizing and triaging incoming work.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Potential for “Too Many Cooks”:&lt;/strong&gt; If not managed well, a small team can sometimes get bogged down in design debates or have a diffusion of responsibility. This is why keeping teams small (2-3 engineers, often called “pairs” or “trios”) is critical.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;finding-the-right-balance&quot;&gt;Finding the Right Balance&lt;/h3&gt;

&lt;p&gt;The consensus in modern software management, echoed in books like “An Elegant Puzzle” and also in concepts from “Team Topologies” by Matthew Skelton and Manuel Pais, leans heavily towards the small, focused team model for any work that is considered a strategic priority.&lt;/p&gt;

&lt;p&gt;Will Larson argues that leadership’s primary role is to create systems that enable teams to do good work. A system that constantly pushes engineers into solo, parallel projects is often a system that prioritizes the &lt;em&gt;appearance&lt;/em&gt; of activity over the actual delivery of impactful results. It optimizes for starting work, not for finishing it.&lt;/p&gt;

&lt;p&gt;The solo-engineer model should be reserved for specific, limited contexts:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Very small, isolated bug fixes.&lt;/li&gt;
  &lt;li&gt;Highly specialized tasks where only one person has the skills (and you have a plan to train others).&lt;/li&gt;
  &lt;li&gt;Exploratory or research-oriented work that isn’t on a critical path.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For everything else—the features that drive your business, the products that serve your customers—the focused, collaborative small team is almost always the superior choice. It delivers higher quality results faster, and it builds a more resilient and capable engineering organization in the long run.&lt;/p&gt;

&lt;p&gt;Here is an image of the book “The Elegant Puzzle” on return of investment:&lt;/p&gt;

&lt;div style=&quot;text-align: center;&quot;&gt;
  &lt;img src=&quot;/assets/images/elegant-puzzle-return-of-investments.jpg&quot; alt=&quot;The Elegant Puzzle - Return of Investment&quot; style=&quot;max-width: 600px; width: 100%; height: auto;&quot; /&gt;
&lt;/div&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Tue, 12 Aug 2025 21:23:00 -0400</pubDate>
        <link>https://rodolfo.ca/management/engineering-practices/2025/08/12/solo-engineers-vs-small-teams.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/management/engineering-practices/2025/08/12/solo-engineers-vs-small-teams.html</guid>
        
        
        <category>management</category>
        
        <category>engineering-practices</category>
        
      </item>
      
    
    
      <item>
        <title>Running local LLM with Ollama</title>
        <description>&lt;p&gt;Ollama makes it incredibly easy to run large language models locally on your own machine. 
For this example, we’re going to use the Qwen2.5:1.5b model, which is particularly interesting because 
it offers good performance while being lightweight enough to run efficiently on most hardware such as a 
regular laptop (my case).&lt;/p&gt;

&lt;p&gt;Just to give more context, I’m currently running this 1.5b model, on a ~7.5 years old laptop with a 
NVIDIA GeForce GTX 960M,which has 4GB of GDDR5 memory, 640 CUDA GPU Cores, and 80.16 GB/s of 
Memory bandwidth. The laptop also has 16GB of memory, and an Intel Core i7 with 2.6GHz, 
but this is less relevant since the model will run fully on the NVIDIA GPU.&lt;/p&gt;

&lt;h4 id=&quot;why-choose-local-ai-llm&quot;&gt;Why Choose Local AI (LLM)?&lt;/h4&gt;

&lt;p&gt;Running models locally with Ollama offers several advantages:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Privacy&lt;/strong&gt;: Your data never leaves your machine&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;No API Costs&lt;/strong&gt;: No per-token charges or monthly subscriptions&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Offline Capability&lt;/strong&gt;: Works without internet connection&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Customization&lt;/strong&gt;: Full control over the model and its responses&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Low Latency&lt;/strong&gt;: No network overhead for faster responses&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;what-is-qwen2515b&quot;&gt;What is Qwen2.5:1.5b?&lt;/h4&gt;

&lt;p&gt;Qwen2.5:1.5b is a 1.5 billion parameter model from Alibaba Cloud’s Qwen family. 
Despite its smaller size, it delivers impressive results for tasks like text generation, 
code completion, and conversational AI while requiring minimal system resources.&lt;/p&gt;

&lt;hr /&gt;

&lt;h4 id=&quot;installing-ollama&quot;&gt;Installing Ollama&lt;/h4&gt;

&lt;p&gt;First, let’s install Ollama on your system:&lt;/p&gt;

&lt;h4 id=&quot;macos&quot;&gt;macOS&lt;/h4&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;brew &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;ollama
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;linux&quot;&gt;Linux&lt;/h4&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl &lt;span class=&quot;nt&quot;&gt;-fsSL&lt;/span&gt; https://ollama.com/install.sh | sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;windows&quot;&gt;Windows&lt;/h4&gt;
&lt;p&gt;Download the installer from &lt;a href=&quot;https://ollama.com&quot;&gt;ollama.com&lt;/a&gt; and run it.&lt;/p&gt;

&lt;hr /&gt;

&lt;h4 id=&quot;running-qwen2515b&quot;&gt;Running Qwen2.5:1.5b&lt;/h4&gt;

&lt;p&gt;Once Ollama is installed, running the Qwen2.5:1.5b model is straightforward:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Pull the model&lt;/span&gt;
ollama pull qwen2.5:1.5b

&lt;span class=&quot;c&quot;&gt;# Run the model&lt;/span&gt;
ollama run qwen2.5:1.5b
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The first time you run this command, Ollama will download the model (approximately 1GB). Subsequent runs will be much faster.&lt;/p&gt;

&lt;h4 id=&quot;interactive-chat&quot;&gt;Interactive Chat&lt;/h4&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ollama run qwen2.5:1.5b
&lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; Hello! How can you &lt;span class=&quot;nb&quot;&gt;help &lt;/span&gt;me today?
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;single-query&quot;&gt;Single Query&lt;/h4&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Explain quantum computing in simple terms&quot;&lt;/span&gt; | ollama run qwen2.5:1.5b
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;code-generation&quot;&gt;Code Generation&lt;/h4&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Write a Python function to calculate fibonacci numbers&quot;&lt;/span&gt; | ollama run qwen2.5:1.5b
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Ollama also provides a REST API that you can use in your applications:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Start Ollama server&lt;/span&gt;
ollama serve

&lt;span class=&quot;c&quot;&gt;# Make API calls&lt;/span&gt;
curl http://localhost:11434/api/generate &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;{
  &quot;model&quot;: &quot;qwen2.5:1.5b&quot;,
  &quot;prompt&quot;: &quot;Write a hello world program in Go&quot;
}&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;performance-tips&quot;&gt;Performance Tips&lt;/h4&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;System Resources&lt;/strong&gt;: The 1.5b model runs comfortably on systems with 4GB+ RAM&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;GPU Acceleration&lt;/strong&gt;: If you have a compatible GPU, Ollama will automatically use it for faster inference&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Model Management&lt;/strong&gt;: Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ollama list&lt;/code&gt; to see installed models and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ollama rm &amp;lt;model&amp;gt;&lt;/code&gt; to remove unused ones&lt;/li&gt;
&lt;/ol&gt;

&lt;hr /&gt;

&lt;h4 id=&quot;more&quot;&gt;More:&lt;/h4&gt;

&lt;p&gt;Here is an example of the output, using –verbose. As you can see, it took 10 seconds to answer a simple question
and the eval rate was done using 16.75 tokens per second. Modern NVIDIA boards can render these at ~200 tokens per second, 
however, this would cost you $3000 on a single video board :)&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ollama run qwen2.5:1.5b &quot;What is the capital of Australia?&quot; --verbose

The capital city of Australia is Canberra.

total duration:       10.0650759s
load duration:        8.6905296s
prompt eval count:    36 token(s)
prompt eval duration: 824.9321ms
prompt eval rate:     43.64 tokens/s
eval count:           9 token(s)
eval duration:        537.5474ms
eval rate:            16.74 tokens/s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here is an example on another laptop, a MacBook Pro M1, and as you can see the speed is significantly
faster, with a eval rate of 86.54 tokens per second.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ollama run qwen2.5:1.5b &quot;What is the capital of Australia?&quot; --verbose

The capital of Australia is Canberra.

total duration:       1.137187459s
load duration:        940.9695ms
prompt eval count:    36 token(s)
prompt eval duration: 102.911875ms
prompt eval rate:     349.81 tokens/s
eval count:           8 token(s)
eval duration:        92.438959ms
eval rate:            86.54 tokens/s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Why is the Macbook faster than a dedicated GeForce GTX960 video card?&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;The M1 has an unified memory architecture with 400GB/s bandwidth, and can load the entire 1.5B parameter model into fast unified memory, while the GTX 960M must constantly shuffle data between slow system RAM and limited VRAM.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;p&gt;To give more context, here is the same question, but now running at the old laptop (NVIDIA GeForce GTX 960M), and a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;qwen3:8b&lt;/code&gt; model:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ollama run qwen3:8b &quot;What is the capital of Australia?&quot; --verbose

Thinking...
Okay, the user is asking for the capital of Australia. Let me recall what I know about Australian geography.
Australia is a country, and I remember that its capital is a city. Wait, isn&apos;t it Canberra? But I should make sure
I&apos;m not confusing it with another city. Let me think. Sydney is a major city, but that&apos;s the largest city, not the
capital. Melbourne is another big city, but again, not the capital. Then there&apos;s Brisbane, Perth, Adelaide, etc. So
the capital is Canberra. Wait, why is it called Canberra? I think it&apos;s named after the British prime minister,
maybe? Or perhaps it&apos;s a combination of two words. Oh right, it&apos;s named after the Australian states of New South
Wales and Victoria, combining parts of their names. But the key point is that the capital is Canberra. I should
confirm that there&apos;s no other city that&apos;s the capital. Sometimes people might confuse it with Sydney, but Sydney is
the largest city. So the answer is Canberra. Let me just double-check in my mind. Yes, the capital of Australia is
indeed Canberra. I think that&apos;s correct. No, wait, maybe I should mention that it&apos;s the seat of government, and that
it&apos;s not the largest city. That way, the user can understand the difference between the capital and the largest
city. Alright, I&apos;m confident that the answer is Canberra.
...done thinking.

The capital of Australia is **Canberra**. It is a planned city located in the Australian Capital Territory (ACT),
which is a federal territory. While Sydney is the largest city and a major economic hub, Canberra serves as the
political and administrative center of the country.

total duration:       1m52.1215941s
load duration:        63.3456ms
prompt eval count:    17 token(s)
prompt eval duration: 2.8612691s
prompt eval rate:     5.94 tokens/s
eval count:           346 token(s)
eval duration:        1m49.1950338s
eval rate:            3.17 tokens/s 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Cheers, &lt;br /&gt;
Rodolfo&lt;/p&gt;
</description>
        <pubDate>Fri, 08 Aug 2025 19:55:12 -0400</pubDate>
        <link>https://rodolfo.ca/ai/ollama/machine-learning/2025/08/08/running-ollama-with-qwen25-1-5b-locally.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/ai/ollama/machine-learning/2025/08/08/running-ollama-with-qwen25-1-5b-locally.html</guid>
        
        <category>ollama</category>
        
        <category>qwen</category>
        
        <category>local-ai</category>
        
        <category>llm</category>
        
        
        <category>ai</category>
        
        <category>ollama</category>
        
        <category>machine-learning</category>
        
      </item>
      
    
    
      <item>
        <title>The FLARE Framework: Mastering Effective Communication in Leadership</title>
        <description>&lt;p&gt;As engineering leaders, one of our most critical skills is effective communication. Whether we’re addressing team conflicts, delivering difficult feedback, or navigating complex organizational challenges, how we communicate can make or break our leadership effectiveness. Today, I want to share a powerful framework that has transformed my approach to difficult conversations: &lt;strong&gt;FLARE&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The FLARE Framework stands for &lt;strong&gt;Frame, Listen, Acknowledge, Reflect, and Engage&lt;/strong&gt;. This structured approach ensures that every communication interaction is purposeful, empathetic, and outcome-focused.&lt;/p&gt;

&lt;h3 id=&quot;frame&quot;&gt;&lt;strong&gt;Frame&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;Setting the context and purpose for the conversation is crucial. Before diving into any discussion, especially challenging ones, take time to establish what you’re trying to achieve and create the right environment.&lt;/p&gt;

&lt;p&gt;When framing a conversation:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Clearly state the purpose and desired outcome&lt;/li&gt;
  &lt;li&gt;Set expectations for the discussion&lt;/li&gt;
  &lt;li&gt;Create psychological safety for open dialogue&lt;/li&gt;
  &lt;li&gt;Establish ground rules if necessary&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; “I’d like to discuss the recent project delays. My goal is to understand what happened and work together to prevent similar issues in the future. I value your perspective and want this to be an open conversation.”&lt;/p&gt;

&lt;h3 id=&quot;listen&quot;&gt;&lt;strong&gt;Listen&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;Active listening goes far beyond simply hearing words. It’s about understanding the complete message - both spoken and unspoken. As leaders, we often rush to provide solutions, but the most powerful thing we can do is truly listen.&lt;/p&gt;

&lt;p&gt;Effective listening involves:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Giving your full attention without planning your response&lt;/li&gt;
  &lt;li&gt;Observing non-verbal cues and emotional undertones&lt;/li&gt;
  &lt;li&gt;Asking clarifying questions to ensure understanding&lt;/li&gt;
  &lt;li&gt;Avoiding interruptions and premature judgment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Remember: You have two ears and one mouth for a reason. Use them proportionally.&lt;/p&gt;

&lt;h3 id=&quot;acknowledge&quot;&gt;&lt;strong&gt;Acknowledge&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;Acknowledgment doesn’t mean agreement - it means recognizing and validating the other person’s perspective, feelings, and experience. This step is often overlooked but is essential for building trust and maintaining relationships.&lt;/p&gt;

&lt;p&gt;When acknowledging:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Validate their emotions and concerns&lt;/li&gt;
  &lt;li&gt;Recognize their effort and intentions&lt;/li&gt;
  &lt;li&gt;Show appreciation for their openness&lt;/li&gt;
  &lt;li&gt;Demonstrate that their input matters&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; “I can see how frustrating this situation has been for you, and I appreciate you taking the time to explain your perspective. Your concerns about the timeline are completely valid.”&lt;/p&gt;

&lt;h3 id=&quot;reflect&quot;&gt;&lt;strong&gt;Reflect&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;Reflection involves summarizing what you’ve heard to ensure mutual understanding. This step helps prevent miscommunication and shows that you’ve been actively engaged in listening.&lt;/p&gt;

&lt;p&gt;During reflection:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Paraphrase key points in your own words&lt;/li&gt;
  &lt;li&gt;Confirm your understanding of their concerns&lt;/li&gt;
  &lt;li&gt;Identify common ground and shared goals&lt;/li&gt;
  &lt;li&gt;Clarify any remaining ambiguities&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; “Let me make sure I understand correctly. You’re saying that the unexpected API changes caused the delays, and you’re concerned that this pattern might continue affecting future sprints. Is that accurate?”&lt;/p&gt;

&lt;h3 id=&quot;engage&quot;&gt;&lt;strong&gt;Engage&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;The final step is engaging collaboratively toward solutions. This is where the real work begins - moving from understanding the problem to actively addressing it together.&lt;/p&gt;

&lt;p&gt;Effective engagement includes:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Collaborating on potential solutions&lt;/li&gt;
  &lt;li&gt;Setting clear next steps and accountability&lt;/li&gt;
  &lt;li&gt;Establishing follow-up mechanisms&lt;/li&gt;
  &lt;li&gt;Maintaining focus on shared objectives&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The key is to engage as partners working toward a common goal, not as adversaries trying to win an argument.&lt;/p&gt;

&lt;h3 id=&quot;putting-flare-into-practice&quot;&gt;&lt;strong&gt;Putting FLARE into Practice&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;I’ve found the FLARE framework particularly valuable during:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Performance conversations with team members&lt;/li&gt;
  &lt;li&gt;Conflict resolution between team members&lt;/li&gt;
  &lt;li&gt;Stakeholder discussions about project challenges&lt;/li&gt;
  &lt;li&gt;Strategic planning sessions with leadership peers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The beauty of FLARE is its adaptability. Whether you’re having a five-minute check-in or a complex multi-hour discussion, this framework provides structure while maintaining authenticity.&lt;/p&gt;

&lt;h3 id=&quot;a-personal-reflection&quot;&gt;&lt;strong&gt;A Personal Reflection&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;I’ve learned that great leadership isn’t about having all the answers - it’s about creating space for the right conversations to happen. The FLARE framework has been instrumental in helping me become a more effective communicator and, consequently, a better leader.&lt;/p&gt;

&lt;p&gt;Remember, communication is not just about transmitting information; it’s about connecting with people, building trust, and creating environments where everyone can do their best work.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;
I hope this framework serves you well in your leadership journey,&lt;br /&gt;
Rodolfo&lt;/p&gt;
</description>
        <pubDate>Sat, 12 Jul 2025 13:30:00 -0400</pubDate>
        <link>https://rodolfo.ca/management/leadership/communication/2025/07/12/flare-framework-effective-communication.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/management/leadership/communication/2025/07/12/flare-framework-effective-communication.html</guid>
        
        <category>leadership</category>
        
        <category>communication</category>
        
        <category>management</category>
        
        <category>framework</category>
        
        <category>john maxwell</category>
        
        
        <category>management</category>
        
        <category>leadership</category>
        
        <category>communication</category>
        
      </item>
      
    
    
      <item>
        <title>RAPID Model for Business and Strategy Decisions</title>
        <description>&lt;p&gt;The &lt;b&gt;RAPID&lt;/b&gt; model is a decision-making framework developed by &lt;a href=&quot;https://www.bain.com/insights/rapid-decision-making/&quot;&gt;Bain &amp;amp; Company&lt;/a&gt; that clarifies roles and responsibilities in the decision-making process. RAPID stands for Recommend, Agree, Perform, Input, and Decide - each representing a specific role in organizational decision-making.
&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recommend&lt;/strong&gt; &lt;br /&gt;
The person or group responsible for making a recommendation and proposing a course of action. They gather data, analyze options, and present their findings to stakeholders.
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Agree&lt;/strong&gt; &lt;br /&gt;
Individuals who must agree with the recommendation before it can move forward. These are typically people whose cooperation is essential for implementation or who have veto power over the decision.
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Perform&lt;/strong&gt; &lt;br /&gt;
The people responsible for implementing the decision once it’s made. They are accountable for executing the plan and delivering results.
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Input&lt;/strong&gt; &lt;br /&gt;
Stakeholders who provide relevant information, expertise, or opinions that should be considered in the decision-making process. They don’t have decision-making authority but their insights are valuable.
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Decide&lt;/strong&gt; &lt;br /&gt;
The single person who has the authority to make the final decision. This role ensures accountability and prevents decisions from getting stuck in committee.
&lt;br /&gt;
&lt;br /&gt;
By clearly defining these roles, the RAPID model eliminates confusion about who is responsible for what, speeds up decision-making, and ensures better execution of strategic initiatives.&lt;/p&gt;
&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;
&lt;br /&gt;
A technology company needs to decide whether to build a new product feature or acquire a startup that offers similar functionality.&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;Recommend:&lt;/em&gt; The product management team analyzes market data, customer feedback, and technical requirements to recommend the best approach.&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;Agree:&lt;/em&gt; The engineering lead and finance director must agree with the recommendation since it affects technical resources and budget allocation.&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;Perform:&lt;/em&gt; The development team (for build option) or the M&amp;amp;A team (for acquisition option) will execute the chosen strategy.&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;Input:&lt;/em&gt; Sales team provides customer insights, legal team advises on acquisition risks, and customer success team shares user feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;Decide:&lt;/em&gt; The VP of Product makes the final decision based on all inputs and recommendations.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;
This framework ensures faster, clearer decision-making while maintaining accountability and stakeholder engagement.&lt;br /&gt;
Rodolfo&lt;/p&gt;
</description>
        <pubDate>Fri, 27 Jun 2025 12:00:00 -0400</pubDate>
        <link>https://rodolfo.ca/management/strategy/decision-making/2025/06/27/rapid-model-for-business-strategy-decisions.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/management/strategy/decision-making/2025/06/27/rapid-model-for-business-strategy-decisions.html</guid>
        
        <category>management</category>
        
        <category>strategy</category>
        
        <category>decision-making</category>
        
        <category>business</category>
        
        
        <category>management</category>
        
        <category>strategy</category>
        
        <category>decision-making</category>
        
      </item>
      
    
    
      <item>
        <title>A few Math symbols</title>
        <description>&lt;p&gt;Here you can find a nice table of mathematical symbols.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Basic Operations&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Symbol&lt;/th&gt;
      &lt;th&gt;Name&lt;/th&gt;
      &lt;th&gt;Description&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;+&lt;/td&gt;
      &lt;td&gt;Plus&lt;/td&gt;
      &lt;td&gt;Addition&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;-&lt;/td&gt;
      &lt;td&gt;Minus&lt;/td&gt;
      &lt;td&gt;Subtraction&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;*&lt;/td&gt;
      &lt;td&gt;Multiplication&lt;/td&gt;
      &lt;td&gt;Multiplication&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;/&lt;/td&gt;
      &lt;td&gt;Division&lt;/td&gt;
      &lt;td&gt;Division&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;=&lt;/td&gt;
      &lt;td&gt;Equals&lt;/td&gt;
      &lt;td&gt;Equal to&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;≠&lt;/td&gt;
      &lt;td&gt;Not equals&lt;/td&gt;
      &lt;td&gt;Not equal to&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&amp;lt;&lt;/td&gt;
      &lt;td&gt;Less than&lt;/td&gt;
      &lt;td&gt;Less than&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&amp;gt;&lt;/td&gt;
      &lt;td&gt;Greater than&lt;/td&gt;
      &lt;td&gt;Greater than&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;≤&lt;/td&gt;
      &lt;td&gt;Less than or equal&lt;/td&gt;
      &lt;td&gt;Less than or equal to&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;≥&lt;/td&gt;
      &lt;td&gt;Greater or equal&lt;/td&gt;
      &lt;td&gt;Greater than or equal to&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;√&lt;/td&gt;
      &lt;td&gt;Square root&lt;/td&gt;
      &lt;td&gt;Square root of a number&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;^&lt;/td&gt;
      &lt;td&gt;Exponent&lt;/td&gt;
      &lt;td&gt;Indicates exponentiation (e.g., 2^3 means 2 cubed)&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Greek Alphabet&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Greek Letter&lt;/th&gt;
      &lt;th&gt;Uppercase&lt;/th&gt;
      &lt;th&gt;Lowercase&lt;/th&gt;
      &lt;th&gt;Meaning/Usage&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Alpha&lt;/td&gt;
      &lt;td&gt;Α&lt;/td&gt;
      &lt;td&gt;α&lt;/td&gt;
      &lt;td&gt;Often used to represent the first or initial value in a sequence or set. It is also used in various contexts, such as angles and constants.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Beta&lt;/td&gt;
      &lt;td&gt;Β&lt;/td&gt;
      &lt;td&gt;β&lt;/td&gt;
      &lt;td&gt;Often used to represent the second value or coefficient in a sequence, set, or equation. It is commonly used in statistics and regression analysis.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Gamma&lt;/td&gt;
      &lt;td&gt;Γ&lt;/td&gt;
      &lt;td&gt;γ&lt;/td&gt;
      &lt;td&gt;Frequently used in mathematics and physics. It has various applications, such as representing a parameter, a constant, or a gamma function.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Delta&lt;/td&gt;
      &lt;td&gt;Δ&lt;/td&gt;
      &lt;td&gt;δ&lt;/td&gt;
      &lt;td&gt;Often used to denote a change or difference. It is also used to represent a small increment in a variable or a variation in a quantity.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Epsilon&lt;/td&gt;
      &lt;td&gt;Ε&lt;/td&gt;
      &lt;td&gt;ε&lt;/td&gt;
      &lt;td&gt;Commonly used to represent a small positive number, typically associated with limits and convergence in calculus.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Zeta&lt;/td&gt;
      &lt;td&gt;Ζ&lt;/td&gt;
      &lt;td&gt;ζ&lt;/td&gt;
      &lt;td&gt;Primarily used to represent a variable in equations or to denote a complex number.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Eta&lt;/td&gt;
      &lt;td&gt;Η&lt;/td&gt;
      &lt;td&gt;η&lt;/td&gt;
      &lt;td&gt;Frequently used to represent the efficiency or an unknown variable in equations and mathematical models.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Theta&lt;/td&gt;
      &lt;td&gt;Θ&lt;/td&gt;
      &lt;td&gt;θ&lt;/td&gt;
      &lt;td&gt;Often used to represent angles in geometry and trigonometry. It is also used to represent unknown variables or parameters in equations and models.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Iota&lt;/td&gt;
      &lt;td&gt;Ι&lt;/td&gt;
      &lt;td&gt;ι&lt;/td&gt;
      &lt;td&gt;Primarily used as a variable or an index in mathematics, especially in sequences, series, and summations.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Kappa&lt;/td&gt;
      &lt;td&gt;Κ&lt;/td&gt;
      &lt;td&gt;κ&lt;/td&gt;
      &lt;td&gt;Commonly used as a variable in mathematics, physics, and engineering. It has various applications, such as representing a constant or a wave number.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Lambda&lt;/td&gt;
      &lt;td&gt;Λ&lt;/td&gt;
      &lt;td&gt;λ&lt;/td&gt;
      &lt;td&gt;Frequently used in mathematics and physics. It represents eigenvalues, wavelengths, decay constants, and parameters in various contexts.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Mu&lt;/td&gt;
      &lt;td&gt;Μ&lt;/td&gt;
      &lt;td&gt;μ&lt;/td&gt;
      &lt;td&gt;Often used to represent the mean or average in statistics. It is also used as a variable or coefficient in various mathematical equations.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Nu&lt;/td&gt;
      &lt;td&gt;Ν&lt;/td&gt;
      &lt;td&gt;ν&lt;/td&gt;
      &lt;td&gt;Primarily used as a variable or a parameter in mathematics, physics, and engineering.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Xi&lt;/td&gt;
      &lt;td&gt;Ξ&lt;/td&gt;
      &lt;td&gt;ξ&lt;/td&gt;
      &lt;td&gt;Commonly used in mathematics and statistics. It represents a variable, a set, or a distribution in various contexts.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Omicron&lt;/td&gt;
      &lt;td&gt;Ο&lt;/td&gt;
      &lt;td&gt;ο&lt;/td&gt;
      &lt;td&gt;Occasionally used as a variable, but it does not have specific mathematical meaning or usage in most cases.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Pi&lt;/td&gt;
      &lt;td&gt;Π&lt;/td&gt;
      &lt;td&gt;π&lt;/td&gt;
      &lt;td&gt;Frequently used to represent the mathematical constant pi, which is the ratio of a circle’s circumference to its diameter (approximately 3.14159).&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Rho&lt;/td&gt;
      &lt;td&gt;Ρ&lt;/td&gt;
      &lt;td&gt;ρ&lt;/td&gt;
      &lt;td&gt;Primarily used to represent a density, a correlation coefficient, or a resistivity in physics and engineering.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Sigma&lt;/td&gt;
      &lt;td&gt;Σ&lt;/td&gt;
      &lt;td&gt;σ&lt;/td&gt;
      &lt;td&gt;Uppercase sigma (Σ) is used to denote summation, while lowercase sigma (σ) is used to represent the standard deviation in statistics.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Tau&lt;/td&gt;
      &lt;td&gt;Τ&lt;/td&gt;
      &lt;td&gt;τ&lt;/td&gt;
      &lt;td&gt;Often used to represent time constants, torque, or a parameter in physics and engineering.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Upsilon&lt;/td&gt;
      &lt;td&gt;Υ&lt;/td&gt;
      &lt;td&gt;υ&lt;/td&gt;
      &lt;td&gt;Frequently used to represent a variable or a parameter in mathematics, physics, and engineering.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Phi&lt;/td&gt;
      &lt;td&gt;Φ&lt;/td&gt;
      &lt;td&gt;φ&lt;/td&gt;
      &lt;td&gt;Often used to represent the golden ratio or a variable in equations and models. It is also used in trigonometry and complex numbers.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Chi&lt;/td&gt;
      &lt;td&gt;Χ&lt;/td&gt;
      &lt;td&gt;χ&lt;/td&gt;
      &lt;td&gt;Commonly used as a variable or a parameter in mathematics, physics, and engineering.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Psi&lt;/td&gt;
      &lt;td&gt;Ψ&lt;/td&gt;
      &lt;td&gt;ψ&lt;/td&gt;
      &lt;td&gt;Frequently used in mathematics, physics, and engineering. It represents wave functions, angles, or a variable in various contexts.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Omega&lt;/td&gt;
      &lt;td&gt;Ω&lt;/td&gt;
      &lt;td&gt;ω&lt;/td&gt;
      &lt;td&gt;Often used to represent the last or final value in a sequence or set. It is also used to denote angular velocity or a limit in calculus.&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Set Theory&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Symbol&lt;/th&gt;
      &lt;th&gt;Name&lt;/th&gt;
      &lt;th&gt;Description&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;∈&lt;/td&gt;
      &lt;td&gt;Element of&lt;/td&gt;
      &lt;td&gt;Used to specify that an element is in a set&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;∉&lt;/td&gt;
      &lt;td&gt;Not an element of&lt;/td&gt;
      &lt;td&gt;Used to specify that an element is not in a set&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;⊆&lt;/td&gt;
      &lt;td&gt;Subset of&lt;/td&gt;
      &lt;td&gt;A set whose elements are all members of another set&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;⊂&lt;/td&gt;
      &lt;td&gt;Proper subset of&lt;/td&gt;
      &lt;td&gt;A subset that is not equal to the original set&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;⊇&lt;/td&gt;
      &lt;td&gt;Superset of&lt;/td&gt;
      &lt;td&gt;A set containing all elements of another set&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;⊃&lt;/td&gt;
      &lt;td&gt;Proper superset of&lt;/td&gt;
      &lt;td&gt;A superset that is not equal to the original set&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;∅&lt;/td&gt;
      &lt;td&gt;Empty set&lt;/td&gt;
      &lt;td&gt;A set with no elements&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;{ }&lt;/td&gt;
      &lt;td&gt;Set brackets&lt;/td&gt;
      &lt;td&gt;Used to denote a set&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;∩&lt;/td&gt;
      &lt;td&gt;Intersection&lt;/td&gt;
      &lt;td&gt;Common elements between two sets&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;∪&lt;/td&gt;
      &lt;td&gt;Union&lt;/td&gt;
      &lt;td&gt;All elements that are in either of two sets&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;∖&lt;/td&gt;
      &lt;td&gt;Set difference&lt;/td&gt;
      &lt;td&gt;Elements that are in one set but not another&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;P(A)&lt;/td&gt;
      &lt;td&gt;Power set&lt;/td&gt;
      &lt;td&gt;The set of all subsets of a set&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Calculus&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Symbol&lt;/th&gt;
      &lt;th&gt;Name&lt;/th&gt;
      &lt;th&gt;Description&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;∫&lt;/td&gt;
      &lt;td&gt;Integral&lt;/td&gt;
      &lt;td&gt;Represents the integral of a function over an interval&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;∂&lt;/td&gt;
      &lt;td&gt;Partial derivative&lt;/td&gt;
      &lt;td&gt;Represents the partial derivative of a function&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;∇&lt;/td&gt;
      &lt;td&gt;Del or Nabla&lt;/td&gt;
      &lt;td&gt;A vector operator used in vector calculus&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;∞&lt;/td&gt;
      &lt;td&gt;Infinity&lt;/td&gt;
      &lt;td&gt;A number greater than any assignable quantity or count&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;dx&lt;/td&gt;
      &lt;td&gt;Differential&lt;/td&gt;
      &lt;td&gt;Represents a small change in the variable x&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;d/dx&lt;/td&gt;
      &lt;td&gt;Derivative&lt;/td&gt;
      &lt;td&gt;The derivative of a function with respect to x&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;∑&lt;/td&gt;
      &lt;td&gt;Summation&lt;/td&gt;
      &lt;td&gt;The sum of a series of terms&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;∆x&lt;/td&gt;
      &lt;td&gt;Delta x&lt;/td&gt;
      &lt;td&gt;Represents a small change or difference in the variable x&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;lim&lt;/td&gt;
      &lt;td&gt;Limit&lt;/td&gt;
      &lt;td&gt;The value a function approaches as the input approaches a value&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Geometry&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Symbol&lt;/th&gt;
      &lt;th&gt;Name&lt;/th&gt;
      &lt;th&gt;Description&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;∠&lt;/td&gt;
      &lt;td&gt;Angle&lt;/td&gt;
      &lt;td&gt;Used to represent an angle&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;≅&lt;/td&gt;
      &lt;td&gt;Congruent&lt;/td&gt;
      &lt;td&gt;Identical in form&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;∥&lt;/td&gt;
      &lt;td&gt;Parallel&lt;/td&gt;
      &lt;td&gt;Two lines in a plane that do not meet&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;⊥&lt;/td&gt;
      &lt;td&gt;Perpendicular&lt;/td&gt;
      &lt;td&gt;Intersection at a right angle&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;π&lt;/td&gt;
      &lt;td&gt;Pi&lt;/td&gt;
      &lt;td&gt;The ratio of the circumference of a circle to its diameter&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;°&lt;/td&gt;
      &lt;td&gt;Degree&lt;/td&gt;
      &lt;td&gt;A unit of measurement of angles&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;’&lt;/td&gt;
      &lt;td&gt;Minute&lt;/td&gt;
      &lt;td&gt;1/60 of a degree&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;’’&lt;/td&gt;
      &lt;td&gt;Second&lt;/td&gt;
      &lt;td&gt;1/60 of a minute&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;r&lt;/td&gt;
      &lt;td&gt;Radius&lt;/td&gt;
      &lt;td&gt;The distance from the center to the edge of a circle&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;d&lt;/td&gt;
      &lt;td&gt;Diameter&lt;/td&gt;
      &lt;td&gt;The distance across a circle through its center&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;a,b,c&lt;/td&gt;
      &lt;td&gt;Sides of a triangle&lt;/td&gt;
      &lt;td&gt;Often used to represent the sides of a triangle&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;h&lt;/td&gt;
      &lt;td&gt;Height&lt;/td&gt;
      &lt;td&gt;The “height” of a figure&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Algebra&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Symbol&lt;/th&gt;
      &lt;th&gt;Name&lt;/th&gt;
      &lt;th&gt;Description&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;x, y, z&lt;/td&gt;
      &lt;td&gt;Variables&lt;/td&gt;
      &lt;td&gt;Often used to represent unknown quantities&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;a, b, c&lt;/td&gt;
      &lt;td&gt;Constants&lt;/td&gt;
      &lt;td&gt;Often used to represent known quantities&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;f(x)&lt;/td&gt;
      &lt;td&gt;Function of x&lt;/td&gt;
      &lt;td&gt;A function in terms of x&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;≡&lt;/td&gt;
      &lt;td&gt;Equivalent to&lt;/td&gt;
      &lt;td&gt;Identical or equal to&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;≈&lt;/td&gt;
      &lt;td&gt;Approximately equal&lt;/td&gt;
      &lt;td&gt;Roughly equal to&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;∝&lt;/td&gt;
      &lt;td&gt;Proportional to&lt;/td&gt;
      &lt;td&gt;Changes with the change of another quantity&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;x²&lt;/td&gt;
      &lt;td&gt;Square&lt;/td&gt;
      &lt;td&gt;A number multiplied by itself&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;x³&lt;/td&gt;
      &lt;td&gt;Cube&lt;/td&gt;
      &lt;td&gt;A number multiplied by itself twice&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;√x&lt;/td&gt;
      &lt;td&gt;Square root&lt;/td&gt;
      &lt;td&gt;A number which when squared gives x&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;x!&lt;/td&gt;
      &lt;td&gt;Factorial&lt;/td&gt;
      &lt;td&gt;The product of an integer and all the integers below it&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;x^n&lt;/td&gt;
      &lt;td&gt;Power&lt;/td&gt;
      &lt;td&gt;X raised to the power of n&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

</description>
        <pubDate>Tue, 13 Jun 2023 20:33:01 -0400</pubDate>
        <link>https://rodolfo.ca/math/mathematical/symbols/2023/06/13/math-symbols.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/math/mathematical/symbols/2023/06/13/math-symbols.html</guid>
        
        <category>math</category>
        
        <category>mathematical</category>
        
        <category>symbols</category>
        
        
        <category>math</category>
        
        <category>mathematical</category>
        
        <category>symbols</category>
        
      </item>
      
    
    
      <item>
        <title>Smart Goals</title>
        <description>&lt;p&gt;SMART goals is a framework for creating specific, measurable, achievable, relevant, and time-bound goals. The acronym SMART stands for:
&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Specific&lt;/strong&gt; &lt;br /&gt;
 A goal should be clear and well-defined, describing exactly what needs to be achieved. The more detailed a goal, the easier it is to create a plan for achieving it.
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Measurable&lt;/strong&gt; &lt;br /&gt;
A goal should be quantifiable, with specific metrics or criteria that can be used to measure progress and success. Measurable goals help track progress and motivate individuals to work towards their goals.
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Achievable&lt;/strong&gt; &lt;br /&gt;
A goal should be realistic and attainable, considering available resources and constraints. Setting attainable goals can lead to satisfaction and discouragement.
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Relevant&lt;/strong&gt; &lt;br /&gt;
A goal should be aligned with the individual’s values and priorities, as well as the organization’s or team’s broader goals. This ensures that the goal is meaningful and worthwhile to pursue.
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Time-bound&lt;/strong&gt; &lt;br /&gt;
A goal should have a specific deadline or completion timeline, which helps create a sense of urgency and focus.
&lt;br /&gt;
&lt;br /&gt;
By setting SMART goals, individuals and teams can create a clear and structured plan for achieving their objectives and tracking their progress.
&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;hr /&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;
&lt;br /&gt;
A software engineer wants to improve some technical skills and move from Software Engineer 1 (Junior) to Software Engineer 2 (Intermediate). Let’s assume do more code reviews on a specific Typescript repository will help this engineer towards this next step. I don’t think I need to say this but, of course this should be just one goal within many others required for a title change.&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;Specific:&lt;/em&gt; Improve understanding and knowledge of Typescript by doing frequent code reviews. Go line by line, understand why the code was done that way, if there is local bugs, security or performance concerns. If no relative feedback is necessary, always great to praise and share some great feedback.&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;Measurable:&lt;/em&gt; Code review at least 5 pull requests per week.&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;Achievable:&lt;/em&gt; Assuming the working week is defined as 5 business days, separate 30 minutes per day for code reviews. This way there is also time to work writing code as well participate to meetings and other team rituals.&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;Relevant:&lt;/em&gt; The team stack has Typescript as main language which is totally relevant for this engineer as well for his individual contributor role and career path.&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;Time-bound:&lt;/em&gt; Keep this rountine for 2 quarters (6 months). After this, set either more agressive goals or switch to other ideas.\&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;
I hope this was useful for you,&lt;br /&gt;
Rodolfo&lt;/p&gt;
</description>
        <pubDate>Sat, 25 Feb 2023 22:10:12 -0500</pubDate>
        <link>https://rodolfo.ca/management/eng%20manager/engineering%20manager/2023/02/25/smart-goals.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/management/eng%20manager/engineering%20manager/2023/02/25/smart-goals.html</guid>
        
        <category>management</category>
        
        <category>eng manager</category>
        
        <category>engineering manager</category>
        
        
        <category>management</category>
        
        <category>eng manager</category>
        
        <category>engineering manager</category>
        
      </item>
      
    
    
      <item>
        <title>Free alternative to Docker Desktop on MacOS</title>
        <description>&lt;p&gt;Docker Desktop is still free for personal use, open source projects and some other cases. Although if
you use it at work, and your company has more than 250 users AND make more than $22 Million per year, you will be
required to pay a small amount per user.&lt;/p&gt;

&lt;p&gt;That is a fair move to a product that changed the world and didn’t take advantage (financially) of all this success.
If you also work for a company that can pay for it, help them to keep providing their amazing service.&lt;/p&gt;

&lt;p&gt;Anyways, if you just wanna keep using docker cli for your projects and doesn’t want all the fancy features that comes
with Docker Desktop, here are some good news for you, you can still use docker free and thats totally legal by
using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Minikube&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Here is how to do the trick:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Installing Docker CLI (Which is different than Docker Desktop)&lt;/span&gt;
brew &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;docker

&lt;span class=&quot;c&quot;&gt;# Installing KubeCTL (Just in case you want to play with Kubernetes as well)&lt;/span&gt;
brew &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;kubectl

&lt;span class=&quot;c&quot;&gt;# Installing Minikube&lt;/span&gt;
brew &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;minikube

&lt;span class=&quot;c&quot;&gt;# Running Minikube&lt;/span&gt;
minikube start &lt;span class=&quot;nt&quot;&gt;--driver&lt;/span&gt; hyperkit
&lt;span class=&quot;nb&quot;&gt;eval&lt;/span&gt; &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;minikube &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; minikube docker-env&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Try running docker as you normally would do:&lt;/span&gt;
docker ps &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Cheers,
Rodolfo&lt;/p&gt;

</description>
        <pubDate>Sat, 02 Oct 2021 16:13:47 -0400</pubDate>
        <link>https://rodolfo.ca/docker/minikube/2021/10/02/free-alternative-to-docker-desktop-on-macos.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/docker/minikube/2021/10/02/free-alternative-to-docker-desktop-on-macos.html</guid>
        
        <category>docker</category>
        
        <category>minikube</category>
        
        
        <category>docker</category>
        
        <category>minikube</category>
        
      </item>
      
    
    
      <item>
        <title>17 useful Git commands</title>
        <description>&lt;p&gt;Here is a great list of 17 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git&lt;/code&gt; commands I use pretty often and might be handy to you.&lt;/p&gt;

&lt;p&gt;I was curious about what are my top commands that I’ve been using on my terminal on daily basis. With a quick Google search I ended &lt;a href=&quot;https://superuser.com/questions/250227/how-do-i-see-what-my-most-used-linux-command-are&quot;&gt;on this really nice snippet&lt;/a&gt;:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;history&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] &quot; &quot; CMD[a]/count*100 &quot;% &quot; a;}&apos;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
 | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;./&quot;&lt;/span&gt; | column &lt;span class=&quot;nt&quot;&gt;-c3&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;sort&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-nr&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;nl&lt;/span&gt; |  &lt;span class=&quot;nb&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n10&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And here is the output I got:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; 1  258  25.8%  git
 2  215  21.5%  ls
 3  163  16.3%  cd
 4  83   8.3%   vim
 5  51   5.1%   exit
 6  34   3.4%   go
 7  19   1.9%   ssh
 8  15   1.5%   clear
 9  14   1.4%   tmux
10  11   1.1%   sudo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You might find actually low numbers which make sense. This laptop I’m writing right now is my personal computer so if I run that on my work computer, those numbers will be a bit higher indeed. Anyways, seeing “git” in the first position stood out from the other commands so I decided to share some of my top git commands on this post. It is not necessarily the most used command for me, but definitely useful and you might need it one day. Here they are:&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;1-how-to-list-all-git-branches-ordered-by-creation-or-last-commit-date&quot;&gt;1. How to list all git branches ordered by creation or last commit date?&lt;/h3&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-each-ref&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;--sort&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;committerdate refs/heads/ &lt;span class=&quot;nt&quot;&gt;--format&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;%(HEAD) \
 %(color:yellow)%(refname:short)%(color:reset) - \
%(color:red)%(objectname:short)%(color:reset) - \
%(authorname) (%(color:green)%(committerdate:relative)%(color:reset))&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The most recent branches will be listed in the bottom. Just run it, you’re gonna be impressed. By the way, I’ve been using FzF, which is a fuzzy finder that you can hook up into your terminal and it gives you the ability to just type: Control + R, and start typing “git for-ea”, and boom, it will pull the last commands with that keyword from your history and all you gotta do is just hit Enter key. If you’re interested in learning more about FzF, check out the &lt;a href=&quot;https://github.com/junegunn/fzf&quot;&gt;FzF project page&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;2-how-to-squash-multiple-commits-into-just-one-commit&quot;&gt;2. How to squash multiple commits into just one commit.&lt;/h3&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git checkout master
git pull
git checkout -
git rebase &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; master
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you have &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;VIM&lt;/code&gt; or any other editor setup in your bash, this will open it and ask which action you should use. Replace the word &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pick&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;s&lt;/code&gt; (squash). When you save your vim &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;:x&lt;/code&gt; it will ask you to put the commit merge message. If you just want to merge it without worrying about commit messages, you can use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;f&lt;/code&gt; (force) which will skip the next step. After that, if you type: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git log -n 5&lt;/code&gt;, you’re going to see the final result.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;3-how-to-revert-the-last-commit-even-after-pushed-it-to-the-remote-branch&quot;&gt;3. How to revert the last commit. (Even after pushed it to the remote branch)&lt;/h3&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git log &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; 4 &lt;span class=&quot;nt&quot;&gt;--oneline&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;Get the &lt;span class=&quot;nb&quot;&gt;hash&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
git revert &amp;lt;commit-hash&amp;gt;
git push
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;4-how-to-create-an-apply-a-git-patch&quot;&gt;4. How to create an apply a git patch&lt;/h3&gt;
&lt;p&gt;Do you want to export the work you’ve done so far but don’t want to commit anything? Perhaps you want to export a patch and send it via email, slack? Maybe transferring a patch a different machine? Here is how you can do this:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git diff &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; my-patch-file.patch
patch &lt;span class=&quot;nt&quot;&gt;-p1&lt;/span&gt; &amp;lt; my-patch-file.patch
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;5-list-all-filenames-added-or-changed-from-last-commit&quot;&gt;5. List all filenames added or changed from last commit:&lt;/h3&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git show &lt;span class=&quot;nt&quot;&gt;--pretty&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;oneline &lt;span class=&quot;nt&quot;&gt;--name-only&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;6-get-the-diff-between-two-git-branches&quot;&gt;6. Get the diff between two git branches:&lt;/h3&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git diff branch1..branch2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;7-remove-last-commit-and-put-all-files-from-the-previous-commit-on-stash-mode&quot;&gt;7. Remove last commit and put all files from the previous commit on stash mode:&lt;/h3&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git reset &lt;span class=&quot;nt&quot;&gt;--hard&lt;/span&gt; HEAD~
git reset HEAD^
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;8-put-all-files-from-last-commit-on-unstash-mode&quot;&gt;8. Put all files from last commit on “unstash” mode:&lt;/h3&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git reset HEAD^
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;9-delete-all-local-branches-that-were-already-merged-on-the-remote-branch&quot;&gt;9. Delete all local branches that were already merged on the remote branch:&lt;/h3&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git branch &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--merged&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep &lt;/span&gt;origin | egrep &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&amp;gt;|master&apos;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;cut&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt;/ &lt;span class=&quot;nt&quot;&gt;-f2-&lt;/span&gt; | xargs git push origin &lt;span class=&quot;nt&quot;&gt;--delete&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;10-how-to-remove-a-commit-that-you-just-pushed&quot;&gt;10. How to remove a commit that you just pushed:&lt;/h3&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git reset &lt;span class=&quot;nt&quot;&gt;--hard&lt;/span&gt; HEAD~ &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;Move your &lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;branch to previous commit. &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;Before the last commit&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
git push &lt;span class=&quot;nt&quot;&gt;--force-with-lease&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;Push your changes to remote forcing. This will destroy your last commit&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;11-how-to-destroy-all-old-commit-history-and-start-from-scratch&quot;&gt;11. How to destroy all old commit history and start from scratch:&lt;/h3&gt;
&lt;p&gt;Do you want to do a complete git reset? Keep in mind that this will destroy all your git history:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; .git
git init
git add &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
git commit &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; ‘Initial commit’
git remote add origin &amp;lt;your git repo url. git://…&amp;gt;
git push &lt;span class=&quot;nt&quot;&gt;--force&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--set-upstream&lt;/span&gt; origin master
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;12-how-to-make-vim-your-default-git-editor&quot;&gt;12. How to make VIM your default git editor:&lt;/h3&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git config &lt;span class=&quot;nt&quot;&gt;--global&lt;/span&gt; core.editor &lt;span class=&quot;s2&quot;&gt;&quot;vim&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;13-how-to-show-all-files-for-a-specific-commit&quot;&gt;13. How to show all files for a specific commit:&lt;/h3&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git diff-tree &lt;span class=&quot;nt&quot;&gt;--no-commit-id&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--name-only&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; YOUR_COMMIT_HASH
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;14-search-over-all-git-commits-for-a-specific-keyword&quot;&gt;14. Search over all git commits, for a specific keyword:&lt;/h3&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git log &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;your key word&apos;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--source&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--all&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;15-how-to-edit-a-commit-message-for-your-last-commit&quot;&gt;15. How to edit a commit message for your last commit:&lt;/h3&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git commit &lt;span class=&quot;nt&quot;&gt;--amend&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;16-how-to-change-the-author-of-a-commit&quot;&gt;16. How to change the author of a commit:&lt;/h3&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git commit &lt;span class=&quot;nt&quot;&gt;--amend&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--author&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Author Name &amp;lt;email@address.com&amp;gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;17-how-to-get-a-specific-commit-from-another-branch&quot;&gt;17. How to get a specific commit from another branch:&lt;/h3&gt;

&lt;p&gt;First of all, you’re gonna need the commit hash you want to pull into another branch. This is particularly useful when you messed up something in your branch and wants to start a new branch but want to pull together some specific commits.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git cherry-pick &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; COMMIT_HASH_YOU_WANT_TO_PULL
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Simple like that. Typing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git status&lt;/code&gt; will show all files from that specific commit unstashed. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-n&lt;/code&gt; will tell git to not commit the files into this new branch.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;That’s pretty much what I have for today. I have 125 git notes here. I’ll prepare another version of this post with more “advanced” git commands. Stay tuned.&lt;/p&gt;

</description>
        <pubDate>Sun, 10 May 2020 11:33:48 -0400</pubDate>
        <link>https://rodolfo.ca/git/cli/2020/05/10/17-useful-git-commands.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/git/cli/2020/05/10/17-useful-git-commands.html</guid>
        
        <category>git</category>
        
        <category>cli</category>
        
        
        <category>git</category>
        
        <category>cli</category>
        
      </item>
      
    
    
      <item>
        <title>Wisdom from above</title>
        <description>&lt;p&gt;Wisdom from above&lt;/p&gt;

&lt;p&gt;“Are any of you wise and understanding? Show that your actions are good with a humble lifestyle that comes from wisdom.
However, if you have bitter jealousy and selfish ambition in your heart, then stop bragging and living in ways that 
deny the truth. This is not the wisdom that comes down from above. Instead, it is from the earth, natural and demonic. 
Wherever there is jealousy and selfish ambition, there is disorder and everything that is evil. 
What of the wisdom from above? First, it is pure, and then peaceful, gentle, obedient, filled with mercy and good 
actions, fair, and genuine. Those who make peace sow the seeds of justice by their peaceful acts.”&lt;/p&gt;

&lt;p&gt;James 3, 13-18&lt;/p&gt;

</description>
        <pubDate>Sun, 09 Feb 2020 21:50:25 -0500</pubDate>
        <link>https://rodolfo.ca/bible/2020/02/09/wisdon-from-above.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/bible/2020/02/09/wisdon-from-above.html</guid>
        
        <category>bible</category>
        
        
        <category>bible</category>
        
      </item>
      
    
    
      <item>
        <title>Kubernetes - Installing Minikube and Kubectl on Ubuntu Linux</title>
        <description>&lt;p&gt;I don’t believe I need to tell you this but I’m gonna mention anyways. DO NOT RUN Minikube in Production! This is just for your local environment so you can play with Kubernetes, set up your own cluster, set up metrics and nodes. Minikube will help you to start your master node and from that one, you’ll be able to create loadbalancers, auto-scale your application and learn Kubernetes easily without using your credit-card on some fancy kubernetes services from Azure, AWS or GCP.&lt;/p&gt;

&lt;p&gt;First, let’s check if you have a CPU with support to virtualization. If the output of this is non-empty, we’re good to go:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grep -E --color &apos;vmx|svm&apos; /proc/cpuinfo&lt;/code&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;1. Installing kubectl&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;Reference for other linux distributions&quot;&gt;https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-linux&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo &quot;deb https://apt.kubernetes.io/ kubernetes-xenial main&quot; | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -y kubectl
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kubectl version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Installing Minikube&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
  &amp;amp;&amp;amp; chmod +x minikube

sudo mkdir -p /usr/local/bin/
sudo mv minikube /usr/local/bin/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;3. Setting things up&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;minikube start&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;😄  minikube v1.5.2 on Ubuntu 18.04
✨  Automatically selected the &apos;virtualbox&apos; driver (alternates: [none])
💿  Downloading VM boot image ...
    &amp;gt; minikube-v1.5.1.iso.sha256: 65 B / 65 B [--------------] 100.00% ? p/s 0s
    &amp;gt; minikube-v1.5.1.iso: 143.76 MiB / 143.76 MiB [-] 100.00% 4.73 MiB p/s 31s
🔥  Creating virtualbox VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.16.2 on Docker &apos;18.09.9&apos; ...
💾  Downloading kubelet v1.16.2
💾  Downloading kubeadm v1.16.2
🚜  Pulling images ...
🚀  Launching Kubernetes ...
⌛  Waiting for: apiserver
🏄  Done! kubectl is now configured to use &quot;minikube&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you want to clear minikube’s local state: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;minikube delete&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Final test&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Our final goal is make sure your local kubernetes cluster via Minikube is talking properly with your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kubectl&lt;/code&gt; which is the command line tool you’re gonna need for everything kubernetes (k8s) related.&lt;/p&gt;

&lt;p&gt;We’re expecting to see “minikube” as output for this command:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kubectl config current-context&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;minikube
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kubectl get nodes&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;NAME       STATUS   ROLES    AGE     VERSION
minikube   Ready    master   2m53s   v1.16.2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Great, now our master node is up and running, next step will be start adding some &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&quot;pods&quot;&lt;/code&gt; based on a custom Docker image and make sure we learn how to scale things to 1, 2 or why not 100 nodes? 😄&lt;/p&gt;

</description>
        <pubDate>Sun, 17 Nov 2019 17:26:31 -0500</pubDate>
        <link>https://rodolfo.ca/ubuntu/linux/kubernetes/2019/11/17/kubernetes-installing-minikube-and-kubectl-on-ubuntu-linux.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/ubuntu/linux/kubernetes/2019/11/17/kubernetes-installing-minikube-and-kubectl-on-ubuntu-linux.html</guid>
        
        <category>ubuntu</category>
        
        <category>linux</category>
        
        <category>kubernetes</category>
        
        
        <category>ubuntu</category>
        
        <category>linux</category>
        
        <category>kubernetes</category>
        
      </item>
      
    
    
      <item>
        <title>How to install Docker on Amazon Linux 2</title>
        <description>&lt;p&gt;On Amazon AWS, they have their own distribution called Amazon Linux. This linux comes with a special support
provided by AWS engineers and some cool features and a nice integration with the AWS environment itself.&lt;/p&gt;

&lt;p&gt;Fist step to get Docker installed on there is update your distro. But first, a quick tip after you create your EC2
instance.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Confirm in the security settings of your EC2 instance, if you have the port 22 open.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Connect using: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ssh ec2-user@THE-PUBLIC-ADDRESS-OR-IP&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Run an update:&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo yum update -y
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ol&gt;
  &lt;li&gt;Installing Docker:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# installing
sudo amazon-linux-extras install docker
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ol&gt;
  &lt;li&gt;tarting the service&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo service docker start
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ol&gt;
  &lt;li&gt;Add ec2-user to docker group so you won’t need to type “sudo” all the time&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo usermod -a -G docker ec2-user
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ol&gt;
  &lt;li&gt;Start docker service even after restarting the server&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo systemctl enable docker
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ol&gt;
  &lt;li&gt;Last step is just reboot the server.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo restart -n
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Mon, 20 May 2019 13:33:29 -0400</pubDate>
        <link>https://rodolfo.ca/linux/aws/amazon/docker/2019/05/20/how-to-install-docker-on-amazon-linux-2.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/linux/aws/amazon/docker/2019/05/20/how-to-install-docker-on-amazon-linux-2.html</guid>
        
        <category>linux</category>
        
        <category>aws</category>
        
        <category>amazon</category>
        
        <category>docker</category>
        
        
        <category>linux</category>
        
        <category>aws</category>
        
        <category>amazon</category>
        
        <category>docker</category>
        
      </item>
      
    
    
      <item>
        <title>Using fail2ban, how to block an IP for 1 minute after 3 Nginx 404 errors in the last minute</title>
        <description>&lt;p&gt;I am assuming that you already have &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fail2ban&lt;/code&gt; installed. If not, just do it. On Ubuntu it is a simple &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo apt install fail2ban&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Webservers with public access are constantly getting scanned by h4ck3rs out there. Those scanners hit multiple
endpoints trying to find any tip that you might be running something either outdated or unsafe.&lt;/p&gt;

&lt;p&gt;Fail2ban is a great tool that work together with iptables to block an user if it gets to invasive. If you check
the config files probably under &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/fail2ban&lt;/code&gt;, you just need to create a new &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nginx-4xx&lt;/code&gt; like following:&lt;/p&gt;

&lt;p&gt;jail.conf**&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[nginx-4xx]
action   = iptables-multiport[name=&quot;nginx_4xx&quot;, port=&quot;http,https&quot;]
enabled = true
filter = nginx-4xx
port = http, https
logpath = /var/log/nginx/access.log
findtime = 60
bantime = 3600
maxretry = 3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;filters.d/nginx-4xx.conf&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[Definition]
failregex = ^&amp;lt;HOST&amp;gt;.*&quot;(GET|POST|HEAD).*&quot; (404|444|403|400) .*$
ignoreregex =
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I’m pretty sure this is information enough for you to customize it if you’re using Apache instead of Nginx.
Hope that is helpful!&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Reference: &lt;a href=&quot;https://gist.github.com/AysadKozanoglu/1335735272fb3b00a03bd3eea22af818&quot;&gt;https://gist.github.com/AysadKozanoglu/1335735272fb3b00a03bd3eea22af818&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Mon, 20 May 2019 13:18:02 -0400</pubDate>
        <link>https://rodolfo.ca/linux/security/fail2ban/2019/05/20/how-to-block-an-up-for-1-minute-after-3-404-errors-using-fail2ban.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/linux/security/fail2ban/2019/05/20/how-to-block-an-up-for-1-minute-after-3-404-errors-using-fail2ban.html</guid>
        
        <category>linux</category>
        
        <category>security</category>
        
        <category>fail2ban</category>
        
        
        <category>linux</category>
        
        <category>security</category>
        
        <category>fail2ban</category>
        
      </item>
      
    
    
      <item>
        <title>How to keep Git history after renaming or moving files</title>
        <description>&lt;p&gt;Have you noticed that after renaming or moving a file git override and create a brand new git history? Lets fix this!&lt;/p&gt;

&lt;p&gt;Just use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git mv&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git mv foo.txt bar.txt
git commit
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Easy enough to miss this and just forget it but it will help out while tracking back some issues in the future.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Reference: &lt;a href=&quot;https://stackoverflow.com/questions/35618507/git-sure-fire-way-to-move-rename-files-while-keeping-the-history&quot;&gt;https://stackoverflow.com/questions/35618507/git-sure-fire-way-to-move-rename-files-while-keeping-the-history&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Mon, 20 May 2019 11:23:23 -0400</pubDate>
        <link>https://rodolfo.ca/git/development/2019/05/20/how-to-keep-git-history-after-renaming-or-moving-files.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/git/development/2019/05/20/how-to-keep-git-history-after-renaming-or-moving-files.html</guid>
        
        <category>git</category>
        
        <category>development</category>
        
        
        <category>git</category>
        
        <category>development</category>
        
      </item>
      
    
    
      <item>
        <title>How to uncompress .tar.xz OR .xz (Ubuntu Linux)</title>
        <description>&lt;p&gt;Some time ago, I downloaded the latest Tor Browser for Linux and got this weird extension &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.tar.xz&lt;/code&gt;.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tar -xJf tor-browser.tar.xz&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You have to install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;xz-utils&lt;/code&gt; package first:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo apt-get install xz-utils
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;unxz&lt;/code&gt; command to extract &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.xz&lt;/code&gt; files:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ unxz file.xz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;or using with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--decompress&lt;/code&gt; option of xz:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ xz --decompress file.xz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;p&gt;Reference: &lt;a href=&quot;https://linux-tips.com/t/how-to-extract-xz-files/265&quot;&gt;https://linux-tips.com/t/how-to-extract-xz-files/265&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Mon, 20 May 2019 10:45:03 -0400</pubDate>
        <link>https://rodolfo.ca/linux/2019/05/20/uncompress-tar-xz-files.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/linux/2019/05/20/uncompress-tar-xz-files.html</guid>
        
        <category>linux</category>
        
        
        <category>linux</category>
        
      </item>
      
    
    
      <item>
        <title>Setting up a single node of Apache Hadoop 3.0 on Ubuntu 16.04</title>
        <description>&lt;p&gt;Base for future postspt-get install ssh&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;pdsh
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~
&lt;span class=&quot;nb&quot;&gt;mkdir &lt;/span&gt;hadoop
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;hadoop
wget http://mirror.its.dal.ca/apache/hadoop/common/hadoop-3.0.0-alpha2/hadoop-3.0.0-alpha2.tar.gz
&lt;span class=&quot;nb&quot;&gt;tar&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-xzvf&lt;/span&gt; hadoop-3.0.0-alpha2.tar.gz
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;hadoop-3.0.0-alpha2
vim ./etc/hadoop/hadoop-env.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;p&gt;Reference: &lt;a href=&quot;http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/SingleCluster.html&quot;&gt;http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/SingleCluster.html&lt;/a&gt;
`&lt;/p&gt;
</description>
        <pubDate>Thu, 07 Mar 2019 08:59:23 -0500</pubDate>
        <link>https://rodolfo.ca/hadoop/ubuntu/2019/03/07/single-node-apache-hadoop-on-ubuntu.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/hadoop/ubuntu/2019/03/07/single-node-apache-hadoop-on-ubuntu.html</guid>
        
        <category>hadoop</category>
        
        <category>ubuntu</category>
        
        
        <category>hadoop</category>
        
        <category>ubuntu</category>
        
      </item>
      
    
    
      <item>
        <title>Rolling back RubyOnRails Migration</title>
        <description>&lt;p&gt;Creating RubyOnRails migrations also allow us to rollback an migration after executing it.&lt;/p&gt;

&lt;p&gt;Two common ways to write migrations is either using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;def change&lt;/code&gt; which is the default from Rails by the way,
or using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;def up&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;def down&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;When using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;def change&lt;/code&gt;, Rails is smart enough and tries to rollback automatically. And of course if you have 
something crazy like a raw query on your migration, you can use the old school &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;def up&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;def down&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Basically, you just need to get the timestamp that it is usually on the migration’s filename and run:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bundle exec rake db:migrate:redo VERSION=20180330164947&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Another alternative is reset your db everytime you make a mistake. In dev mode it is still OK, but taking advantage on core features is even better.&lt;/p&gt;

&lt;p&gt;Cheers,
Rodolfo&lt;/p&gt;

</description>
        <pubDate>Thu, 21 Jun 2018 09:35:50 -0400</pubDate>
        <link>https://rodolfo.ca/ruby/rails/migrations/2018/06/21/rollinback-ruby-on-rails-migrations.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/ruby/rails/migrations/2018/06/21/rollinback-ruby-on-rails-migrations.html</guid>
        
        <category>Ruby</category>
        
        <category>Rails</category>
        
        <category>Migrations</category>
        
        
        <category>Ruby</category>
        
        <category>Rails</category>
        
        <category>Migrations</category>
        
      </item>
      
    
    
      <item>
        <title>Speed up mysql import on MacOS</title>
        <description>&lt;p&gt;If you have MySQL running from a brew install, here are some precious tips if you want to speed up imports.
On this test, I managed to decrease ~30 minutes of import process. From 45 minutes to 13 minutes.&lt;/p&gt;

&lt;p&gt;I got to those numbers running http://mysqltuner.com. It’s basically a perl script that reads your mysql
config and shows an output with some metrics to change.&lt;/p&gt;

&lt;p&gt;First, some commands to check your current&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;innodb_buffer_pool_size&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SHOW VARIABLES LIKE &apos;innodb_buffer_pool_size&apos;;&lt;/code&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;vim /usr/local/Cellar/mysql@5.6/5.6.36_1/my.cnf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-ini highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Speed up Imports:
&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;innodb_flush_log_at_trx_commit&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;innodb_log_file_size&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;500M&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;innodb_buffer_pool_size&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;3G&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Restarting:&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /usr/local/Cellar/mysql@5.6/5.6.36_1/bin/
./mysql.server restart
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Tue, 26 Dec 2017 23:48:34 -0500</pubDate>
        <link>https://rodolfo.ca/2017/12/26/speed-up-mysql-import-on-macos.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2017/12/26/speed-up-mysql-import-on-macos.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Zookeeper and Apache Kafka with Ruby</title>
        <description>&lt;div align=&quot;center&quot;&gt;
  &lt;img src=&quot;https://static.rodolfo.io/images/20180108/98f6d3335180236978758595d53248267f79aa718f6f.jpg&quot; border=&quot;1&quot; /&gt;
&lt;/div&gt;

&lt;p&gt;Time to check this distributed queue system idea using Zookeeper and Apache Kafka. Let me guide you from installing
it on Ubuntu 16.04 and finally testing a producer and consumer using Ruby.&lt;/p&gt;

&lt;p&gt;There we go:&lt;/p&gt;

&lt;p&gt;1) Install Zookeeper: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo apt-get install zookeeper&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;2) Downloading Apache Kafka:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;wget http://apache.parentingamerica.com/kafka/0.11.0.0/kafka_2.11-0.11.0.0.tgz&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;3) Installing Kafka:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo mkdir /usr/local/kafka&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo tar -xvf kafka_2.11-0.11.0.0.tgz -C /usr/local/kafka/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;4) Special config to make it work on a single node:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo vim /usr/local/kafka/kafka_2.11-0.11.0.0/config/server.properties&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;port = 9092
advertised.host.name = localhost
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;5) Starting Apache Kafka in background. Notice that you DON’T need sudo.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nohup /usr/local/kafka/kafka_2.11-0.11.0.0/bin/kafka-server-start.sh /usr/local/kafka/kafka_2.11-0.11.0.0/config/server.properties &amp;amp;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;6) Let’s create a iptables simple firewall allowing only localhost to connect to our Zookeeper and Kafka. Remember that the idea of Zookeeper and Kafta is having a distributed queue system where you can spread your queue on multiple machines. (Huge stuff brow); So, since the idea here is just study using one single machine on digital ocean, here is how to block h4ck3rs from internet connecting to your toys.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vim iptables.sh&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Closing Kafka and Zookeeper ports from external world. Allowing just locally.&quot;&lt;/span&gt;

iptables &lt;span class=&quot;nt&quot;&gt;-A&lt;/span&gt; INPUT &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; tcp &lt;span class=&quot;nt&quot;&gt;--dport&lt;/span&gt; 2181 &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; 127.0.0.0/8 &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; ACCEPT
iptables &lt;span class=&quot;nt&quot;&gt;-A&lt;/span&gt; INPUT &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; tcp &lt;span class=&quot;nt&quot;&gt;--dport&lt;/span&gt; 44337 &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; 127.0.0.0/8 &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; ACCEPT
iptables &lt;span class=&quot;nt&quot;&gt;-A&lt;/span&gt; INPUT &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; tcp &lt;span class=&quot;nt&quot;&gt;--dport&lt;/span&gt; 34232 &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; 127.0.0.0/8 &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; ACCEPT
iptables &lt;span class=&quot;nt&quot;&gt;-A&lt;/span&gt; INPUT &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; tcp &lt;span class=&quot;nt&quot;&gt;--dport&lt;/span&gt; 9092 &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; 127.0.0.0/8 &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; ACCEPT
iptables &lt;span class=&quot;nt&quot;&gt;-A&lt;/span&gt; INPUT &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; tcp &lt;span class=&quot;nt&quot;&gt;--dport&lt;/span&gt; 2181 &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; DROP
iptables &lt;span class=&quot;nt&quot;&gt;-A&lt;/span&gt; INPUT &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; tcp &lt;span class=&quot;nt&quot;&gt;--dport&lt;/span&gt; 44337 &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; DROP
iptables &lt;span class=&quot;nt&quot;&gt;-A&lt;/span&gt; INPUT &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; tcp &lt;span class=&quot;nt&quot;&gt;--dport&lt;/span&gt; 34232 &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; DROP
iptables &lt;span class=&quot;nt&quot;&gt;-A&lt;/span&gt; INPUT &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; tcp &lt;span class=&quot;nt&quot;&gt;--dport&lt;/span&gt; 9092 &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; DROP
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Cleaning iptables before starting our rules. Careful if you have previous rules!! You can check the rules with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo iptables -L&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;iptables &lt;span class=&quot;nt&quot;&gt;-F&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo&lt;/span&gt; ./iptables.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now testing using ruby:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;gem &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;ruby-kafka
git clone git@github.com:rodolfobandeira/ruby-kafka.git
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;ruby-kafka
ruby producer.rb &lt;span class=&quot;c&quot;&gt;# (Repete 3 times)&lt;/span&gt;
ruby consumer.rb &lt;span class=&quot;c&quot;&gt;# (Yeahh)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Hello, World! 617f4877-e34d-4bab-9993-4f95da626549
1

Hello, World! f14e791a-092f-4100-b35d-c51d716e5e57
2

Hello, World! 87c302aa-df8e-41fa-88b5-657148f029d1
3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;producer.rb:&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;kafka&apos;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;securerandom&apos;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;kafka&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Kafka&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;seed_brokers: &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;127.0.0.1:9092&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;client_id: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;my-application&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;kafka&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;deliver_message&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Hello, World! &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;SecureRandom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;uuid&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;topic: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;greetings&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;consumer.rb:&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;kafka&apos;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;kafka&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Kafka&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;seed_brokers: &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;localhost:9092&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;


&lt;span class=&quot;n&quot;&gt;consumer&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;kafka&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;consumer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;group_id: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;my-consumer&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;# Increase offset commit frequency to once every 5 seconds.&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;offset_commit_interval: &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;# Commit offsets when 100 messages have been processed.&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;offset_commit_threshold: &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;# Increase the length of time that committed offsets are kept.&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;offset_retention_time: &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;60&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;60&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;consumer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;subscribe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;greetings&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;trap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;TERM&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;consumer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;stop&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;consumer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;each_message&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;automatically_mark_as_processed: &lt;/span&gt;&lt;span class=&quot;kp&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;offset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;value&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;consumer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;mark_message_as_processed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Hope you enjoy!&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;Reference:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;https://gist.github.com/monkut/07cd1618102cbae8d587811654c92902&lt;/li&gt;
  &lt;li&gt;https://devops.profitbricks.com/tutorials/install-and-configure-apache-kafka-on-ubuntu-1604-1/&lt;/li&gt;
  &lt;li&gt;https://stackoverflow.com/questions/35788697/leader-not-available-kafka-in-console-producer&lt;/li&gt;
  &lt;li&gt;https://github.com/zendesk/ruby-kafka#consuming-messages-from-kafka&lt;/li&gt;
  &lt;li&gt;https://github.com/rodolfobandeira/ruby-kafka&lt;/li&gt;
&lt;/ul&gt;

</description>
        <pubDate>Wed, 02 Aug 2017 23:43:23 -0400</pubDate>
        <link>https://rodolfo.ca/devops/2017/08/02/zookeeper-and-apache-kafka-with-ruby.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/devops/2017/08/02/zookeeper-and-apache-kafka-with-ruby.html</guid>
        
        <category>zookeeper</category>
        
        <category>kafka</category>
        
        <category>ruby</category>
        
        
        <category>devops</category>
        
      </item>
      
    
    
      <item>
        <title>Starting a new Rails project using MySQL</title>
        <description>&lt;p&gt;Starting a new Rails projects starts basically having Rails installed. If you don’t have it yet, you can install with:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gem install rails&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you want to check the version of rails you have, try:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rails --version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Having Rails now it’s time to create your project using MySQL instead of the default option which is SQLite.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rails new ProjectName -d mysql&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now that we have our project, we’re going to just change the file database.yml adding the password. Keep in mind that in production environment, you won’t do this. The best practice says to setup credentials as Config Variables.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vim config/database.yml&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And add the password on this section:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;default: &amp;amp;default
  adapter: mysql2
  encoding: utf8
  pool: 5
  username: root
  password: EDIT_HERE_WITH_YOUR_PASSWORD
  socket: /var/run/mysqld/mysqld.sock
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The last step is create the database. Rails is going to create a development and test database:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bundle exec rake db:create&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That’s it!&lt;/p&gt;

</description>
        <pubDate>Sat, 25 Feb 2017 14:05:23 -0500</pubDate>
        <link>https://rodolfo.ca/2017/02/25/starting-a-new-rails-project-using-mysql.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2017/02/25/starting-a-new-rails-project-using-mysql.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to create an small linux docker container using Alpine Linux</title>
        <description>&lt;p&gt;In my latest studies about Docker, I found out a really nice linux distribution called 
Alpine. This linux is based on BusyBox which makes possible create a nice linux with 
a really small space on disk.&lt;/p&gt;

&lt;blockquote&gt;

&lt;/blockquote&gt;

&lt;p&gt;Most of the official docker images comes with Ubuntu/Debian linux. It ends with at 
least ~200MB. With Alpine you can reduce it to ~4MB. Lets do an very simple test:&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1) Getting Alpine image:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo docker pull alpine&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2) Listing images. Yes, ~4MB :)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo docker images&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
alpine              latest              88e169ea8f46        8 weeks ago         3.98 MB
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3) Running Alpine and entering on its command line interface:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo docker run -it alpine /bin/sh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Also, Alpine linux has a package manager “apk” which some nice softwares on it’s list. 
You can check the list here: &lt;a href=&quot;https://pkgs.alpinelinux.org/packages&quot;&gt;https://pkgs.alpinelinux.org/packages&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s do another test. Let’s install Ruby!&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4) Updating package list:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;apk update&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.5/community/x86_64/APKINDEX.tar.gz
v3.5.1-44-g5aeeee9343 [http://dl-cdn.alpinelinux.org/alpine/v3.5/main]
v3.5.1-44-g5aeeee9343 [http://dl-cdn.alpinelinux.org/alpine/v3.5/community]
OK: 7958 distinct packages available
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5) Installing Ruby:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;apk add ruby&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(1/10) Installing libffi (3.2.1-r2)
(2/10) Installing gdbm (1.12-r0)
(3/10) Installing gmp (6.1.1-r0)
(4/10) Installing ncurses-terminfo-base (6.0-r7)
(5/10) Installing ncurses-terminfo (6.0-r7)
(6/10) Installing ncurses-libs (6.0-r7)
(7/10) Installing readline (6.3.008-r4)
(8/10) Installing yaml (0.1.7-r0)
(9/10) Installing ruby-libs (2.3.3-r0)
(10/10) Installing ruby (2.3.3-r0)
Executing busybox-1.25.1-r0.trigger
OK: 26 MiB in 21 packages
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6) Checking the installation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ruby -v&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux-musl]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Hope you enjoy!&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://twitter.com/rodolfobandeira&quot;&gt;Rodolfo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;Reference:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management#Add_a_Package&quot;&gt;http://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management#Add_a_Package
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://containertutorials.com/alpine/get_started.html&quot;&gt;http://containertutorials.com/alpine/get_started.html&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Sat, 25 Feb 2017 08:59:23 -0500</pubDate>
        <link>https://rodolfo.ca/2017/02/25/how-to-create-an-small-linux-docker-container-using-alpine-linux.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2017/02/25/how-to-create-an-small-linux-docker-container-using-alpine-linux.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Basic setup of an ElasticSearch Docker</title>
        <description>&lt;p&gt;I’ve been playing with Docker in the last weeks. Today I’m gonna show you
how to setup a basic ElasticSearch Docker. I’m gonna show you more advanced
configurations in future posts. (Maybe clustering and custom configs).&lt;/p&gt;

&lt;p&gt;We’re going to pull an specific version of ElasticSearch (1.7). You
can get the latest one just ommiting the “:1.7” from the following commands
you see here.&lt;/p&gt;

&lt;p&gt;Also, in it’s default configuration, it binds the port 9200 to 0.0.0.0 so we’re
going to change something in order to bind only to Docker host (your Operational System).&lt;/p&gt;

&lt;p&gt;Enough bla bla bla.. Let’s do it! :)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1) Pulling docker image using specific version 1.7:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo docker pull elasticsearch:1.7&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2) Checking if the image was indeed pulled:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo docker images&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3) Running docker and exposing the 9200 port only to the docker’s host:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo docker run --name elasticsearch -p 127.0.0.1:9200:9200 -d elasticsearch:1.7&lt;/code&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;4) Testing:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;curl -XGET &quot;http://localhost:9200/&quot;&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl -XGET &quot;http://localhost:9200/&quot;
{
  &quot;status&quot; : 200,
  &quot;name&quot; : &quot;Richard Parker&quot;,
  &quot;cluster_name&quot; : &quot;elasticsearch&quot;,
  &quot;version&quot; : {
    &quot;number&quot; : &quot;1.7.6&quot;,
    &quot;build_hash&quot; : &quot;c730b59357f8ebc555286794dcd90b3411f517c9&quot;,
    &quot;build_timestamp&quot; : &quot;2016-11-18T15:21:16Z&quot;,
    &quot;build_snapshot&quot; : false,
    &quot;lucene_version&quot; : &quot;4.10.4&quot;
  },
  &quot;tagline&quot; : &quot;You Know, for Search&quot;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;See you next post!&lt;/p&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Fri, 24 Feb 2017 05:23:23 -0500</pubDate>
        <link>https://rodolfo.ca/2017/02/24/basic-setup-of-an-elasticsearch-docker.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2017/02/24/basic-setup-of-an-elasticsearch-docker.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>(Video) How to squash multiple commits in just one using git</title>
        <description>&lt;p&gt;Happy new year!&lt;/p&gt;

&lt;p&gt;I’m planning to start creating some video content in Youtube and this is my first try.
Please take a look and let me know via &lt;a href=&quot;https://twitter.com/rodolfobandeira&quot;&gt;Twitter @rodolfobandeira&lt;/a&gt;
what do you think.&lt;/p&gt;

&lt;p&gt;The idea of this first video is show you how “rebase” or just merge 
multiple commits in just one while using &lt;strong&gt;git&lt;/strong&gt;&lt;/p&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/PZdVLaiAAmY&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;Here we a list of commands that you can see in the video.&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
git checkout -b feature/my-feature
touch 1.txt
git add .
git commit -m &apos;my Commit&apos;
git rebase -i master

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Thanks,
Rodolfo&lt;/p&gt;
</description>
        <pubDate>Mon, 02 Jan 2017 18:59:23 -0500</pubDate>
        <link>https://rodolfo.ca/2017/01/02/how-to-squash-multiple-commits-in-just-one-with-git.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2017/01/02/how-to-squash-multiple-commits-in-just-one-with-git.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Cracking Snes games with PHP</title>
        <description>&lt;p&gt;First of all, let me say special thanks to this person which is a kind of inspiration on programming not only for me, but for tons of developers around the world. Bisqwit. I got inspired of doing this post, after watching his video “Cracking Videogame Passwords - Gremlins 2”. &lt;a href=&quot;https://www.youtube.com/watch?v=iajgztvLxGc&quot;&gt;https://www.youtube.com/watch?v=iajgztvLxGc&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, I decided to try out with TOP GEAR. If you remember, when you were a little kid, it was very frustrating when you finally got to a level, but suddenly you lost and got the famous screen “GAME OVER” right?&lt;/p&gt;

&lt;p&gt;Oh well, I have the emulator here and I didn’t manage to pass even from South America level (Brazil). The good point is that I got the password key:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MOONBATH&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;How about if we inspect the rom file and try to catch more passwords like that? How about if we get the latest password? Cool eh? Let’s to it.&lt;/p&gt;

&lt;p&gt;Bisqwit wrote this PHP file to capture text inside binary files. I copied from his youtube video and decided to try. I did a post in my blog teaching how to crack binary files using VIM/PHP. I was using objdump. It’s actually the same idea, but using this php script, Bisqwit made this task even easier.&lt;/p&gt;

&lt;div class=&quot;language-php highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Created by: Bisqwit on his video:&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// https://www.youtube.com/watch?v=iajgztvLxGc&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$s&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;file_get_contents&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;php://stdin&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$text&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$argv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$step&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$step&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$step&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$offset&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$offset&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;256&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$offset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nv&quot;&gt;$txt&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[];&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;strlen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;nv&quot;&gt;$txt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;chr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;ord&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$offset&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

        &lt;span class=&quot;nv&quot;&gt;$b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;strlen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$step&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$txt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;foreach&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$txt&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$d&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$d&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$step&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;k&quot;&gt;continue&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;Found &amp;lt;%1$s&amp;gt; at position %2$d ($%2$X), &apos;&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;.&lt;/span&gt;
                &lt;span class=&quot;s1&quot;&gt;&apos;with offset %3$d ($%3$X), step %4$d ($%4$X)&apos;&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                    &lt;span class=&quot;nv&quot;&gt;$text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$offset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$step&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Searching by the word MOONBATH inside the file.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;php find-text-in-binary.php MOONBATH &amp;lt; top_gear_usa.nes&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Found &amp;lt;MOONBATH&amp;gt; at position 443667 ($6C513), with offset 0 ($0), step 1 ($1)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There we go! Now, let’s open VIM and type: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ESC + :%!xdd&lt;/code&gt; (This will enable HEX mode on VIM)&lt;/p&gt;

&lt;p&gt;Let’s now, jump to the memory address &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;6c51&lt;/code&gt;. As you can see, the rom file I got, it’s on the line 27730.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;27717 0006c440: 5320 2031 3020 5054 5320 203d 3820 5054  S  10 PTS  =8 PT
27718 0006c450: 5320 203d 3620 5054 5320 203d 3420 5054  S  =6 PTS  =4 PT
27719 0006c460: 5320 203d 3320 5054 5320 203d 3220 5054  S  =3 PTS  =2 PT
27720 0006c470: 5320 203d 3120 5054 2020 2053 494d 4f4e  S  =1 PT   SIMON
27721 0006c480: 3d3d 3d52 4954 4348 4945 3d41 5348 3d3d  ===RITCHIE=ASH==
27722 0006c490: 3d3d 3d47 5245 4753 3d3d 3d43 4852 4953  ===GREGS===CHRIS
27723 0006c4a0: 3d3d 3d41 4445 3d3d 3d3d 3d54 2043 3d3d  ===ADE=====T C==
27724 0006c4b0: 3d3d 3d54 494d 3d3d 3d3d 3d53 495a 3d3d  ===TIM=====SIZ==
27725 0006c4c0: 3d3d 3d4d 4152 4b3d 3d3d 3d42 4552 4e49  ===MARK====BERNI
27726 0006c4d0: 3d3d 3d54 4f4e 593d 3d3d 3d4d 4154 543d  ===TONY====MATT=
27727 0006c4e0: 3d3d 3d52 4f42 3d3d 3d3d 3d49 414e 3d3d  ===ROB=====IAN==
27728 0006c4f0: 3d3d 3d4a 414d 4553 3d3d 3d53 4841 554e  ===JAMES===SHAUN
27729 0006c500: 3d3d 3d50 4155 4c3d 3d3d 3d43 4f4d 5055  ===PAUL====COMPU
27730 0006c510: 5445 524d 4f4f 4e42 4154 4847 4541 5242  TERMOONBATHGEARB
27731 0006c520: 4f58 2043 4152 2050 4152 4b52 4f41 4420  OX CAR PARKROAD
27732 0006c530: 484f 4745 4d55 4c41 544f 5241 4e41 4c59  HOGEMULATORANALY
27733 0006c540: 5345 5248 4f52 495a 4f4e 5346 4f55 5220  SERHORIZONSFOUR
27734 0006c550: 4d45 474c 4547 454e 4420 2054 4845 574f  MEGLEGEND  THEWO
27735 0006c560: 524c 444c 4554 5352 4143 4541 4c43 4845  RLDLETSRACEALCHE
27736 0006c570: 4d59 2041 204c 4f4f 5045 5253 4541 534f  MY A LOOPERSEASO
27737 0006c580: 4e41 4c45 4455 4341 5445 444f 494c 434c  NALEDUCATEDOILCL
27738 0006c590: 4f54 4857 5245 434b 4147 4543 4152 4143  OTHWRECKAGECARAC
27739 0006c5a0: 4f4c 4545 5059 4c4c 494f 4e47 4c55 4341  OLEEPYLLIONGLUCA
27740 0006c5b0: 474f 4e4b 4545 4c53 4f4e 2000 0204 0608  GONKEELSON .....
27741 0006c5c0: 0a0c 0e20 2224 2628 2a2c 2e40 4244 4648  ... &quot;$&amp;amp;(*,.@BDFH
27742 0006c5d0: 4a4c 4e60 6264 6668 6a6c 6e80 8284 8688  JLN`bdfhjln.....
27743 0006c5e0: 0004 0004 0004 0008 0008 0000 0000 000c  ................
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Look how cool is it? All the passwords are hardcoded in the same memory area.&lt;/p&gt;

&lt;p&gt;With a quick search on google I also got a list of passwords so we could confirm that those are indeed all passwords. &lt;a href=&quot;http://www.gamefaqs.com/snes/588802-top-gear/cheats&quot;&gt;http://www.gamefaqs.com/snes/588802-top-gear/cheats&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s try the final password which is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;KEELSON&lt;/code&gt;. Check the final result:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://static.rodolfo.io/images/20180916/57e1065590692e5846f75ec97afb2c82955562223b29.png&quot; alt=&quot;Final Result&quot; /&gt;&lt;/p&gt;

&lt;p&gt;See you next post!&lt;/p&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;

</description>
        <pubDate>Mon, 05 Sep 2016 20:15:23 -0400</pubDate>
        <link>https://rodolfo.ca/php/cracking/reverse%20engineer/crackme/2016/09/05/cracking-snes-games-with-php.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/php/cracking/reverse%20engineer/crackme/2016/09/05/cracking-snes-games-with-php.html</guid>
        
        
        <category>php</category>
        
        <category>cracking</category>
        
        <category>reverse engineer</category>
        
        <category>crackme</category>
        
      </item>
      
    
    
      <item>
        <title>Hello World in Linux Assembly 64 bits</title>
        <description>&lt;p&gt;After years far from Assembly, I decided to explore the 64 bits world with this simple hello world.
I hope the comments in the code can explain it to you.&lt;/p&gt;

&lt;p&gt;Installing NASM assembly compiler:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;nasm
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To compile:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nasm &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; elf64 &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; nasm_64_bits_hello_world.o nasm_64_bits_hello_world.asm
ld &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; nasm_64_bits_hello_world nasm_64_bits_hello_world.o
./nasm_64_bits_hello_world
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;pre&gt;&lt;code class=&quot;language-asm&quot;&gt;section .data
    msg db &apos;Rodolfo Bandeira&apos;, 0xA  ; our string
    len equ $ - msg                 ; length of our string

section .text
    global _start
; -----------------------------------------
; 64 bit registers:
; -----------------------------------------
; rax, rbx, rcx, rdx,
; rsi, rdi,
; rsp,
; r8, r9, r10, r11, r12, r13, r14, r15, r16
; -----------------------------------------
;
; We&apos;re going to use the system call bellow:
; ssize_t sys_write(unsigned int fd, const char * buf, size_t count)
;
; This is the registers used for the parameters
; -------------------------------------------------------------------------------
; System Call    |          rdi        |         rsi         |        rdx       |
; -------------------------------------------------------------------------------
; sys_write (1)  |   unsigned int fd   |   const char *buf   |   size_t count   |
; sys_exit (60)  |   int error_code    |                     |                  |
; -------------------------------------------------------------------------------
_start:
    mov     rax, 0x01              ; system call number (sys_write)
    mov     rdi, 0x01              ; file descriptor
    mov     rsi, msg               ; message
    mov     rdx, len               ; message length
    syscall                        ; call kernel

    mov     rax, 0x3C              ; system call (sys_exit) 60 = 0x3C
    mov     rdi, 0x00              ; 0 means no error
    syscall                        ; call kernel
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;

</description>
        <pubDate>Mon, 01 Aug 2016 20:15:23 -0400</pubDate>
        <link>https://rodolfo.ca/2016/08/01/hello-world-in-linux-assembly-64-bits.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2016/08/01/hello-world-in-linux-assembly-64-bits.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Testing FreeBSD DigitalOcean Droplet</title>
        <description>&lt;p&gt;Hello there!&lt;/p&gt;

&lt;p&gt;Today I’m gonna share with you a simple test I did this weekend in 
order to test a FreeBSD Server running at DigitalOcean.&lt;/p&gt;

&lt;p&gt;First, there is no problem to start your Droplet. I’m not gonna teach
you how to do that. It’s absolutely easy.&lt;/p&gt;

&lt;p&gt;First tip. How to connect into your server using SSH? In ubuntu server,
you can just do ssh root@YOUR_IP right? In freebsd this is the syntax:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ssh freebsd@YOUR_SERVER_IP&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Let’s see some information:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;freebsd@freebsd-512mb-nyc3-01:~ % uname -a;id&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;FreeBSD freebsd-512mb-nyc3-01 10.2-RELEASE FreeBSD 10.2-RELEASE #0 
r286666: Wed Aug 12 15:26:37 UTC 2015     
root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
uid=1001(freebsd) gid=1001(freebsd) groups=1001(freebsd),0(wheel)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;How to install &lt;strong&gt;htop&lt;/strong&gt;?&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo pkg install htop&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Where is our &lt;strong&gt;vim&lt;/strong&gt;?&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo pkg install vim&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now lets download my vim dotfiles. To do this, we’ll need &lt;strong&gt;git&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo pkg install git&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And then:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cd ~
git clone https://github.com/rodolfobandeira/dotfiles.git .dotfiles
cd .dotfiles
./install.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, lets change the default SSH port 22 for something else:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo vim /etc/ssh/sshd_config&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Change the line &lt;em&gt;Port&lt;/em&gt;, no really? yes&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo /etc/rc.d/sshd reload&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Want to install &lt;strong&gt;Nginx&lt;/strong&gt;?&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo pkg install nginx&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo nginx&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then go to the browser and type the IP of your server. You can get the IP with:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ifconfig vtnet0 | grep &quot;inet &quot; | awk &apos;{ print $2 }&apos; | head -n 1&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Thats it. Not a big deal using FreeBSD nowadays.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;
</description>
        <pubDate>Sat, 18 Jun 2016 10:15:23 -0400</pubDate>
        <link>https://rodolfo.ca/2016/06/18/testing-digitalocean-freebsd-droplet.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2016/06/18/testing-digitalocean-freebsd-droplet.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to Apply Security Patches in OpenBSD using Mtier</title>
        <description>&lt;p&gt;Are you an OpenBSD 5.9 user? Are you using LetsEncrypt Free SSL?&lt;/p&gt;

&lt;p&gt;Guess what!? After my latest certificate renew, 
My server started getting this error:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;This server is vulnerable to the OpenSSL Padding Oracle 
vulnerability (CVE-2016-2107) and insecure. Grade set to F.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After some research, I went to #openbsd channel at irc.freenode.net
and found some nice guys there that helped to solve it so I’d like 
to share with you some nice lessons I learned.&lt;/p&gt;

&lt;p&gt;This problem is generated because of a missing security patch.
Ok, in ubuntu it’s easy to upgrade your system. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;apt-get update&lt;/code&gt;
and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;apt-get upgrade&lt;/code&gt; and that’s it right?&lt;/p&gt;

&lt;p&gt;In OpenBSD you can follow the security patches at this url:&lt;/p&gt;

&lt;p&gt;http://www.openbsd.org/errata59.html&lt;/p&gt;

&lt;p&gt;You can apply the patch using the source code diff directly 
in the source of the files. In this case should be LibreSSL.&lt;/p&gt;

&lt;p&gt;Since I don’t have the source code of all my installed packages,
I’m gonna show you how to apply binpatches using Mtier.&lt;/p&gt;

&lt;p&gt;https://stable.mtier.org/&lt;/p&gt;

&lt;p&gt;As you can see the instructions on this website is here:&lt;/p&gt;

&lt;p&gt;1) Download M:Tier public key:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;doas -s&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd /etc/signify&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ftp https://stable.mtier.org/mtier-59-pkg.pub&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;2) Update your PKG_PATH:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PKG_PATH=https://stable.mtier.org/updates/$(uname -r)/$(arch -s):${PKG_PATH}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;export PKG_PATH&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And then let’s apply the patches. In my case I applied the security patch for Crypto:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pkg_add binpatch59-amd64-crypto&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;3) You can also upgrade all packages in your system using:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pkg_add -u&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you want to apply the security patch for SSHD, you can just replace the 
last word in the command for what you want to patch:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pkg_add binpatch59-amd64-sshd&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I don’t need to mention that in my case the arquitecture is amd64, but 
in your case could be different, so keep your eyes on it.&lt;/p&gt;

&lt;p&gt;That’s it for today!
Thanks!&lt;/p&gt;

</description>
        <pubDate>Sat, 18 Jun 2016 08:12:13 -0400</pubDate>
        <link>https://rodolfo.ca/2016/06/18/how-to-apply-security-patches-in-openbsd.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2016/06/18/how-to-apply-security-patches-in-openbsd.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Ruby and MongoDB</title>
        <description>&lt;h3 id=&quot;ruby-and-mongodb&quot;&gt;Ruby and MongoDB&lt;/h3&gt;

&lt;p&gt;Hello internet,&lt;/p&gt;

&lt;p&gt;I started working with Ruby and MongoDB 2 weeks ago. First of all, I would
 like to say that if you know another language like C, Java or even PHP
 if you jump into Ruby you’ll feel like doing math homework for your 12
 years old kid. I’m not saying that Ruby is bad. I’m just saying that since
 you have a software development background you will pick up very very very fast.&lt;/p&gt;

&lt;p&gt;Rails is a MVC framework that facilitates everything but since I’m coming from
 almost 2 years working with Symfony, ruby and rails is being piece of cake.&lt;/p&gt;

&lt;p&gt;What I did? In my first week I completed the codecademy.com ruby course. I
 was talking with a co-worker and he said he doesn’t like codecademy because he
 feels that it’s too easy for him and Codecademy shows only basic stuff. Since
 I completed the course I can say my opinion now. I really liked. I know there are
 some basic ideas but I’m pretty sure that if you study Ruby and never touch
 your hand again in any code, I’ll probably forget a bunch of concepts.&lt;/p&gt;

&lt;p&gt;I’m also read the book &lt;strong&gt;Beginning Rails 4&lt;/strong&gt;. Now I’m reading other excellent
 book about Ruby and MongoDB. So, I decided to write this post in order to
 keep some commands I’ve learning in just one place in case I need in the future.&lt;/p&gt;

&lt;h4 id=&quot;first-some-mongodb-useful-commands&quot;&gt;First some MongoDB useful commands:&lt;/h4&gt;

&lt;p&gt;Connecting and creating a db:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mongo name_of_my_database
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Saving data into db:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;db.name_of_my_object.save( { foo: &apos;bar&apos;, foo2: [ &apos;Bar2&apos;, &apos;Bar3&apos;]   })
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Retrieving all data:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;db.name_of_my_object.find()
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Retrieving data with equal filter:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;db.name_of_my_object.find(foo: &apos;bar&apos;)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Retrieving data with partial search:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;db.name_of_my_object.find({ foo: /bar/})
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Retrieving data with partial search and insen sitive case&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;db.name_of_my_object.find({ foo: /bar/i})
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Removing all the content:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;db.name_of_my_object.remove()
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Removing some specific the content:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;db.name_of_my_object.remove({name: &apos;foo&apos;})
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Exporting data from db to json:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mongoexport –d name_of_your_db –c item
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Exporting data to CSV:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mongoexport -d your_db_name -c your_table_name -f key1,key2 --csv -o output_file.csv
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Exporting and creating a backup using mongodump:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mongodump -d database_name
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;now-some-rails-commands&quot;&gt;Now some rails commands&lt;/h4&gt;

&lt;p&gt;We’re going to use the gem called Mongoid to talk with MongoDB from&lt;/p&gt;
</description>
        <pubDate>Sun, 01 May 2016 14:19:08 -0400</pubDate>
        <link>https://rodolfo.ca/2016/05/01/ruby-and-mongodb.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2016/05/01/ruby-and-mongodb.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Cracking binary files using VIM and some Linux tools</title>
        <description>&lt;p&gt;Hi there!&lt;/p&gt;

&lt;p&gt;This post shows a simple example of how to crack a binary file. We compile a
C file that when compiled will ask for a password. We dissasemble the file, change the
assembly instruction that validates the password so any password is considered valid.&lt;/p&gt;

&lt;p&gt;On my last post I wrote a simple crack to bypass a binary file.
Today I’m gonna give you another example but at this time instead of
using a simple unique number as a password, we’re going to change our
binary in order of that every password-key entered will validade as true.&lt;/p&gt;

&lt;p&gt;Our source file is: &lt;em&gt;&lt;strong&gt;cracking-tutorial-2.c&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;div class=&quot;language-c highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cp&quot;&gt;#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&amp;lt;string.h&amp;gt;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;main&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;argc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;argv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[])&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;argc&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Error, please type the password key &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;strcmp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;argv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;my-secret-key&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Congratulations &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Try again &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, let’s compile and then run the &lt;strong&gt;&lt;em&gt;objdump&lt;/em&gt;&lt;/strong&gt; tool to inspect the
internal functions and behavior.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;objdump &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; cracking-tutorial-2 &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /tmp/dump.txt
&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /tmp/dump.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;pre&gt;&lt;code class=&quot;language-asm&quot;&gt;cracking-tutorial-2:     file format elf64-x86-64


Disassembly of section .init:

0000000000400418 &amp;lt;_init&amp;gt;:
  400418:   48 83 ec 08             sub    $0x8,%rsp
  40041c:   48 8b 05 d5 0b 20 00    mov    0x200bd5(%rip),%rax        # 600ff8 &amp;lt;_DYNAMIC+0x1d0&amp;gt;
  400423:   48 85 c0                test   %rax,%rax
  400426:   74 05                   je     40042d &amp;lt;_init+0x15&amp;gt;
  400428:   e8 53 00 00 00          callq  400480 &amp;lt;__gmon_start__@plt&amp;gt;
  40042d:   48 83 c4 08             add    $0x8,%rsp
  400431:   c3                      retq

Disassembly of section .plt:

0000000000400440 &amp;lt;puts@plt-0x10&amp;gt;:
  400440:   ff 35 c2 0b 20 00       pushq  0x200bc2(%rip)        # 601008 &amp;lt;_GLOBAL_OFFSET_TABLE_+0x8&amp;gt;
  400446:   ff 25 c4 0b 20 00       jmpq   *0x200bc4(%rip)        # 601010 &amp;lt;_GLOBAL_OFFSET_TABLE_+0x10&amp;gt;
  40044c:   0f 1f 40 00             nopl   0x0(%rax)

0000000000400450 &amp;lt;puts@plt&amp;gt;:
  400450:   ff 25 c2 0b 20 00       jmpq   *0x200bc2(%rip)        # 601018 &amp;lt;_GLOBAL_OFFSET_TABLE_+0x18&amp;gt;
  400456:   68 00 00 00 00          pushq  $0x0
  40045b:   e9 e0 ff ff ff          jmpq   400440 &amp;lt;_init+0x28&amp;gt;

0000000000400460 &amp;lt;__libc_start_main@plt&amp;gt;:
  400460:   ff 25 ba 0b 20 00       jmpq   *0x200bba(%rip)        # 601020 &amp;lt;_GLOBAL_OFFSET_TABLE_+0x20&amp;gt;
  400466:   68 01 00 00 00          pushq  $0x1
  40046b:   e9 d0 ff ff ff          jmpq   400440 &amp;lt;_init+0x28&amp;gt;

0000000000400470 &amp;lt;strcmp@plt&amp;gt;:
  400470:   ff 25 b2 0b 20 00       jmpq   *0x200bb2(%rip)        # 601028 &amp;lt;_GLOBAL_OFFSET_TABLE_+0x28&amp;gt;
  400476:   68 02 00 00 00          pushq  $0x2
  40047b:   e9 c0 ff ff ff          jmpq   400440 &amp;lt;_init+0x28&amp;gt;

0000000000400480 &amp;lt;__gmon_start__@plt&amp;gt;:
  400480:   ff 25 aa 0b 20 00       jmpq   *0x200baa(%rip)        # 601030 &amp;lt;_GLOBAL_OFFSET_TABLE_+0x30&amp;gt;
  400486:   68 03 00 00 00          pushq  $0x3
  40048b:   e9 b0 ff ff ff          jmpq   400440 &amp;lt;_init+0x28&amp;gt;

Disassembly of section .text:

0000000000400490 &amp;lt;_start&amp;gt;:
  400490:   31 ed                   xor    %ebp,%ebp
  400492:   49 89 d1                mov    %rdx,%r9
  400495:   5e                      pop    %rsi
  400496:   48 89 e2                mov    %rsp,%rdx
  400499:   48 83 e4 f0             and    $0xfffffffffffffff0,%rsp
  40049d:   50                      push   %rax
  40049e:   54                      push   %rsp
  40049f:   49 c7 c0 60 06 40 00    mov    $0x400660,%r8
  4004a6:   48 c7 c1 f0 05 40 00    mov    $0x4005f0,%rcx
  4004ad:   48 c7 c7 7d 05 40 00    mov    $0x40057d,%rdi
  4004b4:   e8 a7 ff ff ff          callq  400460 &amp;lt;__libc_start_main@plt&amp;gt;
  4004b9:   f4                      hlt
  4004ba:   66 0f 1f 44 00 00       nopw   0x0(%rax,%rax,1)

00000000004004c0 &amp;lt;deregister_tm_clones&amp;gt;:
  4004c0:   b8 4f 10 60 00          mov    $0x60104f,%eax
  4004c5:   55                      push   %rbp
  4004c6:   48 2d 48 10 60 00       sub    $0x601048,%rax
  4004cc:   48 83 f8 0e             cmp    $0xe,%rax
  4004d0:   48 89 e5                mov    %rsp,%rbp
  4004d3:   77 02                   ja     4004d7 &amp;lt;deregister_tm_clones+0x17&amp;gt;
  4004d5:   5d                      pop    %rbp
  4004d6:   c3                      retq
  4004d7:   b8 00 00 00 00          mov    $0x0,%eax
  4004dc:   48 85 c0                test   %rax,%rax
  4004df:   74 f4                   je     4004d5 &amp;lt;deregister_tm_clones+0x15&amp;gt;
  4004e1:   5d                      pop    %rbp
  4004e2:   bf 48 10 60 00          mov    $0x601048,%edi
  4004e7:   ff e0                   jmpq   *%rax
  4004e9:   0f 1f 80 00 00 00 00    nopl   0x0(%rax)

00000000004004f0 &amp;lt;register_tm_clones&amp;gt;:
  4004f0:   b8 48 10 60 00          mov    $0x601048,%eax
  4004f5:   55                      push   %rbp
  4004f6:   48 2d 48 10 60 00       sub    $0x601048,%rax
  4004fc:   48 c1 f8 03             sar    $0x3,%rax
  400500:   48 89 e5                mov    %rsp,%rbp
  400503:   48 89 c2                mov    %rax,%rdx
  400506:   48 c1 ea 3f             shr    $0x3f,%rdx
  40050a:   48 01 d0                add    %rdx,%rax
  40050d:   48 d1 f8                sar    %rax
  400510:   75 02                   jne    400514 &amp;lt;register_tm_clones+0x24&amp;gt;
  400512:   5d                      pop    %rbp
  400513:   c3                      retq
  400514:   ba 00 00 00 00          mov    $0x0,%edx
  400519:   48 85 d2                test   %rdx,%rdx
  40051c:   74 f4                   je     400512 &amp;lt;register_tm_clones+0x22&amp;gt;
  40051e:   5d                      pop    %rbp
  40051f:   48 89 c6                mov    %rax,%rsi
  400522:   bf 48 10 60 00          mov    $0x601048,%edi
  400527:   ff e2                   jmpq   *%rdx
  400529:   0f 1f 80 00 00 00 00    nopl   0x0(%rax)

0000000000400530 &amp;lt;__do_global_dtors_aux&amp;gt;:
  400530:   80 3d 11 0b 20 00 00    cmpb   $0x0,0x200b11(%rip)        # 601048 &amp;lt;__TMC_END__&amp;gt;
  400537:   75 11                   jne    40054a &amp;lt;__do_global_dtors_aux+0x1a&amp;gt;
  400539:   55                      push   %rbp
  40053a:   48 89 e5                mov    %rsp,%rbp
  40053d:   e8 7e ff ff ff          callq  4004c0 &amp;lt;deregister_tm_clones&amp;gt;
  400542:   5d                      pop    %rbp
  400543:   c6 05 fe 0a 20 00 01    movb   $0x1,0x200afe(%rip)        # 601048 &amp;lt;__TMC_END__&amp;gt;
  40054a:   f3 c3                   repz retq
  40054c:   0f 1f 40 00             nopl   0x0(%rax)

0000000000400550 &amp;lt;frame_dummy&amp;gt;:
  400550:   48 83 3d c8 08 20 00    cmpq   $0x0,0x2008c8(%rip)        # 600e20 &amp;lt;__JCR_END__&amp;gt;
  400557:   00
  400558:   74 1e                   je     400578 &amp;lt;frame_dummy+0x28&amp;gt;
  40055a:   b8 00 00 00 00          mov    $0x0,%eax
  40055f:   48 85 c0                test   %rax,%rax
  400562:   74 14                   je     400578 &amp;lt;frame_dummy+0x28&amp;gt;
  400564:   55                      push   %rbp
  400565:   bf 20 0e 60 00          mov    $0x600e20,%edi
  40056a:   48 89 e5                mov    %rsp,%rbp
  40056d:   ff d0                   callq  *%rax
  40056f:   5d                      pop    %rbp
  400570:   e9 7b ff ff ff          jmpq   4004f0 &amp;lt;register_tm_clones&amp;gt;
  400575:   0f 1f 00                nopl   (%rax)
  400578:   e9 73 ff ff ff          jmpq   4004f0 &amp;lt;register_tm_clones&amp;gt;

000000000040057d &amp;lt;main&amp;gt;:
  40057d:   55                      push   %rbp
  40057e:   48 89 e5                mov    %rsp,%rbp
  400581:   48 83 ec 20             sub    $0x20,%rsp
  400585:   89 7d ec                mov    %edi,-0x14(%rbp)
  400588:   48 89 75 e0             mov    %rsi,-0x20(%rbp)
  40058c:   c7 45 fc 00 00 00 00    movl   $0x0,-0x4(%rbp)
  400593:   83 7d ec 01             cmpl   $0x1,-0x14(%rbp)
  400597:   7f 11                   jg     4005aa &amp;lt;main+0x2d&amp;gt;
  400599:   bf 78 06 40 00          mov    $0x400678,%edi
  40059e:   e8 ad fe ff ff          callq  400450 &amp;lt;puts@plt&amp;gt;
  4005a3:   b8 00 00 00 00          mov    $0x0,%eax
  4005a8:   eb 37                   jmp    4005e1 &amp;lt;main+0x64&amp;gt;
  4005aa:   48 8b 45 e0             mov    -0x20(%rbp),%rax
  4005ae:   48 83 c0 08             add    $0x8,%rax
  4005b2:   48 8b 00                mov    (%rax),%rax
  4005b5:   be 9d 06 40 00          mov    $0x40069d,%esi
  4005ba:   48 89 c7                mov    %rax,%rdi
  4005bd:   e8 ae fe ff ff          callq  400470 &amp;lt;strcmp@plt&amp;gt;
  4005c2:   85 c0                   test   %eax,%eax
  4005c4:   75 0c                   jne    4005d2 &amp;lt;main+0x55&amp;gt;
  4005c6:   bf ab 06 40 00          mov    $0x4006ab,%edi
  4005cb:   e8 80 fe ff ff          callq  400450 &amp;lt;puts@plt&amp;gt;
  4005d0:   eb 0a                   jmp    4005dc &amp;lt;main+0x5f&amp;gt;
  4005d2:   bf bc 06 40 00          mov    $0x4006bc,%edi
  4005d7:   e8 74 fe ff ff          callq  400450 &amp;lt;puts@plt&amp;gt;
  4005dc:   b8 00 00 00 00          mov    $0x0,%eax
  4005e1:   c9                      leaveq
  4005e2:   c3                      retq
  4005e3:   66 2e 0f 1f 84 00 00    nopw   %cs:0x0(%rax,%rax,1)
  4005ea:   00 00 00
  4005ed:   0f 1f 00                nopl   (%rax)

00000000004005f0 &amp;lt;__libc_csu_init&amp;gt;:
  4005f0:   41 57                   push   %r15
  4005f2:   41 89 ff                mov    %edi,%r15d
  4005f5:   41 56                   push   %r14
  4005f7:   49 89 f6                mov    %rsi,%r14
  4005fa:   41 55                   push   %r13
  4005fc:   49 89 d5                mov    %rdx,%r13
  4005ff:   41 54                   push   %r12
  400601:   4c 8d 25 08 08 20 00    lea    0x200808(%rip),%r12        # 600e10 &amp;lt;__frame_dummy_init_array_entry&amp;gt;
  400608:   55                      push   %rbp
  400609:   48 8d 2d 08 08 20 00    lea    0x200808(%rip),%rbp        # 600e18 &amp;lt;__init_array_end&amp;gt;
  400610:   53                      push   %rbx
  400611:   4c 29 e5                sub    %r12,%rbp
  400614:   31 db                   xor    %ebx,%ebx
  400616:   48 c1 fd 03             sar    $0x3,%rbp
  40061a:   48 83 ec 08             sub    $0x8,%rsp
  40061e:   e8 f5 fd ff ff          callq  400418 &amp;lt;_init&amp;gt;
  400623:   48 85 ed                test   %rbp,%rbp
  400626:   74 1e                   je     400646 &amp;lt;__libc_csu_init+0x56&amp;gt;
  400628:   0f 1f 84 00 00 00 00    nopl   0x0(%rax,%rax,1)
  40062f:   00
  400630:   4c 89 ea                mov    %r13,%rdx
  400633:   4c 89 f6                mov    %r14,%rsi
  400636:   44 89 ff                mov    %r15d,%edi
  400639:   41 ff 14 dc             callq  *(%r12,%rbx,8)
  40063d:   48 83 c3 01             add    $0x1,%rbx
  400641:   48 39 eb                cmp    %rbp,%rbx
  400644:   75 ea                   jne    400630 &amp;lt;__libc_csu_init+0x40&amp;gt;
  400646:   48 83 c4 08             add    $0x8,%rsp
  40064a:   5b                      pop    %rbx
  40064b:   5d                      pop    %rbp
  40064c:   41 5c                   pop    %r12
  40064e:   41 5d                   pop    %r13
  400650:   41 5e                   pop    %r14
  400652:   41 5f                   pop    %r15
  400654:   c3                      retq
  400655:   66 66 2e 0f 1f 84 00    data32 nopw %cs:0x0(%rax,%rax,1)
  40065c:   00 00 00 00

0000000000400660 &amp;lt;__libc_csu_fini&amp;gt;:
  400660:   f3 c3                   repz retq

Disassembly of section .fini:

0000000000400664 &amp;lt;_fini&amp;gt;:
  400664:   48 83 ec 08             sub    $0x8,%rsp
  400668:   48 83 c4 08             add    $0x8,%rsp
  40066c:   c3                      retq
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Memory address, hexadecimal and assembly. Let’s zoom in on the part the really is important
to us:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-asm&quot;&gt;  4005bd:    e8 ae fe ff ff           callq  400470 &amp;lt;strcmp@plt&amp;gt;   *** THIS LINE have the strcmp()
  4005c2:    85 c0                    test   %eax,%eax             ***
  4005c4:    75 0c                    jne    4005d2 &amp;lt;main+0x55&amp;gt;    *** JNE = Jump on Inequality
  4005c6:    bf ab 06 40 00           mov    $0x4006ab,%edi
  4005cb:    e8 80 fe ff ff           callq  400450 &amp;lt;puts@plt&amp;gt;
  4005d0:    eb 0a                    jmp    4005dc &amp;lt;main+0x5f&amp;gt;
  4005d2:    bf bc 06 40 00           mov    $0x4006bc,%edi
  4005d7:    e8 74 fe ff ff           callq  400450 &amp;lt;puts@plt&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Ok, let’s invert the logic on &lt;strong&gt;&lt;em&gt;JNE&lt;/em&gt;&lt;/strong&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-asm&quot;&gt;  4005c4:    75 0c                    jne    4005d2 &amp;lt;main+0x55&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Before we do the trick let’s test the program:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;./cracking-tutorial-2 I-do-not-know-the-password
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Try again
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, let’s open the binary using vim:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vim cracking-tutorial-2&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And then execute:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ESC + :%!xxd + ENTER&lt;/code&gt; You will see VIM change to HEX mode.&lt;/p&gt;

&lt;p&gt;Next, search by the hexadecimal codes we want to replace:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ESC + /750c + ENTER&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The coursor will stop exactly on the point we need to replace &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;75 to 74&lt;/code&gt; that means &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;je instead of jne&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After changing you need to exit &lt;strong&gt;HEX MODE BEFORE SAVING.&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ESC + :%!xxd -r + ENTER&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ESC + :x&lt;/code&gt; to save and exit&lt;/p&gt;

&lt;p&gt;Now final test:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./cracking-tutorial-2 rodolfo&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Congratulations
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Hope you enjoyed.&lt;/p&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;

</description>
        <pubDate>Mon, 08 Feb 2016 21:42:46 -0500</pubDate>
        <link>https://rodolfo.ca/vim/cracking/reverse%20engineer/crackme/2016/02/08/cracking-binary-files-using-vim-and-some-linux-tools.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/vim/cracking/reverse%20engineer/crackme/2016/02/08/cracking-binary-files-using-vim-and-some-linux-tools.html</guid>
        
        
        <category>vim</category>
        
        <category>cracking</category>
        
        <category>reverse engineer</category>
        
        <category>crackme</category>
        
      </item>
      
    
    
      <item>
        <title>Cracking binary files using PHP and some Linux tools</title>
        <description>&lt;p&gt;Hi there.&lt;/p&gt;

&lt;p&gt;Today I was asking myself if I still remember some low level programming like
assembly and some nice stuff I played when I was a 16 years old kid.
I don’t remember that much but I decided to do a quick test to see if I’m able to
pick up something from the middle of my brain. Actually some minutes on google
helped a bit to refresh my memory.&lt;/p&gt;

&lt;p&gt;I wrote this simple post to teach you how to edit a binary file
(or create a very very simple crack).&lt;/p&gt;

&lt;p&gt;We’re gonna do this using PHP and some tools that you can find on your
linux box.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1) First let’s compile our example using C. Create a file &lt;em&gt;hello-world.c&lt;/em&gt; with the following content:&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-c highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cp&quot;&gt;#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;password&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;password&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Congratulations &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Try again &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;2) To compile try this:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gcc -o hello-world hello-world.c&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now that we have a binary file on our folder, we can run it using this: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./hello-world&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Try again
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Our goal is change the binary file in order to show the word “Congratulations”.
First, let’s take a look on the binary file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3) Poke around inside the binary file using the following command:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;objdump -d hello-world &amp;gt; dump.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Your dump.txt must look like this:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-asm&quot;&gt;
hello-world:     file format elf64-x86-64


Disassembly of section .init:

00000000004003e0 &amp;lt;_init&amp;gt;:
  4003e0:   48 83 ec 08             sub    $0x8,%rsp
  4003e4:   48 8b 05 0d 0c 20 00    mov    0x200c0d(%rip),%rax        # 600ff8 &amp;lt;_DYNAMIC+0x1d0&amp;gt;
  4003eb:   48 85 c0                test   %rax,%rax
  4003ee:   74 05                   je     4003f5 &amp;lt;_init+0x15&amp;gt;
  4003f0:   e8 3b 00 00 00          callq  400430 &amp;lt;__gmon_start__@plt&amp;gt;
  4003f5:   48 83 c4 08             add    $0x8,%rsp
  4003f9:   c3                      retq

Disassembly of section .plt:

0000000000400400 &amp;lt;puts@plt-0x10&amp;gt;:
  400400:   ff 35 02 0c 20 00       pushq  0x200c02(%rip)        # 601008 &amp;lt;_GLOBAL_OFFSET_TABLE_+0x8&amp;gt;
  400406:   ff 25 04 0c 20 00       jmpq   *0x200c04(%rip)        # 601010 &amp;lt;_GLOBAL_OFFSET_TABLE_+0x10&amp;gt;
  40040c:   0f 1f 40 00             nopl   0x0(%rax)

0000000000400410 &amp;lt;puts@plt&amp;gt;:
  400410:   ff 25 02 0c 20 00       jmpq   *0x200c02(%rip)        # 601018 &amp;lt;_GLOBAL_OFFSET_TABLE_+0x18&amp;gt;
  400416:   68 00 00 00 00          pushq  $0x0
  40041b:   e9 e0 ff ff ff          jmpq   400400 &amp;lt;_init+0x20&amp;gt;

0000000000400420 &amp;lt;__libc_start_main@plt&amp;gt;:
  400420:   ff 25 fa 0b 20 00       jmpq   *0x200bfa(%rip)        # 601020 &amp;lt;_GLOBAL_OFFSET_TABLE_+0x20&amp;gt;
  400426:   68 01 00 00 00          pushq  $0x1
  40042b:   e9 d0 ff ff ff          jmpq   400400 &amp;lt;_init+0x20&amp;gt;

0000000000400430 &amp;lt;__gmon_start__@plt&amp;gt;:
  400430:   ff 25 f2 0b 20 00       jmpq   *0x200bf2(%rip)        # 601028 &amp;lt;_GLOBAL_OFFSET_TABLE_+0x28&amp;gt;
  400436:   68 02 00 00 00          pushq  $0x2
  40043b:   e9 c0 ff ff ff          jmpq   400400 &amp;lt;_init+0x20&amp;gt;

Disassembly of section .text:

0000000000400440 &amp;lt;_start&amp;gt;:
  400440:   31 ed                   xor    %ebp,%ebp
  400442:   49 89 d1                mov    %rdx,%r9
  400445:   5e                      pop    %rsi
  400446:   48 89 e2                mov    %rsp,%rdx
  400449:   48 83 e4 f0             and    $0xfffffffffffffff0,%rsp
  40044d:   50                      push   %rax
  40044e:   54                      push   %rsp
  40044f:   49 c7 c0 d0 05 40 00    mov    $0x4005d0,%r8
  400456:   48 c7 c1 60 05 40 00    mov    $0x400560,%rcx
  40045d:   48 c7 c7 2d 05 40 00    mov    $0x40052d,%rdi
  400464:   e8 b7 ff ff ff          callq  400420 &amp;lt;__libc_start_main@plt&amp;gt;
  400469:   f4                      hlt
  40046a:   66 0f 1f 44 00 00       nopw   0x0(%rax,%rax,1)

0000000000400470 &amp;lt;deregister_tm_clones&amp;gt;:
  400470:   b8 47 10 60 00          mov    $0x601047,%eax
  400475:   55                      push   %rbp
  400476:   48 2d 40 10 60 00       sub    $0x601040,%rax
  40047c:   48 83 f8 0e             cmp    $0xe,%rax
  400480:   48 89 e5                mov    %rsp,%rbp
  400483:   77 02                   ja     400487 &amp;lt;deregister_tm_clones+0x17&amp;gt;
  400485:   5d                      pop    %rbp
  400486:   c3                      retq
  400487:   b8 00 00 00 00          mov    $0x0,%eax
  40048c:   48 85 c0                test   %rax,%rax
  40048f:   74 f4                   je     400485 &amp;lt;deregister_tm_clones+0x15&amp;gt;
  400491:   5d                      pop    %rbp
  400492:   bf 40 10 60 00          mov    $0x601040,%edi
  400497:   ff e0                   jmpq   *%rax
  400499:   0f 1f 80 00 00 00 00    nopl   0x0(%rax)

00000000004004a0 &amp;lt;register_tm_clones&amp;gt;:
  4004a0:   b8 40 10 60 00          mov    $0x601040,%eax
  4004a5:   55                      push   %rbp
  4004a6:   48 2d 40 10 60 00       sub    $0x601040,%rax
  4004ac:   48 c1 f8 03             sar    $0x3,%rax
  4004b0:   48 89 e5                mov    %rsp,%rbp
  4004b3:   48 89 c2                mov    %rax,%rdx
  4004b6:   48 c1 ea 3f             shr    $0x3f,%rdx
  4004ba:   48 01 d0                add    %rdx,%rax
  4004bd:   48 d1 f8                sar    %rax
  4004c0:   75 02                   jne    4004c4 &amp;lt;register_tm_clones+0x24&amp;gt;
  4004c2:   5d                      pop    %rbp
  4004c3:   c3                      retq
  4004c4:   ba 00 00 00 00          mov    $0x0,%edx
  4004c9:   48 85 d2                test   %rdx,%rdx
  4004cc:   74 f4                   je     4004c2 &amp;lt;register_tm_clones+0x22&amp;gt;
  4004ce:   5d                      pop    %rbp
  4004cf:   48 89 c6                mov    %rax,%rsi
  4004d2:   bf 40 10 60 00          mov    $0x601040,%edi
  4004d7:   ff e2                   jmpq   *%rdx
  4004d9:   0f 1f 80 00 00 00 00    nopl   0x0(%rax)

00000000004004e0 &amp;lt;__do_global_dtors_aux&amp;gt;:
  4004e0:   80 3d 59 0b 20 00 00    cmpb   $0x0,0x200b59(%rip)        # 601040 &amp;lt;__TMC_END__&amp;gt;
  4004e7:   75 11                   jne    4004fa &amp;lt;__do_global_dtors_aux+0x1a&amp;gt;
  4004e9:   55                      push   %rbp
  4004ea:   48 89 e5                mov    %rsp,%rbp
  4004ed:   e8 7e ff ff ff          callq  400470 &amp;lt;deregister_tm_clones&amp;gt;
  4004f2:   5d                      pop    %rbp
  4004f3:   c6 05 46 0b 20 00 01    movb   $0x1,0x200b46(%rip)        # 601040 &amp;lt;__TMC_END__&amp;gt;
  4004fa:   f3 c3                   repz retq
  4004fc:   0f 1f 40 00             nopl   0x0(%rax)

0000000000400500 &amp;lt;frame_dummy&amp;gt;:
  400500:   48 83 3d 18 09 20 00    cmpq   $0x0,0x200918(%rip)        # 600e20 &amp;lt;__JCR_END__&amp;gt;
  400507:   00
  400508:   74 1e                   je     400528 &amp;lt;frame_dummy+0x28&amp;gt;
  40050a:   b8 00 00 00 00          mov    $0x0,%eax
  40050f:   48 85 c0                test   %rax,%rax
  400512:   74 14                   je     400528 &amp;lt;frame_dummy+0x28&amp;gt;
  400514:   55                      push   %rbp
  400515:   bf 20 0e 60 00          mov    $0x600e20,%edi
  40051a:   48 89 e5                mov    %rsp,%rbp
  40051d:   ff d0                   callq  *%rax
  40051f:   5d                      pop    %rbp
  400520:   e9 7b ff ff ff          jmpq   4004a0 &amp;lt;register_tm_clones&amp;gt;
  400525:   0f 1f 00                nopl   (%rax)
  400528:   e9 73 ff ff ff          jmpq   4004a0 &amp;lt;register_tm_clones&amp;gt;

000000000040052d &amp;lt;main&amp;gt;:
  40052d:   55                      push   %rbp
  40052e:   48 89 e5                mov    %rsp,%rbp
  400531:   48 83 ec 10             sub    $0x10,%rsp
  400535:   c7 45 fc 09 00 00 00    movl   $0x9,-0x4(%rbp)
  40053c:   83 7d fc 08             cmpl   $0x8,-0x4(%rbp)
  400540:   75 0c                   jne    40054e &amp;lt;main+0x21&amp;gt;
  400542:   bf e4 05 40 00          mov    $0x4005e4,%edi
  400547:   e8 c4 fe ff ff          callq  400410 &amp;lt;puts@plt&amp;gt;
  40054c:   eb 0a                   jmp    400558 &amp;lt;main+0x2b&amp;gt;
  40054e:   bf f5 05 40 00          mov    $0x4005f5,%edi
  400553:   e8 b8 fe ff ff          callq  400410 &amp;lt;puts@plt&amp;gt;
  400558:   c9                      leaveq
  400559:   c3                      retq
  40055a:   66 0f 1f 44 00 00       nopw   0x0(%rax,%rax,1)

0000000000400560 &amp;lt;__libc_csu_init&amp;gt;:
  400560:   41 57                   push   %r15
  400562:   41 89 ff                mov    %edi,%r15d
  400565:   41 56                   push   %r14
  400567:   49 89 f6                mov    %rsi,%r14
  40056a:   41 55                   push   %r13
  40056c:   49 89 d5                mov    %rdx,%r13
  40056f:   41 54                   push   %r12
  400571:   4c 8d 25 98 08 20 00    lea    0x200898(%rip),%r12        # 600e10 &amp;lt;__frame_dummy_init_array_entry&amp;gt;
  400578:   55                      push   %rbp
  400579:   48 8d 2d 98 08 20 00    lea    0x200898(%rip),%rbp        # 600e18 &amp;lt;__init_array_end&amp;gt;
  400580:   53                      push   %rbx
  400581:   4c 29 e5                sub    %r12,%rbp
  400584:   31 db                   xor    %ebx,%ebx
  400586:   48 c1 fd 03             sar    $0x3,%rbp
  40058a:   48 83 ec 08             sub    $0x8,%rsp
  40058e:   e8 4d fe ff ff          callq  4003e0 &amp;lt;_init&amp;gt;
  400593:   48 85 ed                test   %rbp,%rbp
  400596:   74 1e                   je     4005b6 &amp;lt;__libc_csu_init+0x56&amp;gt;
  400598:   0f 1f 84 00 00 00 00    nopl   0x0(%rax,%rax,1)
  40059f:   00
  4005a0:   4c 89 ea                mov    %r13,%rdx
  4005a3:   4c 89 f6                mov    %r14,%rsi
  4005a6:   44 89 ff                mov    %r15d,%edi
  4005a9:   41 ff 14 dc             callq  *(%r12,%rbx,8)
  4005ad:   48 83 c3 01             add    $0x1,%rbx
  4005b1:   48 39 eb                cmp    %rbp,%rbx
  4005b4:   75 ea                   jne    4005a0 &amp;lt;__libc_csu_init+0x40&amp;gt;
  4005b6:   48 83 c4 08             add    $0x8,%rsp
  4005ba:   5b                      pop    %rbx
  4005bb:   5d                      pop    %rbp
  4005bc:   41 5c                   pop    %r12
  4005be:   41 5d                   pop    %r13
  4005c0:   41 5e                   pop    %r14
  4005c2:   41 5f                   pop    %r15
  4005c4:   c3                      retq
  4005c5:   66 66 2e 0f 1f 84 00    data32 nopw %cs:0x0(%rax,%rax,1)
  4005cc:   00 00 00 00

00000000004005d0 &amp;lt;__libc_csu_fini&amp;gt;:
  4005d0:   f3 c3                   repz retq

Disassembly of section .fini:

00000000004005d4 &amp;lt;_fini&amp;gt;:
  4005d4:   48 83 ec 08             sub    $0x8,%rsp
  4005d8:   48 83 c4 08             add    $0x8,%rsp
  4005dc:   c3                      retq
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;5) Let’s take a look on the block that is really important to us:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-asm&quot;&gt;000000000040052d &amp;lt;main&amp;gt;:
  40052d:    55                       push   %rbp
  40052e:    48 89 e5                 mov    %rsp,%rbp
  400531:    48 83 ec 10              sub    $0x10,%rsp
  400535:    c7 45 fc 09 00 00 00     movl   $0x9,-0x4(%rbp)
  40053c:    83 7d fc 08              cmpl   $0x8,-0x4(%rbp)
  400540:    75 0c                    jne    40054e &amp;lt;main+0x21&amp;gt;
  400542:    bf e4 05 40 00           mov    $0x4005e4,%edi
  400547:    e8 c4 fe ff ff           callq  400410 &amp;lt;puts@plt&amp;gt;
  40054c:    eb 0a                    jmp    400558 &amp;lt;main+0x2b&amp;gt;
  40054e:    bf f5 05 40 00           mov    $0x4005f5,%edi
  400553:    e8 b8 fe ff ff           callq  400410 &amp;lt;puts@plt&amp;gt;
  400558:    c9                       leaveq
  400559:    c3                       retq
  40055a:    66 0f 1f 44 00 00        nopw   0x0(%rax,%rax,1)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now, let’s zoom in at the line that defines the value 9 to our password
variable:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-asm&quot;&gt;  400535:    c7 45 fc 09 00 00 00     movl   $0x9,-0x4(%rbp)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Since we know the source code, if we change the number &lt;strong&gt;9 to
8&lt;/strong&gt; we’re gonna crack the binary. So, let’s find it opening using &lt;strong&gt;xxd&lt;/strong&gt; to
see our binary on hexadecimal format:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cat hello-world | xxd | grep &apos;fc 09&apos;&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;0000530: e548 83ec 10c7 45fc 0900 0000 837d fc08  .H....E......}..**
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There we go! We found the sequence of the hexadecimal bytes responsable
to define the number 9.&lt;/p&gt;

&lt;p&gt;So, since we know the memory address (0x530) let’s use PHP to change the value
of those bytes. But first let’s explain something:&lt;/p&gt;

&lt;p&gt;As you can see, the hexadecimal 0x530 is the address that contains 32 bytes,
but which byte do we have to set our pointer to write the new password?
To figure out which address, let’s split the 32 bytes in groups:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0000530: e548 83ec 10c7 45fc 0900 0000 837d fc08&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Byte 00 is: e5
Byte 01 is: 48
Byte 02 is: 83
Byte 03 is: ec

Byte 04 is: 10
Byte 05 is: c7
Byte 06 is: 45
Byte 07 is: fc

Byte 08 is: 09 --&amp;gt; There we go! 0x530 + 0x08 = 0x538
Byte 09 is: 00 -&amp;gt; wait.. why is this byte zero?
Byte 10 is: 00 -&amp;gt; what?
Byte 11 is: 00 -&amp;gt; wtf???
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Did you notice the sequence of zeros after 09?
Do you have an idea why? Oh well, remember that one integer in PHP have 4 bytes?
of “memory space”?  There we go my friend, let’s change 4 bytes then.&lt;/p&gt;

&lt;div class=&quot;language-php highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$fp&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;fopen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;hello-world&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;r+&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;fseek&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$fp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mh&quot;&gt;0x538&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$content&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;fread&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$fp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// echo $content;&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$unpack&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;unpack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;N*&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;foreach&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$unpack&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$byte&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// echo dechex($byte). &quot; \n&quot;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;fseek&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$fp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mh&quot;&gt;0x538&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$pack&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;pack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;N*&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mh&quot;&gt;0x8000000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;fwrite&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$fp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$pack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$unpack&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;unpack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;N*&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$pack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;foreach&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$unpack&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$byte&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// echo dechex($byte). &quot; \n&quot;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;fclose&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$fp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I added some extra code here because I was learning how to edit the file.
Basically &lt;em&gt;fseek&lt;/em&gt; sets the pointer to the address we want to change.
After that, &lt;em&gt;fwrite&lt;/em&gt; does the trick and as you can see our before and after
binary must look like this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cat hello-world | xxd | grep &apos;fc 09&apos;&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;0000530: e548 83ec 10c7 45fc 0900 0000 837d fc08  .H....E......}..**
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt;
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cat hello-world | xxd | grep &apos;fc 08&apos;&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;0000530: e548 83ec 10c7 45fc 0800 0000 837d fc08  .H....E......}..
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The final test:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./hello-world&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Congratulations
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That’s it for today. I hope you enjoyed.&lt;/p&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;

</description>
        <pubDate>Sat, 06 Feb 2016 21:07:46 -0500</pubDate>
        <link>https://rodolfo.ca/php/cracking/reverse%20engineer/crackme/2016/02/06/cracking-binary-files-using-php-and-some-linux-tools.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/php/cracking/reverse%20engineer/crackme/2016/02/06/cracking-binary-files-using-php-and-some-linux-tools.html</guid>
        
        
        <category>php</category>
        
        <category>cracking</category>
        
        <category>reverse engineer</category>
        
        <category>crackme</category>
        
      </item>
      
    
    
      <item>
        <title>How to Install MySQL Server (MariaDB) on OpenBSD</title>
        <description>&lt;p&gt;MySQL is a kind of commercial brand. So for that reason to have
this database on your OpenBSD we can simply install it using the
MariaDB ports which is way more “opensource” friendly.&lt;/p&gt;

&lt;p&gt;So let’s go!&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;doas pkg_add mariadb-server&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;quirks-2.54 signed on 2015-03-08T12:33:05Z
mariadb-server-10.0.16v0:p5-Term-ReadKey-2.30p6: ok
mariadb-server-10.0.16v0:p5-FreezeThaw-0.5001: ok
mariadb-server-10.0.16v0:p5-MLDBM-2.05: ok
mariadb-server-10.0.16v0:p5-Net-Daemon-0.48p0: ok
mariadb-server-10.0.16v0:p5-PlRPC-0.2018p2: ok
mariadb-server-10.0.16v0:p5-Params-Util-1.07p0: ok
mariadb-server-10.0.16v0:p5-Clone-0.37: ok
mariadb-server-10.0.16v0:p5-SQL-Statement-1.405: ok
mariadb-server-10.0.16v0:p5-DBI-1.633: ok
mariadb-server-10.0.16v0:p5-DBD-mysql-4.029: ok
mariadb-server-10.0.16v0: ok
The following new rcscripts were installed: /etc/rc.d/mysqld
See rcctl(8) for details.
Look in /usr/local/share/doc/pkg-readmes for extra documentation.
$
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;doas mysql_install_db&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/rc.d/mysqld start&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;doas /etc/rc.d/mysqld start&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mysqld(ok)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;doas /usr/local/bin/mysql_secure_installation&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we&apos;ll need the current
password for the root user.  If you&apos;ve just installed MariaDB, and
you haven&apos;t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
 ... Success!

Normally, root should only be allowed to connect from &apos;localhost&apos;.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
 ... Success!

By default, MariaDB comes with a database named &apos;test&apos; that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
 ... Success!

Cleaning up...

All done!  If you&apos;ve completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I created this post when I was using OpenBSD 5.7. At that time we were using 
&lt;strong&gt;sudo&lt;/strong&gt; but after the version 5.8, sudo is gone and now we need to use 
&lt;strong&gt;doas&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hope you enjoyed and thanks for the guys from #openbsd on Irc Freenode.net&lt;/p&gt;
</description>
        <pubDate>Mon, 25 Jan 2016 23:56:46 -0500</pubDate>
        <link>https://rodolfo.ca/2016/01/25/how-to-install-mysql-on-openbsd.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2016/01/25/how-to-install-mysql-on-openbsd.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Happy 0b11111100000</title>
        <description>&lt;h3 id=&quot;happy-0b11111100000&quot;&gt;Happy 0b11111100000&lt;/h3&gt;

&lt;p&gt;There we go peeps! 2015 is gone. One more year is coming and new goals are 
being set. I’m pretty glad that I had a chance to achieve some goals and pass 
over great challenges related with adaptability setting a new live on a 
foreign country.&lt;/p&gt;

&lt;p&gt;I don’t like to share my personal goals with the world but the only thing 
that I can and want to share is: I pray to God to get more knowledge every 
day. Wisdom is the most value thing to become a better person. 
I’m not talking about learning how to code in language X or get knowledge 
about a specific software, I’m talking about God’s 
lessons &lt;a href=&quot;https://www.lds.org/scriptures/ot/prov?lang=eng&quot;&gt;Proverbs - Bible&lt;/a&gt; 
that are the base to get a good Life.&lt;/p&gt;

&lt;p&gt;Of course, I want and I will get in touch with new technologies because I 
decided to follow a career that is constantly changing every day. We used to 
say in Brazil: “Shrimp that doesn’t swim the sea will engulf it”. 
That’s exactly how an IT professional feels nowadays.&lt;/p&gt;

&lt;p&gt;Happy new year and God Bless you,&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rodolfo&lt;/strong&gt;&lt;/p&gt;

</description>
        <pubDate>Thu, 31 Dec 2015 16:20:10 -0500</pubDate>
        <link>https://rodolfo.ca/2015/12/31/happy-b11111100000.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2015/12/31/happy-b11111100000.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Enabling GZIP Compression to Varnish</title>
        <description>&lt;h3 id=&quot;how-to-enable-gzip-compression-on-httpd-openbsd-and-varnish&quot;&gt;How to enable GZIP compression on httpd (OpenBSD) and Varnish?&lt;/h3&gt;

&lt;p&gt;If you want to learn how to install Varnish Cache on OpenBSD, please 
&lt;a href=&quot;/2015/12/installing-varnish-on-openbsd/&quot;&gt;click here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;When I wrote the post teaching how to install Varnish I didn’t set any special
configuration (oh well) actually I didn’t set any configuration.&lt;/p&gt;

&lt;p&gt;Well, let’s add our first useful configuration. Since it’s not possible to add
GZIP support on default OpenBSD’s webserver (httpd) we can add it using Varnish.&lt;/p&gt;

&lt;p&gt;Edit your &lt;em&gt;/etc/varnish/builtin.vcl&lt;/em&gt;:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vim /etc/varnish/builtin.vcl&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sub vcl_backend_response {
    # Enabling GZIP
    if (beresp.http.content-type ~ &quot;text&quot;) {
        set beresp.do_gzip = true;
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That’s it. It will add gzip compression on all html, css pages served by your
server.&lt;/p&gt;

&lt;p&gt;Now, we need to restart Varnish. On a Debian like Operational System, you can 
just type:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;service varnish restart&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Well, using OpenBSD it’s a little different:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd /etc/rc.d&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo ./varnishd stop&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo varnishd -f /etc/varnish/builtin.vcl&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I hope you enjoyed!&lt;/p&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Tue, 22 Dec 2015 20:57:10 -0500</pubDate>
        <link>https://rodolfo.ca/2015/12/22/enabling-gzip-compression-to-varnish.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2015/12/22/enabling-gzip-compression-to-varnish.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Installing Varnish on OpenBSD</title>
        <description>&lt;h3 id=&quot;installing-varnish-cache&quot;&gt;Installing Varnish Cache:&lt;/h3&gt;

&lt;p&gt;Want to install Varnish on OpenBSD? First let’s check our variable $PKG_PATH 
since we’re using OpenBSD ports:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;echo $PKG_PATH&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;http://openbsd.cs.toronto.edu/pub/OpenBSD/5.7/packages/amd64/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;All good! Now let’s install it running:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo pkg_add varnish&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Password:
quirks-2.54 signed on 2015-03-08T12:33:05Z
useradd: Warning: home directory `/var/varnish&apos; doesn&apos;t exist, and -m was not specified
varnish-4.0.2: ok
The following new rcscripts were installed: /etc/rc.d/varnishd
See rcctl(8) for details.
--- +varnish-4.0.2 -------------------
Varnish has a default configuration built in, however see vcl(7)
or the following link for more information:

        http://www.varnish-cache.org/wiki/VCLExamples

and for further information:

        https://www.varnish-cache.org/docs/4.0/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Since I’m using httpd as webserver on my OpenBSD (no, it’s not apache) it’s 
their own webserver. I had to change the default 80 port to 8080. 
I’m not gonna cover the binding to 8080 only for local network but you must 
think about it to avoid someone bypassing your varnish.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;block-8080-from-external-access-using-firewall&quot;&gt;Block 8080 from external access using firewall:&lt;/h3&gt;

&lt;p&gt;Let’s setup a quick
firewall rule on your Packet Filter (pf) to block all incoming traffic on port&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Let’s edit our &lt;em&gt;pf.conf&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo vim /etc/pf.conf&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And add the rule bellow:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;block in on vio0 proto tcp to port 8080
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then you need to reload your &lt;em&gt;pf&lt;/em&gt; with:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo pfctl -f /etc/pf.conf&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can verify the rules your &lt;em&gt;pf&lt;/em&gt; is using with: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo pfctl -sr&lt;/code&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;running-varnish&quot;&gt;Running Varnish:&lt;/h3&gt;

&lt;p&gt;To start your varnish, you can use the example config coming out of the box 
with varnish. The file &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/varnish/example.vcl&lt;/code&gt; doesn’t have actually 
any real rules or config. It’s a nice point of start to forward connections 
into your backend running your webserver.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo varnishd -f /etc/varnish/example.vcl&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I’m probably gonna start studying about varnish from now. Keep in touch to 
read some posts about it. If you have questions please message me. 
My contact information on &lt;a href=&quot;/about&quot;&gt;about link&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;

</description>
        <pubDate>Tue, 22 Dec 2015 19:09:58 -0500</pubDate>
        <link>https://rodolfo.ca/openbsd/varnish/2015/12/22/installing-varnish-on-openbsd.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/openbsd/varnish/2015/12/22/installing-varnish-on-openbsd.html</guid>
        
        <category>openbsd</category>
        
        <category>varnish</category>
        
        
        <category>openbsd</category>
        
        <category>varnish</category>
        
      </item>
      
    
    
      <item>
        <title>Fixing Git Error: git-remote-https.core on OpenBSD</title>
        <description>&lt;p&gt;If you type git clone and it creates a file with this name: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git-remote-https.core&lt;/code&gt; that means you need to upgrade your git or ssl. So let’s do that!&lt;/p&gt;

&lt;p&gt;First make sure you have the variable PKH_PATH with the mirror to get port files:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ echo $PKG_PATH
http://openbsd.cs.toronto.edu/pub/OpenBSD/5.7/packages/amd64/
$
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo pkg_info | grep git
git-1.9.3           GIT - Tree History Storage Tool
$
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo pkg_add git
quirks-2.54 signed on 2015-03-08T12:33:05Z
git-1.9.3-&amp;gt;2.3.0: ok
Read shared items: ok
Look in /usr/local/share/doc/pkg-readmes for extra documentation.
$
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That’s it!&lt;/p&gt;

</description>
        <pubDate>Sat, 19 Dec 2015 10:45:15 -0500</pubDate>
        <link>https://rodolfo.ca/openbsd/git/2015/12/19/fixing-git-error-git-remote-https-core-on-openbsd.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/openbsd/git/2015/12/19/fixing-git-error-git-remote-https-core-on-openbsd.html</guid>
        
        <category>openbsd</category>
        
        <category>git</category>
        
        
        <category>openbsd</category>
        
        <category>git</category>
        
      </item>
      
    
    
      <item>
        <title>How to count how many lines of code?</title>
        <description>&lt;p&gt;You just finished a project and want to know how many lines of code you wrote?
A kind of recursive search looking in all files and after all return the total.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;find . -name &apos;*.php&apos; | xargs wc -l&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;find . -name &apos;*.yml&apos; | xargs wc -l&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;find . -name &apos;*.twig&apos; | xargs wc -l&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Cheers! 
Rodolfo&lt;/p&gt;
</description>
        <pubDate>Mon, 24 Aug 2015 21:26:10 -0400</pubDate>
        <link>https://rodolfo.ca/linux/unix/2015/08/24/how-to-count-how-many-lines-of-code.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/linux/unix/2015/08/24/how-to-count-how-many-lines-of-code.html</guid>
        
        <category>linux</category>
        
        <category>unix</category>
        
        
        <category>linux</category>
        
        <category>unix</category>
        
      </item>
      
    
    
      <item>
        <title>Nice ZSH configuration for your Mac OS</title>
        <description>&lt;p&gt;#ZSH&lt;/p&gt;

&lt;p&gt;First, download this project: &lt;em&gt;oh-my-zsh&lt;/em&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Second step is download the font package. This will allow you to see special 
icons depending of the theme you’re going to use with your zsh.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git clone https://github.com/powerline/fonts.git
cd fonts
./install.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now edit your config file and restart your iTerm2&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;vim ~/.zshrc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and change the theme config:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ZSH_THEME=&quot;agnoster&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To test your theme:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;source ~/.zshrc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After that, change the icon fonts in your iTerm2 properties to user any 
Powerline Font.&lt;/p&gt;

&lt;p&gt;If you want to change the color schema:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;https://github.com/altercation/solarized/tree/master/iterm2-colors-solarized
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</description>
        <pubDate>Thu, 16 Jul 2015 19:15:10 -0400</pubDate>
        <link>https://rodolfo.ca/zsh/macos/2015/07/16/nice-zsh-configuration.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/zsh/macos/2015/07/16/nice-zsh-configuration.html</guid>
        
        <category>zsh</category>
        
        <category>macos</category>
        
        
        <category>zsh</category>
        
        <category>macos</category>
        
      </item>
      
    
    
      <item>
        <title>Configuring HAProxy with ssl and two webservers behind</title>
        <description>&lt;h3 id=&quot;loadbalancing-with-haproxy&quot;&gt;LoadBalancing with HAProxy&lt;/h3&gt;

&lt;p&gt;In this post I’ll teach you how to set up 3 ubuntu servers in order to create 
the follow architecture:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;1 LoadBalancer Server;&lt;/li&gt;
  &lt;li&gt;2 Web Application Servers;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ok, what’s load balancer? What’s the idea behind it? So, if you wanna create a 
web application the most basic idea is buy a domain name, point this domain 
name to the server IP and set up&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;global
    log /dev/log    local0
    log /dev/log    local1 notice
    chroot /var/lib/haproxy
    stats socket /run/haproxy/admin.sock mode 660 level admin
    stats timeout 30s
    user haproxy
    group haproxy
    daemon

    # Default SSL material locations
    ca-base /etc/ssl/certs
    crt-base /etc/ssl/private

    # Default ciphers to use on SSL-enabled listening sockets.
    # For more information, see ciphers(1SSL). This list is from:
    #  https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
    ssl-default-bind-ciphers EECDH+aRSA+AES:TLSv1+kRSA+AES:TLSv1+kRSA+3DES
    ssl-default-bind-options no-sslv3

defaults
    log global
    mode    http
    option  httplog
    option  dontlognull
    option forwardfor
    option http-server-close
        stats uri /haproxy?stats
        stats auth haproxy:YourPassowordHere
        timeout connect 5000
        timeout client  50000
        timeout server  50000
    errorfile 400 /etc/haproxy/errors/400.http
    errorfile 403 /etc/haproxy/errors/403.http
    errorfile 408 /etc/haproxy/errors/408.http
    errorfile 500 /etc/haproxy/errors/500.http
    errorfile 502 /etc/haproxy/errors/502.http
    errorfile 503 /etc/haproxy/errors/503.http
    errorfile 504 /etc/haproxy/errors/504.http


frontend http-in
        bind *:80
        reqadd X-Forwarded-Proto:\ http
        default_backend application-backend

frontend https-in
        bind *:443 ssl crt /etc/haproxy/sslpem/your.server.pem.file.pem
        reqadd X-Forwarded-Proto:\ https
        default_backend application-backend

backend application-backend
        redirect scheme https if !{ ssl_fc }
        balance leastconn
        option httpclose
        option forwardfor

        #enter the IP of your application here
        server SERVER-1 10.10.10.1:8080 check
        server SERVER-2 10.10.10.2:8080 check

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</description>
        <pubDate>Mon, 13 Jul 2015 16:38:55 -0400</pubDate>
        <link>https://rodolfo.ca/haproxy/linux/2015/07/13/haproxy-config-for-two-webservers.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/haproxy/linux/2015/07/13/haproxy-config-for-two-webservers.html</guid>
        
        <category>haproxy</category>
        
        <category>linux</category>
        
        
        <category>haproxy</category>
        
        <category>linux</category>
        
      </item>
      
    
    
      <item>
        <title>Getting rid of my Wordpress and start using GoHugo</title>
        <description>&lt;p&gt;Hi there! I’m pretty glad that I am finally getting rid of my wordpress and my 
old domain name. 
Since I moved
to Canada I started working fulltime as a software developer and after that I 
decided to buy a
 new domain and start again my personal website. Some days ago I worked with 
a golang geoip software and after that I found this project for blogs using 
markdown and static content. I have to agree that I’m having such a nice time 
with it. In the next days you’ll probably see new
 posts here but with the date on the past. 
I’m gonna be working migrating old stuffs to this new page.&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;
</description>
        <pubDate>Sat, 11 Jul 2015 00:42:55 -0400</pubDate>
        <link>https://rodolfo.ca/golang/general/2015/07/11/getting-rid-of-my-wordpress-and-start-using-gohugo.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/golang/general/2015/07/11/getting-rid-of-my-wordpress-and-start-using-gohugo.html</guid>
        
        <category>golang</category>
        
        <category>general</category>
        
        
        <category>golang</category>
        
        <category>general</category>
        
      </item>
      
    
    
      <item>
        <title>How to add syntax highlight for .twig on VIM?</title>
        <description>&lt;p&gt;In this simple post, I’ll teach you how to add syntax highlight for .twig on VIM. If you are working with a PHP Framework like symfony2 + vim, you probably are getting boring using .twig without any syntax highlighter right? So, follow these steps and get your twig full of colors easy:&lt;/p&gt;

&lt;p&gt;1) Download both jinja.vim and htmljinja.vim for this folder ~/.vim/syntax&lt;/p&gt;

&lt;p&gt;2) After that, add this on the bottom of your .vimrc file:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;au BufRead,BufNewFile *.twig set filetype=htmljinj
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;3) Restart your vim and you will see the .twig template much better!&lt;/p&gt;
</description>
        <pubDate>Fri, 20 Feb 2015 23:02:10 -0500</pubDate>
        <link>https://rodolfo.ca/vim/2015/02/20/how-to-add-syntax-highlight-for-twig-on-vim.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/vim/2015/02/20/how-to-add-syntax-highlight-for-twig-on-vim.html</guid>
        
        <category>vim</category>
        
        
        <category>vim</category>
        
      </item>
      
    
    
      <item>
        <title>How to install VIM on OpenBSD</title>
        <description>&lt;p&gt;As you already know, openbsd comes with VI and not VIM. Just for security purpose as well. So, let’s install VIM on OpenBSD ?&lt;/p&gt;

&lt;pre&gt;&lt;strong&gt;# echo $PKG_PATH&lt;/strong&gt;

&lt;strong&gt;#export PKG_PATH=http://ftp.openbsd.org/pub/OpenBSD/`uname -r`/packages/`arch -s`    &lt;/strong&gt;
&lt;strong&gt;#echo $PKG_PATH                                                                   &lt;/strong&gt;
http://ftp.openbsd.org/pub/OpenBSD/5.6/packages/amd64
&lt;strong&gt;#pkg_add vim&lt;/strong&gt;
quirks-2.9 signed on 2014-07-31T22:37:55Z
Ambiguous: choose package for vim
 a       0: &amp;lt;None&amp;gt;
         1: vim-7.4.135p2-gtk2
         2: vim-7.4.135p2-gtk2-perl-python-ruby
         3: vim-7.4.135p2-gtk2-perl-python3-ruby
         4: vim-7.4.135p2-no_x11
         5: vim-7.4.135p2-no_x11-perl-python-ruby
         6: vim-7.4.135p2-no_x11-perl-python3-ruby
Your choice: &lt;strong&gt;4&lt;/strong&gt;
vim-7.4.135p2-no_x11: ok
#&lt;/pre&gt;
</description>
        <pubDate>Fri, 20 Feb 2015 23:00:00 -0500</pubDate>
        <link>https://rodolfo.ca/openbsd/vim/2015/02/20/install-vim-openbsd.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/openbsd/vim/2015/02/20/install-vim-openbsd.html</guid>
        
        <category>OpenBSD</category>
        
        <category>vim</category>
        
        
        <category>OpenBSD</category>
        
        <category>vim</category>
        
      </item>
      
    
    
      <item>
        <title>Don&apos;t have enough RAM memory on server? Let&apos;s create a swapfile!</title>
        <description>&lt;p&gt;Hello!&lt;/p&gt;

&lt;p&gt;I’m running a simple instance on DigitalOcean with 512MB of RAM. So, what happens is when I try to update composer to install a new dependency on my symfony2 project, the composer got killed. Why? Well.. composer is always starving and his food is RAM memory. Yeah, it’s a ram memory destroyer. So, let’s fix this creating an extra 1GB Swapfile because we have 20GB of storage in our instance!&lt;/p&gt;

&lt;p&gt;1) Let’s check how many available space we have in our root partition / (In my case 16GB)&lt;/p&gt;

&lt;pre&gt;&lt;strong&gt;df -h&lt;/strong&gt;
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        20G  2.8G   &lt;span style=&quot;color: #ff0000;&quot;&gt;16G&lt;/span&gt;  15% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
udev            235M  4.0K  235M   1% /dev
tmpfs            50M  360K   49M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            246M     0  246M   0% /run/shm
none            100M     0  100M   0% /run/user&lt;/pre&gt;

&lt;p&gt;2) Now, let’s create an empty 1GB file on / with the name swapfile&lt;/p&gt;

&lt;pre&gt;&lt;strong&gt;sudo dd if=/dev/zero of=/swapfile bs=1M count=1024&lt;/strong&gt;
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 4.57631 s, 235 MB/s&lt;/pre&gt;

&lt;p&gt;3) If everything ran well, we have 1GB less on our / partition. Let’s verify?&lt;/p&gt;

&lt;pre&gt;&lt;strong&gt;df -h&lt;/strong&gt; 
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        20G  3.8G   &lt;span style=&quot;color: #ff0000;&quot;&gt;15G&lt;/span&gt;  21% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
udev            235M  4.0K  235M   1% /dev
tmpfs            50M  360K   49M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            246M     0  246M   0% /run/shm
none            100M     0  100M   0% /run/user&lt;/pre&gt;

&lt;p&gt;3) Yeah! Now, let’s change from a single and normal file to a swap file! And then add on /etc/fstab to make it automatically started when boot the server.&lt;/p&gt;

&lt;pre&gt;&lt;strong&gt;sudo mkswap /swapfile&lt;/strong&gt; 
Setting up swapspace version 1, size = 1048572 KiB
no label, UUID=a418b9f4-c4fc-4d8f-87ff-d924e33203cf&lt;/pre&gt;

&lt;pre&gt;&lt;strong&gt;sudo swapon /swapfile&lt;/strong&gt; 
echo &apos;echo &quot;/swapfile  none  swap  defaults  0  0&quot; &amp;gt;&amp;gt; /etc/fstab&apos; | sudo sh&lt;/pre&gt;

&lt;p&gt;4) We can confirm that we have a new swap with 1024GB:&lt;/p&gt;

&lt;pre&gt;&lt;strong&gt;free -m&lt;/strong&gt;
             total       used       free     shared    buffers     cached
Mem:           490        483          6         50          2        298
-/+ buffers/cache:        182        307
&lt;span style=&quot;color: #ff0000;&quot;&gt;Swap:         1023          0       1023&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Now we can run our &lt;strong&gt;php composer.phar update&lt;/strong&gt; with no “Killed” messages!&lt;/p&gt;

&lt;p&gt;See ya!&lt;br /&gt;
Rodolfo&lt;/p&gt;
</description>
        <pubDate>Fri, 06 Feb 2015 23:01:04 -0500</pubDate>
        <link>https://rodolfo.ca/linux/php/unix/2015/02/06/dont-have-enough-ram-memory-on-server-lets-create-a-swapfile.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/linux/php/unix/2015/02/06/dont-have-enough-ram-memory-on-server-lets-create-a-swapfile.html</guid>
        
        <category>linux</category>
        
        <category>php</category>
        
        <category>unix</category>
        
        
        <category>linux</category>
        
        <category>php</category>
        
        <category>unix</category>
        
      </item>
      
    
    
      <item>
        <title>Installing Symfony2 on OpenBSD 5.6</title>
        <description>&lt;p&gt;Hi there!&lt;/p&gt;

&lt;p&gt;Let’s install the Symfony2 on OpenBSD 5.6. If you still don’t know how to install and configure nginx + php on OpenBSD &lt;a href=&quot;http://www.rodolfobandeira.com/2015/01/31/openbsd-5-6-nginx-php-fpm/&quot; target=&quot;_blank&quot;&gt;click here &lt;/a&gt;to see my last blog post.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;First, let’s install CURL:&lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;&lt;strong&gt;$ export PKG_PATH=ftp://mirrors.nycbug.org/pub/OpenBSD/5.6/packages/`machine -a`/&lt;/strong&gt;
&lt;strong&gt;$ sudo pkg_add curl&lt;/strong&gt;
 quirks-2.9 signed on 2014-07-31T22:37:55Z
 curl-7.37.0:libidn-1.28p0: ok
 curl-7.37.0: ok&lt;/pre&gt;

&lt;ol&gt;
  &lt;li&gt;Configuring PHP CLI:&lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;&lt;strong&gt;$ cd /usr/local.bin&lt;/strong&gt;
&lt;strong&gt;$ sudo ln -s php-5.5 php&lt;/strong&gt;&lt;/pre&gt;

&lt;ol&gt;
  &lt;li&gt;Installing Composer:&lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;&lt;strong&gt;$ curl -sS https://getcomposer.org/installer | php&lt;/strong&gt;
 #!/usr/bin/env php
 Some settings on your machine make Composer unable to work properly.
 Make sure that you fix the issues listed below and run this script again:&lt;/pre&gt;

&lt;pre&gt;The allow_url_fopen setting is incorrect.
 Add the following to the end of your `php.ini`:
 allow_url_fopen = On&lt;/pre&gt;

&lt;p&gt;The php.ini used by your command-line PHP is: /etc/php-5.5.ini&lt;br /&gt;
If you can not modify the ini file, you can also run `php -d option=value` to modify ini values on the fly. You can use -d multiple times.&lt;/p&gt;

&lt;p&gt;Okay, We got this error. PHP are not allowing to use URL_FOPEN. Let’s change /etc/php-5.5.ini&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;em&gt;vi /etc/php-5.5.ini&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;allow_url_fopen = On&lt;/pre&gt;

&lt;ol&gt;
  &lt;li&gt;Downloading composer again and trying to install symfony2:&lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;sudo su
&lt;strong&gt; # sudo curl -sS https://getcomposer.org/installer | php&lt;/strong&gt;
 exit
 $ sudo php composer.phar create-project symfony/framework-standard-edition project/
 Installing symfony/framework-standard-edition (v2.6.3)
 - Installing symfony/framework-standard-edition (v2.6.3)
 Downloading: 100%
 Failed to download symfony/framework-standard-edition from dist: Could not decompress the archive, enable the PHP zip extension.
 The php.ini used by your command-line PHP is: /etc/php-5.5.ini
 Now trying to download from source
 - Installing symfony/framework-standard-edition (v2.6.3)
 Cloning 4e2519619fddc6e403f70d5c5d50a71128f01c62
 [RuntimeException]
 Failed to clone git@github.com:symfony/symfony-standard.git, git was not found, check that it is installed and in your PATH env.
 sh: git: not found&lt;/pre&gt;

&lt;ol&gt;
  &lt;li&gt;Errors, Errors, Errors. So, We need to install php zip extension and git. Let’s do it:&lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;&lt;strong&gt;$ sudo pkg_add php-zip&lt;/strong&gt;
 quirks-2.9 signed on 2014-07-31T22:37:55Z
 Ambiguous: choose package for php-zip
 a       0: &amp;lt;None&amp;gt;
 1: php-zip-5.3.28p9
 2: php-zip-5.4.30
 3: php-zip-5.5.14
 Your choice: &lt;strong&gt;3&lt;/strong&gt;
 php-zip-5.5.14: ok
 --- +php-zip-5.5.14 -------------------
 You can enable this module by creating a symbolic link from
 /etc/php-5.5.sample/zip.ini to
 /etc/php-5.5/zip.ini. As root:&lt;/pre&gt;

&lt;pre&gt;ln -sf /etc/php-5.5.sample/zip.ini /etc/php-5.5/zip.ini
&lt;strong&gt; $ sudo ln -sf /etc/php-5.5.sample/zip.ini /etc/php-5.5/zip.ini&lt;/strong&gt;
&lt;/pre&gt;

&lt;ol&gt;
  &lt;li&gt;Now, let’s install git&lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;&lt;strong&gt;$ sudo pkg_add git&lt;/strong&gt;
 quirks-2.9 signed on 2014-07-31T22:37:55Z
 |No change in quirks-2.9Ambiguous: choose dependency for git-1.9.3:
 a       0: rsync-3.1.1
 1: rsync-3.1.1-iconv
 Your choice: &lt;strong&gt;&lt;/strong&gt;
 git-1.9.3:cvsps-2.1p0: ok
 git-1.9.3:rsync-3.1.1: ok
 git-1.9.3:p5-Error-0.17019: ok
 git-1.9.3: ok
 The following new rcscripts were installed: /etc/rc.d/rsyncd
 See rc.d(8) for details.
 Look in /usr/local/share/doc/pkg-readmes for extra documentation.&lt;/pre&gt;

&lt;ol&gt;
  &lt;li&gt;Installing php-curl extension:&lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;&lt;strong&gt;$ sudo pkg_add php-curl&lt;/strong&gt;
 quirks-2.9 signed on 2014-07-31T22:37:55Z
 Ambiguous: choose package for php-curl
 a       0: &amp;lt;None&amp;gt;
 1: php-curl-5.3.28p9
 2: php-curl-5.4.30
 3: php-curl-5.5.14
 Your choice: &lt;strong&gt;3&lt;/strong&gt;
 php-curl-5.5.14: ok
 --- +php-curl-5.5.14 -------------------
 You can enable this module by creating a symbolic link from
 /etc/php-5.5.sample/curl.ini to
 /etc/php-5.5/curl.ini. As root:
ln -sf /etc/php-5.5.sample/curl.ini /etc/php-5.5/curl.ini&lt;/pre&gt;

&lt;pre&gt;&lt;strong&gt;$ sudo ln -sf /etc/php-5.5.sample/curl.ini /etc/php-5.5/curl.ini&lt;/strong&gt;&lt;/pre&gt;

&lt;pre&gt;9. Finally we&apos;re able to install symfony2!&lt;/pre&gt;

&lt;pre&gt;&lt;strong&gt;sudo php composer.phar create-project symfony/framework-standard-edition path/&lt;/strong&gt;
 Installing symfony/framework-standard-edition (v2.6.3)
 - Installing symfony/framework-standard-edition (v2.6.3)
 Loading from cache

Created project in path/
 Loading composer repositories with package information
 Installing dependencies (including require-dev)
 - Installing psr/log (1.0.0)
 Downloading: 100%
- Installing twig/twig (v1.18.0)
 Downloading: 100%
- Installing doctrine/lexer (v1.0.1)
 Downloading: 100%
- Installing doctrine/annotations (v1.2.3)
 Downloading: 100%
- Installing doctrine/collections (v1.2)
 Downloading: 100%
- Installing doctrine/cache (v1.4.0)
 Downloading: 100%
- Installing doctrine/inflector (v1.0.1)
 Downloading: 100%
- Installing doctrine/common (v2.4.2)
 Downloading: 100%
- Installing symfony/symfony (v2.6.3)
 Downloading: 100%
- Installing doctrine/dbal (v2.5.1)
 Downloading: 100%
- Installing doctrine/orm (v2.4.7)
 Downloading: 100%
- Installing doctrine/doctrine-cache-bundle (v1.0.1)
 Downloading: 100%
- Installing jdorn/sql-formatter (v1.2.17)
 Downloading: 100%
- Installing doctrine/doctrine-bundle (v1.3.0)
 Downloading: 100%
- Installing twig/extensions (v1.2.0)
 Downloading: 100%
- Installing kriswallsmith/assetic (v1.2.1)
 Downloading: 100%
- Installing symfony/assetic-bundle (v2.6.1)
 Downloading: 100%
- Installing swiftmailer/swiftmailer (v5.3.1)
 Downloading: 100%
- Installing symfony/swiftmailer-bundle (v2.3.8)
 Downloading: 100%
- Installing monolog/monolog (1.12.0)
 Downloading: 100%
- Installing symfony/monolog-bundle (v2.7.1)
 Downloading: 100%
- Installing sensiolabs/security-checker (v2.0.1)
 Downloading: 100%
- Installing sensio/distribution-bundle (v3.0.16)
 Downloading: 100%
- Installing sensio/framework-extra-bundle (v3.0.4)
 Downloading: 100%
- Installing incenteev/composer-parameter-handler (v2.1.0)
 Downloading: 100%
- Installing sensio/generator-bundle (v2.5.1)
 Downloading: 100%

kriswallsmith/assetic suggests installing leafo/lessphp (Assetic provides the integration with the lessphp LESS compiler)
 kriswallsmith/assetic suggests installing leafo/scssphp (Assetic provides the integration with the scssphp SCSS compiler)
 kriswallsmith/assetic suggests installing ptachoire/cssembed (Assetic provides the integration with phpcssembed to embed data uris)
 kriswallsmith/assetic suggests installing leafo/scssphp-compass (Assetic provides the integration with the SCSS compass plugin)
 kriswallsmith/assetic suggests installing patchwork/jsqueeze (Assetic provides the integration with the JSqueeze JavaScript compressor)
 symfony/assetic-bundle suggests installing kriswallsmith/spork (to be able to dump assets in parallel)
 monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
 monolog/monolog suggests installing raven/raven (Allow sending log messages to a Sentry server)
 monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
 monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
 monolog/monolog suggests installing videlalvaro/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
 monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
 monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
 monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
 monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
 Writing lock file
 Generating autoload files
 Would you like to install Acme demo bundle? [y/N] y
 Installing the Acme demo bundle.
 Creating the &quot;app/config/parameters.yml&quot; file
 Some parameters are missing. Please provide them.
 database_driver (pdo_sqlite):
 database_host (127.0.0.1):
 database_port (null):
 database_name (symfony):
 database_user (root):
 database_password (null):
 mailer_transport (smtp):
 mailer_host (127.0.0.1):
 mailer_user (null):
 mailer_password (null):
 locale (en):
 secret (ThisTokenIsNotSoSecretChangeIt):
 Clearing the cache for the dev environment with debug true
 Trying to install assets as symbolic links.
 Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework
 The assets were installed using symbolic links.
 Installing assets for Acme\DemoBundle into web/bundles/acmedemo
 The assets were installed using symbolic links.
 Installing assets for Sensio\Bundle\DistributionBundle into web/bundles/sensiodistribution
 The assets were installed using symbolic links.&lt;/pre&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;That’s really cool eh? Okay, now that we downloaded our symfony2 framework, let’s fix the document root on /etc/nginx/nginx.conf. Just change the &lt;strong&gt;document root&lt;/strong&gt; to be &lt;strong&gt;/var/www/htdocs/path/web&lt;/strong&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Here I decided to add my user on www group. And changed my whole htdocs directory to www group. I decided to uncomment umask(0000); in &lt;em&gt;web/app.php&lt;/em&gt;, &lt;em&gt;web/app_dev.php&lt;/em&gt; and &lt;em&gt;app/console&lt;/em&gt;. This is necessary because OpenBSD doesn’t have setfacl.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;This is my &lt;em&gt;nginx.conf&lt;/em&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;worker_processes  1;
worker_rlimit_nofile 1024;
events {
    worker_connections  800;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    index         index.php index.html index.htm app.php;
    keepalive_timeout  65;
    server_tokens off;

    server {
        listen       80;
        listen       [::]:80;
        server_name  ule.php-br.org; 
        root         /var/www/htdocs/path/web;

        location = /50x.html {
            root  /var/www/htdocs/path/web;
        }

        location / {
            try_files $uri /app.php$is_args$args;
        }

    location ~ ^/(app_dev|config)\.php(/|$) {
        fastcgi_pass   unix:run/php-fpm.sock;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param HTTPS off;
    }


        location ~ ^/app\.php(/|$) {
            fastcgi_pass   unix:run/php-fpm.sock;
            fastcgi_split_path_info ^(.+\.php)(/.*)$;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param HTTPS off;
            internal;
        }

        location ~ \.php$ {
            try_files      $uri $uri/ =404;
            fastcgi_pass   unix:run/php-fpm.sock;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
    }
}&lt;/pre&gt;

&lt;ol&gt;
  &lt;li&gt;That’s it! Just restart your php_fpm and your nginx and test it!&lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;sudo /etc/rc.d/php_fpm restart
sudo /etc/rc.d/nginx -f restart&lt;/pre&gt;
</description>
        <pubDate>Wed, 04 Feb 2015 21:13:14 -0500</pubDate>
        <link>https://rodolfo.ca/nginx/openbsd/php/symfony/2015/02/04/installing-symfony2-on-openbsd-5-6.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/nginx/openbsd/php/symfony/2015/02/04/installing-symfony2-on-openbsd-5-6.html</guid>
        
        <category>nginx</category>
        
        <category>openbsd</category>
        
        <category>php</category>
        
        <category>symfony</category>
        
        
        <category>nginx</category>
        
        <category>openbsd</category>
        
        <category>php</category>
        
        <category>symfony</category>
        
      </item>
      
    
    
      <item>
        <title>OpenBSD 5.6 + NginX + PHP-FPM</title>
        <description>&lt;p&gt;Hi there!&lt;/p&gt;

&lt;p&gt;Today I’m gonna teach you how to set up a OpenBSD 5.6 + Nginx + PHP-FPM webserver.. Probably you guys heard about DigitalOcean are now dropping FreeBSD instances on their servers. So.. I’m a big fan from OpenBSD since at least 10 years and decided to look for a Cloud SSD host that you can create and run your OpenBSD. I did a search in twitter with words: “digitalocean openbsd” and found more bsd fans like me bringing this amazing host: http://vultr.com&lt;/p&gt;

&lt;p&gt;So, what’s the main difference between Vultr over DigitalOcean? In Vultr you can put any .iso and they will provide a console window based on VNC. So, you can install any iso. And.. that’s really cool! Sweet! I’m gonna write a specific post about how to install OpenBSD on vultr.com but today let’s set up a webserver!&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;First of all, let’s &lt;a href=&quot;http://www.openbsd.org/ftp.html#ftp&quot; target=&quot;_blank&quot;&gt;grab a FTP mirror&lt;/a&gt; close to you or close to your server. In my case, I’m running a server on New York City and that’s my ftp mirror:&lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;ftp://mirrors.nycbug.org/pub/OpenBSD/&lt;/pre&gt;

&lt;ol&gt;
  &lt;li&gt;We need to set up the pkg_path. (I’m not running as root. Single user ok? $)&lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;&lt;b&gt;export PKG_PATH=ftp://mirrors.nycbug.org/pub/OpenBSD/5.6/packages/`machine -a`/&lt;/b&gt;&lt;/pre&gt;

&lt;ol&gt;
  &lt;li&gt;Let’s install php-fpm!&lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;sudo pkg_add php-fpm&lt;/pre&gt;

&lt;pre&gt;quirks-2.9 signed on 2014-07-31T22:37:55Z
quirks-2.9: ok
Ambiguous: choose package for php-fpm
 a       0: &amp;lt;None&amp;gt;
         1: php-fpm-5.3.28p9
         2: php-fpm-5.4.30
         3: php-fpm-5.5.14&lt;/pre&gt;

&lt;ol&gt;
  &lt;li&gt;Of course we’re going to install the newest version. It will ask to you about the PHP version we’re going to install:&lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;Ambiguous: choose dependency for php-fpm-5.5.14: 
 a       0: php-5.5.14p0
         1: php-5.5.14p0-ap2
Your choice: 0&lt;/pre&gt;

&lt;ol&gt;
  &lt;li&gt;Now let’s see the Package Management download and install:&lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;php-fpm-5.5.14:libiconv-1.14p1: ok
php-fpm-5.5.14:gettext-0.19.1p0 (installing)|***************************************                                                  | 44%debug2: channel 0: window 999041 sent adjust 49535
php-fpm-5.5.14:gettext-0.19.1p0: ok
php-fpm-5.5.14:femail-0.98: ok
php-fpm-5.5.14:femail-chroot-0.98p2: ok
php-fpm-5.5.14:libxml-2.9.1p1: ok
php-fpm-5.5.14:php-5.5.14p0: ok
php-fpm-5.5.14: ok
The following new rcscripts were installed: /etc/rc.d/php_fpm
See rc.d(8) for details.
Look in /usr/local/share/doc/pkg-readmes for extra documentation.
--- +php-5.5.14p0 -------------------
To enable the php-5.5 module please create a symbolic link from
/var/www/conf/modules.sample/php-5.5.conf to
/var/www/conf/modules/php.conf. As root:

    ln -sf /var/www/conf/modules.sample/php-5.5.conf /var/www/conf/modules/php.conf

The recommended php configuration has been installed to:
    /etc/php-5.5.ini.&lt;/pre&gt;

&lt;ol&gt;
  &lt;li&gt;Let’s start php-fpm:&lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;sudo /etc/rc.d/php_fpm start
php_fpm(ok)&lt;/pre&gt;

&lt;ol&gt;
  &lt;li&gt;Configuring nginx! Hey.. What? Aren’t we going to install nginx? No ma friend.. Apache was killed by openbsd team and now Nginx become part of the base install. Cool eh? So, just open using “vi” of couse, not vim because OpenBSD guys doesn’t trust in vim in default installation. So, let’s use vi&lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;sudo vi /etc/nginx/nginx.conf&lt;/pre&gt;

&lt;ol&gt;
  &lt;li&gt;This is a example that what you have to change in &lt;strong&gt;/etc/nginx/nginx.conf&lt;/strong&gt; to make this guy working well:&lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;worker_processes  1;

worker_rlimit_nofile 1024;
events {
    worker_connections  800;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    index         index.php index.html index.htm;
    keepalive_timeout  65;
    server_tokens off;

    server {
        listen       80;
        listen       [::]:80;
        server_name  localhost;
        root         /var/www/htdocs;
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root  /var/www/htdocs;
        }
        location ~ \.php$ {
            try_files      $uri $uri/ =404;
            fastcgi_pass   unix:run/php-fpm.sock;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
    }
}

&lt;/pre&gt;

&lt;ol&gt;
  &lt;li&gt;Let’s restart our nginx:&lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;sudo /etc/rc.d/nginx -f restart&lt;/pre&gt;

&lt;ol&gt;
  &lt;li&gt;Testing!&lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;sudo vi /var/www/htdocs/index.php&lt;/pre&gt;

&lt;ol&gt;
  &lt;li&gt;And add this:&lt;/li&gt;
&lt;/ol&gt;

&lt;pre&gt;&amp;lt;?php
phpinfo();&lt;/pre&gt;

&lt;ol&gt;
  &lt;li&gt;Test using your public ip, and you’ll see the phpinfo page!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you get any problems feel free to contact me!&lt;br /&gt;
Thanks!&lt;/p&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Sat, 31 Jan 2015 22:04:28 -0500</pubDate>
        <link>https://rodolfo.ca/nginx/openbsd/php-fpm/vultr/2015/01/31/openbsd-5-6-nginx-php-fpm.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/nginx/openbsd/php-fpm/vultr/2015/01/31/openbsd-5-6-nginx-php-fpm.html</guid>
        
        <category>nginx</category>
        
        <category>openbsd</category>
        
        <category>php-fpm</category>
        
        <category>vultr</category>
        
        
        <category>nginx</category>
        
        <category>openbsd</category>
        
        <category>php-fpm</category>
        
        <category>vultr</category>
        
      </item>
      
    
    
      <item>
        <title>Happy 0b11111011111 folks!</title>
        <description>&lt;p&gt;2015 is here! I’m almost completing 6 month living in Canada and.. yeah, I can’t complain! Yesterday we had too much food in our fridge and the beers wasn’t getting cold enough.. so.. I put the beers outside on the balcony. Just 5 minutes getting -8 Celsius and they get perfect! People say here that last year the winter was wild. So.. by now we can say.. “Not bad..”&lt;/p&gt;

&lt;p&gt;My professional career is doing great! I always hear some people saying that when they arrived in Canada, some of them had to work in different kind of jobs just to get Canadian experience and improve the language.. So I must say that God are blessing me and my wife with good jobs and knowledge every day. I think that working only with software everyday is awesome. And I can’t complain about the years that I spent working with TV and Telecommunication Engineering.. I got a lot of differentiate knowledge that some of my colleagues doesn’t have.&lt;/p&gt;

&lt;p&gt;2015 Goals? I believe that keep on mind that we need to change it’s not enough, we have to do our best to get our dreams realized. Yes I have some goals for this new year but some of them still need a better English. By now I’ll study to get IT certifications and keep trying to be a good &lt;span id=&quot;result_box&quot; class=&quot;&quot; lang=&quot;en&quot;&gt;&lt;span class=&quot;hps&quot;&gt;person to&lt;/span&gt; &lt;span class=&quot;hps&quot;&gt;be&lt;/span&gt; &lt;span class=&quot;hps&quot;&gt;worthy of&lt;/span&gt; &lt;span class=&quot;hps&quot;&gt;more&lt;/span&gt; &lt;span class=&quot;hps&quot;&gt;blessings from God.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Happy new b11111011111 folks!&lt;/p&gt;
</description>
        <pubDate>Thu, 01 Jan 2015 17:14:28 -0500</pubDate>
        <link>https://rodolfo.ca/just-think/2015/01/01/happy-b11111011111-folks.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/just-think/2015/01/01/happy-b11111011111-folks.html</guid>
        
        <category>just-think</category>
        
        
        <category>just-think</category>
        
      </item>
      
    
    
      <item>
        <title>Gets your server&apos;s public IP Address</title>
        <description>&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ip addr show eth0 | grep inet | awk &apos;{ print $2; }&apos; | sed &apos;s/\/.*$//&apos;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Tue, 30 Dec 2014 23:23:14 -0500</pubDate>
        <link>https://rodolfo.ca/linux/unix/2014/12/30/gets-your-servers-public-ip-address.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/linux/unix/2014/12/30/gets-your-servers-public-ip-address.html</guid>
        
        <category>linux</category>
        
        <category>unix</category>
        
        
        <category>linux</category>
        
        <category>unix</category>
        
      </item>
      
    
    
      <item>
        <title>How to force phpstorm to use Java JDK 1.7 on MacOS</title>
        <description>&lt;p&gt;&lt;a href=&quot;http://www.rodolfobandeira.com/wp-content/uploads/2014/11/Screen-Shot-2014-11-13-at-6.53.59-PM.png&quot;&gt;&lt;img class=&quot;aligncenter size-full wp-image-930&quot; src=&quot;http://www.rodolfobandeira.com/wp-content/uploads/2014/11/Screen-Shot-2014-11-13-at-6.53.59-PM.png&quot; alt=&quot;Screen Shot 2014-11-13 at 6.53.59 PM&quot; width=&quot;487&quot; height=&quot;215&quot; /&gt;&lt;/a&gt;{.thumbnail}&lt;/p&gt;

&lt;p&gt;I decided today to install PhpStorm in my computer at home. So, I found this freaking message. “To open “PhpStorm” you need to install the legacy Java SE 6 runtime.”&lt;/p&gt;

&lt;p&gt;Let’s teach you what I did. Just edit this file:&lt;/p&gt;

&lt;pre&gt;/Application/PhpStorm.app/Contents/Info.plist&lt;/pre&gt;

&lt;p&gt;On this line, change to use JVM 1.7.&lt;/p&gt;

&lt;pre&gt; 87       &amp;lt;key&amp;gt;JVMVersion&amp;lt;/key&amp;gt;                                                                                                       
 88       &amp;lt;string&amp;gt;1.7*&amp;lt;/string&amp;gt;&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;That’s it!&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

</description>
        <pubDate>Wed, 12 Nov 2014 23:23:14 -0500</pubDate>
        <link>https://rodolfo.ca/apple/mac%20osx/php/2014/11/12/how-to-force-phpstorm-to-use-java-jdk-1-7-on-macos.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/apple/mac%20osx/php/2014/11/12/how-to-force-phpstorm-to-use-java-jdk-1-7-on-macos.html</guid>
        
        <category>apple</category>
        
        <category>mac osx</category>
        
        <category>php</category>
        
        
        <category>apple</category>
        
        <category>mac osx</category>
        
        <category>php</category>
        
      </item>
      
    
    
      <item>
        <title>ln -s</title>
        <description>&lt;p&gt;Just heads up for you guys.. I always forgot how to create symbolic link, so.. now it’s immortalized  on my blog.. well.. at least until I keep paying for this hosting service..&lt;/p&gt;

&lt;pre&gt;ln -s /old/directory/with/the/big/path .&lt;/pre&gt;
</description>
        <pubDate>Thu, 06 Nov 2014 19:12:04 -0500</pubDate>
        <link>https://rodolfo.ca/linux/unix/2014/11/06/ln-s.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/linux/unix/2014/11/06/ln-s.html</guid>
        
        <category>linux</category>
        
        <category>unix</category>
        
        
        <category>linux</category>
        
        <category>unix</category>
        
      </item>
      
    
    
      <item>
        <title>How to install xdebug in Amazon AWS Ubuntu Server</title>
        <description>&lt;pre&gt;sudo apt-get install php5-xdebug&lt;/pre&gt;

&lt;pre&gt;sudo service apache2 restart&lt;/pre&gt;

&lt;p&gt;Now just create a simple phpinfo(); file and check if xdebug is there.&lt;/p&gt;
</description>
        <pubDate>Sat, 11 Oct 2014 22:11:02 -0400</pubDate>
        <link>https://rodolfo.ca/2014/10/11/how-to-install-xdebug-in-amazon-aws-ubuntu-server.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/10/11/how-to-install-xdebug-in-amazon-aws-ubuntu-server.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to encrypt and decrypt a file using pgp and some public key</title>
        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Do you need to send some encrypted file to anyone that you know that has a public pgp key? If you aren’t sure if this person has or not a public key, you can search for the last valid key here:&lt;/p&gt;

&lt;p&gt;&lt;a title=&quot;https://pgp.mit.edu/&quot; href=&quot;https://pgp.mit.edu/&quot; target=&quot;_blank&quot;&gt;https://pgp.mit.edu/&lt;/a&gt;&lt;/p&gt;

&lt;pre&gt;pgp -e -r email-of-the-person@example.org your-file-to-encrypt.txt&lt;/pre&gt;

&lt;p&gt;pgp will create a new encrypted file in the same directory with the extension .pgp concatenated.&lt;/p&gt;

&lt;pre&gt;your-file-to-encrypt.txt.pgp&lt;/pre&gt;

&lt;p&gt;Okay! Encrypted!&lt;br /&gt;
Now, I’m gonna teach you how to make the reverse way, yeah, how to decrypt this file with your private key and your master password. If the person lost the private key, its impossible to open this file. If its lost, the person must to create a new private and public key again.&lt;/p&gt;

&lt;p&gt;Make sure that you have your private key imported to your local gpg. To see if your private key is there, just type:&lt;/p&gt;

&lt;pre&gt;pgp --list-keys&lt;/pre&gt;

&lt;p&gt;And than, you can decrypt your file using this:&lt;/p&gt;

&lt;pre&gt;pgp --output file-decrypted.txt --decrypt your-file-to-encrypt.txt.pgp&lt;/pre&gt;

&lt;p&gt;You’ll gonna be asked about the password. If you don’t remember, just breath and try again. &lt;img src=&quot;http://www.rodolfobandeira.com/wp-includes/images/smilies/simple-smile.png&quot; alt=&quot;:)&quot; class=&quot;wp-smiley&quot; style=&quot;height: 1em; max-height: 1em;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Sources:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a title=&quot;http://linuxaria.com/howto/how-to-easily-encrypt-a-file-with-gpg-on-linux&quot; href=&quot;http://linuxaria.com/howto/how-to-easily-encrypt-a-file-with-gpg-on-linux&quot; target=&quot;_blank&quot;&gt;http://linuxaria.com/howto/how-to-easily-encrypt-a-file-with-gpg-on-linux&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a title=&quot;http://www.linuxquestions.org/questions/linux-security-4/decrypt-pgp-file-using-gpg-and-passphrase-907409/&quot; href=&quot;http://www.linuxquestions.org/questions/linux-security-4/decrypt-pgp-file-using-gpg-and-passphrase-907409/&quot; target=&quot;_blank&quot;&gt;http://www.linuxquestions.org/questions/linux-security-4/decrypt-pgp-file-using-gpg-and-passphrase-907409/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Wed, 08 Oct 2014 19:02:03 -0400</pubDate>
        <link>https://rodolfo.ca/2014/10/08/how-to-encrypt-and-decrypt-a-file-using-pgp-and-some-public-key.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/10/08/how-to-encrypt-and-decrypt-a-file-using-pgp-and-some-public-key.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Search on all php files, replace some string asking confirmation and exclude some directory from this search</title>
        <description>&lt;p&gt;Using Unix command line interface, how to search on all php files, replace some string asking confirmation and exclude some directory from this search?&lt;/p&gt;

&lt;pre class=&quot;brush: bash;&quot;&gt;find . -name &quot;*.php&quot; ! -path &quot;./DIRECTORY_TO_EXCLUDE/*&quot; -exec vim -c &apos;%s/YOUR_OLD_STRING/YOUR_NEW_STRING/gc&apos; -c &apos;w!&apos; -c &apos;q&apos; &apos;{}&apos; \;&lt;/pre&gt;
</description>
        <pubDate>Mon, 15 Sep 2014 23:19:53 -0400</pubDate>
        <link>https://rodolfo.ca/2014/09/15/search-on-all-php-files-replace-some-string-asking-confirmation-and-exclude-some-directory-from-this-search.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/09/15/search-on-all-php-files-replace-some-string-asking-confirmation-and-exclude-some-directory-from-this-search.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Creating a command line translator on Ubuntu</title>
        <description>&lt;p&gt;&lt;code&gt;&amp;lt;pre&amp;gt;#!/bin/sh
echo &quot;en: $1&quot;
espeak -v en $1
echo &quot;pt: &quot; $1 | translate-bin -t pt -f en -s google | cut -d &apos;&amp;gt;&apos; -f2
&amp;lt;/pre&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;At first you have to install libtranslate-bin and espeak with the follow command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo apt-get install libtranslate-bin espeak&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and then you have to create e simple file that I decide to call ‘en’ with the commands bellow:&lt;/p&gt;

&lt;p&gt;I created two files. ‘en’ and ‘pt’. One to translate from English and other to transLate from Brazilian Portuguese.&lt;/p&gt;

&lt;p&gt;Before you use, you have to set the execution chmod for this file:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;chmod +x en&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After this, you can put this in your personal path.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd ~
mkdir bin
mv en bin&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To reload your .profile and activate your path, you just type this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;. ~/.profile&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now you can test your script!&lt;/p&gt;

&lt;p&gt;&lt;code&gt;en &apos;the book is on the table&apos; 
&lt;/code&gt;&lt;/p&gt;
</description>
        <pubDate>Sat, 30 Aug 2014 23:15:20 -0400</pubDate>
        <link>https://rodolfo.ca/2014/08/30/creating-a-command-line-translator-on-ubuntu.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/08/30/creating-a-command-line-translator-on-ubuntu.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Show your git branch on your bash$ line</title>
        <description>&lt;p&gt;How to show my branch on my command line interface? Here you can find a simple example that I’m using on my Ubuntu Desktop computer. The first thing that you have to do is edit your .bashrc file. It is located on your home folder. Just type:&lt;/p&gt;

&lt;pre&gt;cd ~&lt;/pre&gt;

&lt;p&gt;And than, you can edit your file just using your favorite editor. I’m using vim. Here are some tips to edit your file using vim if you haven’t used before:&lt;/p&gt;

&lt;pre&gt;vim .bashrc
ESC + i   (That&apos;s enable the insert mode)
ESC + x  (That&apos;s save and quit from vim)&lt;/pre&gt;

&lt;p&gt;Edit your .bashrc and put this in the end of the file:``&lt;/p&gt;

&lt;pre&gt;# http://blog.blakesimpson.co.uk/read/29-show-git-branch-and-directory-in-your-shell
GIT_PS1_SHOWDIRTYSTATE=false
export PS1=&apos;\[\033[1;36m\]\u at\[\033[00m\] \[\033[34m\]\W\[\033[31m\]$(&quot;__git_ps1&quot;)\[\033[00m\] &amp;gt; &apos;&lt;/pre&gt;

&lt;p&gt;Just save and reload your configuration.&lt;/p&gt;

&lt;pre&gt;sudo sh .bashrc&lt;/pre&gt;

&lt;p&gt;Hope you enjoy!  I’m gonna create a post about git soon. A lot of tips! Stay tuned!&lt;/p&gt;
</description>
        <pubDate>Sat, 30 Aug 2014 19:15:23 -0400</pubDate>
        <link>https://rodolfo.ca/2014/08/30/show-branch-of-git-on-your-bash-line.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/08/30/show-branch-of-git-on-your-bash-line.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to load multiple classes in just one instance using PHP 5</title>
        <description>&lt;p&gt;As you already know, PHP like other languages just accept simple inheritance and not multiple inheritance. Today at work I had to create a class that saw three other classes and return all methods in just one instance. Actually what I really wanted was wrap all these three classes in just one. So, I had to figure out how to create a kind of multiple inheritance using PHP 5.&lt;/p&gt;

&lt;p style=&quot;text-align: center;&quot;&gt;
  &lt;strong&gt;Dependency Injection&lt;/strong&gt;
&lt;/p&gt;

&lt;p&gt;Look at this simple example below. We have some classes with a specific method each. The last class will access all methods and make it accessible using just one instance. We’re kind of simulating something like “class C extends A,B”&lt;/p&gt;

&lt;p&gt;Here we can demonstrate the concept with a simple, yet naive example.&lt;/p&gt;

&lt;pre class=&quot;brush:php&quot;&gt;&amp;lt;?php

class A {
    public function test_a() { 
        echo &quot;test_a! \n&quot;; 
    }
}

class B {
    public function test_b() { 
        echo &quot;test_b! \n&quot;; 
    }
}

class MyFinalClass {
    // Passing class through the constructor method 
    // is called Dependency Injection
    public function __construct(A $myA, B $myB) {
        $this-&amp;gt;a = $myA;
        $this-&amp;gt;b = $myB;
    }
    public function test_a(){
        return $this-&amp;gt;a-&amp;gt;test_a();
    }
    public function test_b(){
        return $this-&amp;gt;b-&amp;gt;test_b();
    }
}

$final_instance = new MyFinalClass(new A, new B);
$final_instance-&amp;gt;test_b();
$final_instance-&amp;gt;test_a();

?&amp;gt;&lt;/pre&gt;
</description>
        <pubDate>Fri, 08 Aug 2014 00:12:44 -0400</pubDate>
        <link>https://rodolfo.ca/2014/08/08/how-to-load-multiple-classes-in-just-one-instance-using-php-5.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/08/08/how-to-load-multiple-classes-in-just-one-instance-using-php-5.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to send an email when execute a crontab task</title>
        <description>&lt;p&gt;Would like to send an email when your crontab task has executed?&lt;/p&gt;

&lt;p&gt;Let’s edit your crontab just typing:&lt;/p&gt;

&lt;pre&gt;crontab -e&lt;/pre&gt;

&lt;p&gt;In your first line just put these parameters. Remember if you are using VI, you have to use “ESC + i” to activate insert mode:&lt;/p&gt;

&lt;pre&gt;MAILTO=&quot;your_email_here@your_server.com&quot;
59 10 * * * echo test&lt;/pre&gt;

&lt;p&gt;These commands will execute on 10:59am and is gonna print just test on background shell. Just for test our email. Of course that you have to be your sendmail activated on your server.&lt;/p&gt;

&lt;p&gt;To save using VI, just type: “ESC + x”&lt;/p&gt;

&lt;p&gt;To check if this commands are saved just type:&lt;/p&gt;

&lt;pre&gt;crontab -l&lt;/pre&gt;

&lt;p&gt;That’s it!&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;
</description>
        <pubDate>Tue, 03 Jun 2014 23:01:03 -0400</pubDate>
        <link>https://rodolfo.ca/2014/06/03/how-to-send-an-email-when-execute-a-crontab-task.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/06/03/how-to-send-an-email-when-execute-a-crontab-task.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to install Ruby on Rails on Ubuntu 14.04</title>
        <description>&lt;p&gt;Hey guys! I was using the Amazon AWS Ubuntu 64 bits with t1.micro instance when I wrote this post.&lt;/p&gt;

&lt;pre&gt;sudo apt-get update
 sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties&lt;/pre&gt;

&lt;pre&gt;sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
 curl -L https://get.rvm.io | bash -s stable
 source ~/.rvm/scripts/rvm
 echo &quot;source ~/.rvm/scripts/rvm&quot; &amp;gt;&amp;gt; ~/.bashrc
 rvm install 2.1.2
 rvm use 2.1.2 --default
 ruby -v&lt;/pre&gt;

&lt;pre&gt;echo &quot;gem: --no-ri --no-rdoc&quot; &amp;gt; ~/.gemrc&lt;/pre&gt;

&lt;pre&gt;sudo add-apt-repository ppa:chris-lea/node.js
 sudo apt-get update
 sudo apt-get install nodejs&lt;/pre&gt;

&lt;pre&gt;gem install rails
 rbenv rehash
 rails -v&lt;/pre&gt;
</description>
        <pubDate>Fri, 30 May 2014 21:11:45 -0400</pubDate>
        <link>https://rodolfo.ca/2014/05/30/how-to-install-ruby-on-rails-on-ubuntu-14-04.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/05/30/how-to-install-ruby-on-rails-on-ubuntu-14-04.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to install Ruby on Rails on CentOS Linux</title>
        <description>&lt;p&gt;Hi everyone! Let’s install ruby on rails on CentOS 6.5? You can execute all these commands as root on your terminal or just put sudo after each command. I chose to use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&apos;sudo -s&apos;&lt;/code&gt; and log as root.&lt;/p&gt;

&lt;pre&gt;yum install ruby&lt;/pre&gt;

&lt;p&gt;…&lt;/p&gt;

&lt;pre&gt;Total download size: 2.3 M
Installed size: 7.8 M
Is this ok [y/N]: y
&lt;/pre&gt;

&lt;p&gt;…&lt;br /&gt;
Complete!&lt;/p&gt;

&lt;p&gt;Then we need to install some dependancies:&lt;/p&gt;

&lt;pre&gt;yum install gcc g++ make automake autoconf curl-devel openssl-devel zlib-devel httpd-devel apr-devel apr-util-devel sqlite-devel&lt;/pre&gt;

&lt;p&gt;…&lt;/p&gt;

&lt;pre&gt;Total download size: 9.5 M
Installed size: 35 M
Is this ok [y/N]:
...&lt;/pre&gt;

&lt;pre&gt;yum install ruby-rdoc ruby-devel&lt;/pre&gt;

&lt;p&gt;…&lt;/p&gt;

&lt;pre&gt;Total download size: 997 k
Installed size: 3.4 M
Is this ok [y/N]:&lt;/pre&gt;

&lt;p&gt;…&lt;br /&gt;
The second step is to install Ruby Gems&lt;/p&gt;

&lt;pre&gt;yum install rubygems&lt;/pre&gt;

&lt;p&gt;…&lt;/p&gt;

&lt;pre&gt;Total download size: 206 k
Installed size: 711 k
Is this ok [y/N]:
&lt;/pre&gt;

&lt;p&gt;Step Three — Install Rails:&lt;/p&gt;

&lt;pre&gt;gem update
Updating installed gems
Nothing to update
&lt;/pre&gt;

&lt;p&gt;…&lt;/p&gt;

&lt;pre&gt;gem update --system
RubyGems installed the following executables:
/usr/bin/gem
&lt;/pre&gt;

&lt;p&gt;…&lt;/p&gt;

&lt;pre&gt;gem install rails

Fetching: thread_safe-0.3.3.gem (100%)
Successfully installed thread_safe-0.3.3
Fetching: minitest-5.3.4.gem (100%)
Successfully installed minitest-5.3.4
Fetching: tzinfo-1.1.0.gem (100%)
Successfully installed tzinfo-1.1.0
Fetching: json-1.8.1.gem (100%)
Building native extensions.  This could take a while...
Successfully installed json-1.8.1
Fetching: i18n-0.6.9.gem (100%)
Successfully installed i18n-0.6.9
Fetching: activesupport-4.1.1.gem (100%)
ERROR:  Error installing rails:
        activesupport requires Ruby version &amp;gt;= 1.9.3.
&lt;/pre&gt;

&lt;p&gt;Dam.. Our first error!&lt;/p&gt;

&lt;pre&gt;yum groupinstall -y development
&lt;/pre&gt;

&lt;pre&gt;curl -L get.rvm.io | bash -s stable
&lt;/pre&gt;

&lt;pre&gt;source /etc/profile.d/rvm.sh
&lt;/pre&gt;

&lt;pre&gt;ruby --version
&lt;/pre&gt;

&lt;p&gt;Now that we have our ruby version updated, let’s try again:&lt;/p&gt;

&lt;pre&gt;gem install rails
&lt;/pre&gt;

&lt;p&gt;This process may take a while, be patient with it! Sometimes you can think the installation just fail, but its installing!&lt;/p&gt;

&lt;p&gt;Lets make a hello world example:&lt;/p&gt;

&lt;pre&gt;mkdir /tmp/test;cd /tmp/test
rails new blog
cd blog
rails server
&lt;/pre&gt;

&lt;p&gt;And now, we got other error:&lt;/p&gt;

&lt;pre&gt;rails server
/usr/local/rvm/gems/ruby-2.1.0/gems/execjs-2.0.2/lib/execjs/runtimes.rb:51:in `autodetect&apos;: Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
&lt;/pre&gt;

&lt;p&gt;We solve it putting in my GemFile the follow lines:&lt;/p&gt;

&lt;pre class=&quot;lang-rb prettyprint prettyprinted&quot;&gt;gem &apos;execjs&apos;
gem &apos;therubyracer&apos;, :platforms =&amp;gt;:ruby
&lt;/pre&gt;

&lt;p&gt;Ant then,&lt;/p&gt;

&lt;pre&gt;bundle install&lt;/pre&gt;

&lt;p&gt;Let’s try again: rails server Its working! Just test in default port 3000. http://localhost:3000/&lt;/p&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;

&lt;p&gt;References:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-centos-6&quot; target=&quot;_blank&quot;&gt;https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-centos-6&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/9202324/execjs-could-not-find-a-javascript-runtime-but-execjs-and-therubyracer-are-in&quot; target=&quot;_blank&quot;&gt;http://stackoverflow.com/questions/9202324/execjs-could-not-find-a-javascript-runtime-but-execjs-and-therubyracer-are-in&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://guides.rubyonrails.org/getting_started.html&quot; target=&quot;_blank&quot;&gt;http://guides.rubyonrails.org/getting_started.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Thu, 22 May 2014 00:44:21 -0400</pubDate>
        <link>https://rodolfo.ca/2014/05/22/how-to-install-ruby-on-rails-on-centos-linux.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/05/22/how-to-install-ruby-on-rails-on-centos-linux.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Amazon EC2 Ubuntu - How to run SSHD in multiple ports. 22, 8888</title>
        <description>&lt;p&gt;Hi!&lt;/p&gt;

&lt;p&gt;Do you have a firewall in your company that blocks the port 22? Do you want to put your amazon ec2 ubuntu server running in more than one port? For instance 22 and 8888? Just follow this steps and get what you want!&lt;/p&gt;

&lt;pre&gt;sudo -s&lt;/pre&gt;

&lt;pre&gt;vim /etc/ssh/sshd_config&lt;/pre&gt;

&lt;p&gt;Add after this line: Port 22 more one line. Port 8888&lt;/p&gt;

&lt;pre&gt;Port 22
 Port 8888&lt;/pre&gt;

&lt;pre&gt;root@ip-172-xx-xx-x:/tmp# service ssh reload
 root@ip-172-xx-xx-x:/tmp# netstat -tan |grep LISTEN |grep -v 127.0.0.1 | sort
 tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
 tcp        0      0 0.0.0.0:8888            0.0.0.0:*               LISTEN
 tcp6       0      0 :::22                   :::*                    LISTEN
 tcp6       0      0 :::80                   :::*                    LISTEN
 tcp6       0      0 :::8888                 :::*                    LISTEN
 root@ip-172-xx-xx-x:/tmp#&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;
</description>
        <pubDate>Fri, 16 May 2014 23:04:28 -0400</pubDate>
        <link>https://rodolfo.ca/ec2/ubuntu/linux/2014/05/16/amazon-ec2-ubuntu-how-to-run-sshd-in-multiple-ports-22-8888.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/ec2/ubuntu/linux/2014/05/16/amazon-ec2-ubuntu-how-to-run-sshd-in-multiple-ports-22-8888.html</guid>
        
        <category>ec2</category>
        
        <category>ubuntu</category>
        
        <category>linux</category>
        
        
        <category>ec2</category>
        
        <category>ubuntu</category>
        
        <category>linux</category>
        
      </item>
      
    
    
      <item>
        <title>Just testing the new OpenBSD 5.5</title>
        <description>&lt;p style=&quot;text-align: center;&quot;&gt;
  &lt;a class=&quot;thumbnail&quot; href=&quot;http://www.rodolfobandeira.com/wp-content/uploads/2014/05/Screen-Shot-2014-05-01-at-4.57.17-PM.png&quot;&gt;&lt;img class=&quot;aligncenter size-full wp-image-798&quot; src=&quot;http://www.rodolfobandeira.com/wp-content/uploads/2014/05/Screen-Shot-2014-05-01-at-4.57.17-PM.png&quot; alt=&quot;Screen Shot 2014-05-01 at 4.57.17 PM&quot; width=&quot;722&quot; height=&quot;444&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;
</description>
        <pubDate>Fri, 02 May 2014 00:55:42 -0400</pubDate>
        <link>https://rodolfo.ca/2014/05/02/just-testing-the-new-openbsd-5-5.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/05/02/just-testing-the-new-openbsd-5-5.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to clear all rules in your iptables?</title>
        <description>&lt;p&gt;Do you want to clear all rules in your firewall? Just use this shellscript:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;#!/bin/sh
echo &quot;Stopping firewall and allowing everyone...&quot;
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Cheers,
Rodolfo&lt;/p&gt;

</description>
        <pubDate>Wed, 30 Apr 2014 00:58:21 -0400</pubDate>
        <link>https://rodolfo.ca/2014/04/30/how-to-clear-all-rules-in-your-iptables.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/04/30/how-to-clear-all-rules-in-your-iptables.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to disable email alert level 2 in OSSEC HIDS</title>
        <description>&lt;pre&gt;&quot;Received From: srvcob-&amp;gt;/var/log/messages
Rule: 1002 fired (level 2) -&amp;gt; &quot;Unknown problem somewhere in the system.&quot;&lt;/pre&gt;

&lt;p&gt;My server are sending a lot of level 2 alert emails.  It’s so boring and in my point of view it’s completely unnecessary. So, how to disable it?&lt;/p&gt;

&lt;p&gt;Go to&lt;/p&gt;

&lt;pre&gt;/var/ossec/rules&lt;/pre&gt;

&lt;p&gt;and then, edit this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;syslogd_rules.xml&lt;/strong&gt; and comment this line:&lt;/p&gt;

&lt;pre&gt;  &amp;lt;rule id=&quot;1002&quot; level=&quot;2&quot;&amp;gt;
    &amp;lt;match&amp;gt;$BAD_WORDS&amp;lt;/match&amp;gt;
&amp;lt;!--    &amp;lt;options&amp;gt;alert_by_email&amp;lt;/options&amp;gt; --&amp;gt;
    &amp;lt;description&amp;gt;Unknown problem somewhere in the system.&amp;lt;/description&amp;gt;
  &amp;lt;/rule&amp;gt;

&lt;/pre&gt;

&lt;p&gt;To restart the OSSEC service type:&lt;/p&gt;

&lt;pre&gt;/var/ossec/bin/ossec-control stop&lt;/pre&gt;

&lt;pre&gt;/var/ossec/bin/ossec-control start&lt;/pre&gt;
</description>
        <pubDate>Wed, 30 Apr 2014 00:49:21 -0400</pubDate>
        <link>https://rodolfo.ca/2014/04/30/how-to-disable-email-alert-level-2-in-ossec-hids.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/04/30/how-to-disable-email-alert-level-2-in-ossec-hids.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to block facebook to access your website using IPTABLES</title>
        <description>&lt;p&gt;Hey!&lt;/p&gt;

&lt;p&gt;Today I was seeing my facebook’s timeline and I read this news: “&lt;a href=&quot;http://chr13.com/2014/04/20/using-facebook-notes-to-ddos-any-website/&quot; target=&quot;_blank&quot;&gt;Using Facebook Notes to DDoS any website&lt;/a&gt;” from chr13 website. It’s a ridiculous bug that facebook has. It consists in you just put an image from your target website in your facebook’s note.&lt;/p&gt;

&lt;p&gt;Instead of facebook read the image and storage the md5 checksum from this file, it just ignores it when you put for example image.jpg?number=1, image.jpg?number=2, image.jpg?number=3. And belive, facebook’s servers is gonna download the files wherever you request.&lt;/p&gt;

&lt;p&gt;So.. what’s the solution while facebook doesn’t fix it?&lt;/p&gt;

&lt;p&gt;You can put the ip ranges from facebook servers in your iptables using -drop or -reject directive.&lt;/p&gt;

&lt;p&gt;How to obtain the facebook’s server list? Just use the follow command and then use iptables to block every ip in the list:&lt;/p&gt;

&lt;p class=&quot;prettyprint prettyprinted&quot;&gt;
  &lt;code&gt;&amp;lt;span class=&quot;pln&quot;&amp;gt;whois &amp;lt;/span&amp;gt;&amp;lt;span class=&quot;pun&quot;&amp;gt;-&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;pln&quot;&amp;gt;h whois&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;pun&quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;pln&quot;&amp;gt;radb&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;pun&quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;pln&quot;&amp;gt;net &amp;lt;/span&amp;gt;&amp;lt;span class=&quot;pun&quot;&amp;gt;--&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;str&quot;&amp;gt;&apos;-i origin AS32934&apos;&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;pun&quot;&amp;gt;|&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;pln&quot;&amp;gt; grep &amp;lt;/span&amp;gt;&amp;lt;span class=&quot;pun&quot;&amp;gt;^&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;pln&quot;&amp;gt;route&amp;lt;/span&amp;gt;&lt;/code&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iptables -A INPUT -s &amp;lt;span style=&quot;color: #ff0000;&quot;&amp;gt;IP_HERE&amp;lt;/span&amp;gt; -j DROP&lt;/code&gt;&lt;/p&gt;

&lt;p class=&quot;prettyprint prettyprinted&quot;&gt;
  References:
&lt;/p&gt;

&lt;p class=&quot;prettyprint prettyprinted&quot;&gt;
  https://developers.facebook.com/docs/ApplicationSecurity/
&lt;/p&gt;

&lt;p class=&quot;prettyprint prettyprinted&quot;&gt;
  http://www.cyberciti.biz/faq/how-do-i-block-an-ip-on-my-linux-server/
&lt;/p&gt;

&lt;p class=&quot;prettyprint prettyprinted&quot;&gt;
  http://chr13.com/2014/04/20/using-facebook-notes-to-ddos-any-website/
&lt;/p&gt;

&lt;p class=&quot;prettyprint prettyprinted&quot;&gt;
&lt;/p&gt;
</description>
        <pubDate>Sat, 26 Apr 2014 23:32:01 -0400</pubDate>
        <link>https://rodolfo.ca/2014/04/26/how-to-block-facebook-to-access-your-website-using-iptables.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/04/26/how-to-block-facebook-to-access-your-website-using-iptables.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to use CONCAT() in MySQL with NULL values</title>
        <description>&lt;p&gt;Do you want to use CONCAT with NULL fields in MySQL?
If you just use CONCAT with some null field, you’ll get a null concatenated field.&lt;/p&gt;

&lt;p&gt;Just use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;IFNULL()&lt;/code&gt; in MySQL.&lt;/p&gt;

&lt;p&gt;CONCAT(IFNULL(NAME_A,”), IFNULL(NAME_B,”)) as NEW_NAME&lt;/p&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Fri, 25 Apr 2014 00:48:02 -0400</pubDate>
        <link>https://rodolfo.ca/2014/04/25/how-to-use-concat-in-mysql-with-null-values.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/04/25/how-to-use-concat-in-mysql-with-null-values.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Hashtag regex formatter in PHP</title>
        <description>&lt;p&gt;Hey!&lt;/p&gt;

&lt;p&gt;I have a personal url bookmarks online. I’m not going to tell you what’s the url because it’s personal.
Even using password in this page, I’m not going o tell you. 😛&lt;/p&gt;

&lt;p&gt;Let’s know how to create a regex detector and formatter for hashtags?&lt;/p&gt;

&lt;p&gt;Let’s use CSS from bootstrap 2.3:&lt;/p&gt;

&lt;div class=&quot;language-css highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;.label&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;3px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.label&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.badge&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#333333&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#FFFFFF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;inline-block&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;11.844px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;bold&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;14px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;4px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;text-shadow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;-1px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.25&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;vertical-align&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;baseline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;white-space&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;nowrap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.label-inverse&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.badge-inverse&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#333333&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And here is our PHP code:&lt;/p&gt;

&lt;div class=&quot;language-php highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$string&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Please, format all my hashtags. #rodolfo, #rodolfo-bandeira, #testing&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$hashtag_formater&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;preg_replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/(#[a-zA-Z-_]+)/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                   &lt;span class=&quot;s2&quot;&gt;&quot;&amp;lt;span class=&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;label label-inverse&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;gt;$1&amp;lt;/span&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                   &lt;span class=&quot;nv&quot;&gt;$string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$hashtag_formater&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Sat, 19 Apr 2014 00:02:39 -0400</pubDate>
        <link>https://rodolfo.ca/2014/04/19/hashtag-regex-formatter-in-php.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/04/19/hashtag-regex-formatter-in-php.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>StartCom StartSSL in Firefox error sec_error_unknown_issuer</title>
        <description>&lt;p&gt;Hi everyone!&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;sec_error_unknown_issuer&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;If you’re getting this error in your firefox with a valid ssl certificate, you should put something use the follow instructions to fix it:&lt;/p&gt;

&lt;p&gt;From: https://www.startssl.com/?app=21&lt;/p&gt;

&lt;p&gt;“First of all you have to load the mod_ssl module. Many distributions and packages have this module shipped by default, otherwise check the documentation of Apache how to do this.&lt;/p&gt;

&lt;p&gt;To configure a default SSL/TLS aware virtual server, you should add at least the following lines to your httpd.conf or ssl.conf file:&lt;/p&gt;

&lt;blockquote dir=&quot;ltr&quot;&gt;
  &lt;p&gt;
    LoadModule ssl_module modules/mod_ssl.so
  &lt;/p&gt;
  
  &lt;p&gt;
    Listen 443
  &lt;/p&gt;
  
  &lt;p&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt; DocumentRoot /home/httpd/private&lt;br /&gt; ErrorLog /usr/local/apache/logs/error_log&lt;br /&gt; TransferLog /usr/local/apache/logs/access_log&lt;br /&gt; SSLEngine on&lt;br /&gt; SSLProtocol all -SSLv2&lt;br /&gt; SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM
  &lt;/p&gt;
  
  &lt;p&gt;
    SSLCertificateFile /usr/local/apache/conf/ssl.crt&lt;br /&gt; SSLCertificateKeyFile /usr/local/apache/conf/ssl.key&lt;br /&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;   SSLCertificateChainFile /usr/local/apache/conf/sub.class1.server.ca.pem&lt;/span&gt;&lt;br /&gt; CustomLog /usr/local/apache/logs/ssl_request_log \&lt;br /&gt; &amp;#8220;%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \&amp;#8221;%r\&amp;#8221; %b&amp;#8221;&lt;br /&gt; &amp;lt;/VirtualHost&amp;gt;
  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;Download the &lt;a href=&quot;http://www.startssl.com/certs/ca.pem&quot;&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;ca.pem&lt;/span&gt;&lt;/a&gt; and &lt;a href=&quot;http://www.startssl.com/certs/sub.class1.server.ca.pem&quot;&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;sub.class1.server.ca.pem&lt;/span&gt;&lt;/a&gt; for the above configuration. Make sure to change the path according to your apache installation. For windows you need to use something like &lt;i&gt;c:\apache\httpd&lt;/i&gt;.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;If you have a higher validated server certificate you need to use the &lt;em&gt;class2&lt;/em&gt; or &lt;em&gt;class3&lt;/em&gt; intermediate CA certificate.”&lt;/p&gt;
</description>
        <pubDate>Thu, 03 Apr 2014 12:41:23 -0400</pubDate>
        <link>https://rodolfo.ca/2014/04/03/startcom-startssl-in-firefox-error-sec_error_unknown_issuer.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/04/03/startcom-startssl-in-firefox-error-sec_error_unknown_issuer.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>OSSEC notifications and Listen ports</title>
        <description>&lt;p&gt;Day after day, I’m getting happier with The OSSEC HIDS.&lt;/p&gt;

&lt;p&gt;I started a new virtualhost configuration in my Apache Server to listen in multiple ports. 8001 in this case. Let’s check out what e-mail message OSSEC sent to me. It shows the listen status ports before and after.&lt;/p&gt;

&lt;pre&gt;OSSEC HIDS Notification.
2014 Mar 13 13:02:13

Received From: srvcob-&amp;gt;netstat -tan |grep LISTEN |grep -v 127.0.0.1 | sort
Rule: 533 fired (level 7) -&amp;gt; &quot;Listened ports status (netstat) changed (new port opened or closed).&quot;
Portion of the log(s):

ossec: output: &apos;netstat -tan |grep LISTEN |grep -v 127.0.0.1 | sort&apos;:
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:38873               0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:5672                0.0.0.0:*                   LISTEN      
tcp        0      0 :::111                      :::*                        LISTEN      
tcp        0      0 :::22                       :::*                        LISTEN      
tcp        0      0 :::41383                    :::*                        LISTEN      
tcp        0      0 :::443                      :::*                        LISTEN      
tcp        0      0 :::8001                     :::*                        LISTEN      
tcp        0      0 :::80                       :::*                        LISTEN      
Previous output:
ossec: output: &apos;netstat -tan |grep LISTEN |grep -v 127.0.0.1 | sort&apos;:
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:38873               0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:5672                0.0.0.0:*                   LISTEN      
tcp        0      0 :::111                      :::*                        LISTEN&lt;/pre&gt;
</description>
        <pubDate>Mon, 17 Mar 2014 12:20:10 -0400</pubDate>
        <link>https://rodolfo.ca/2014/03/17/ossec-notifications-listen-ports.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/03/17/ossec-notifications-listen-ports.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Is your php code returning 500 Internal Server Error instead of PHP erros page?</title>
        <description>&lt;p&gt;Is your php code returning 500 Internal Server Error instead of PHP erros page?&lt;/p&gt;

&lt;p&gt;Lets try this header in the first lines of your .php page:&lt;/p&gt;

&lt;pre&gt;&amp;lt;?php

error_reporting(E_ALL);
ini_set(&apos;error_reporting&apos;, E_ALL);
ini_set(&apos;display_errors&apos;, 1); 
ini_set(&apos;display_startup_errors&apos;, 1);

?&amp;gt;&lt;/pre&gt;

&lt;p&gt;You can also edit your&lt;/p&gt;

&lt;pre&gt;/etc/php.ini&lt;/pre&gt;

&lt;p&gt;with this parameters to make this settings permanent.&lt;/p&gt;
</description>
        <pubDate>Mon, 17 Mar 2014 05:13:44 -0400</pubDate>
        <link>https://rodolfo.ca/2014/03/17/is-your-php-code-returning-500-internal-server-error-instead-of-php-erros-page.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/03/17/is-your-php-code-returning-500-internal-server-error-instead-of-php-erros-page.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to remove UTF-8 BOM characters in your NuSoap + PHP</title>
        <description>&lt;p&gt;I was working with webservices using PHP yesterday and I got some strange characters in my WSDL page.&lt;/p&gt;

&lt;p&gt;These characters are: ï»¿&lt;/p&gt;

&lt;p&gt;From Wikipedia: (&lt;a href=&quot;http://en.wikipedia.org/wiki/Byte_order_mark&quot; target=&quot;_blank&quot;&gt;http://en.wikipedia.org/wiki/Byte_order_mark&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;“The &lt;strong&gt;byte order mark&lt;/strong&gt; (&lt;strong&gt;BOM&lt;/strong&gt;) is a &lt;a href=&quot;http://en.wikipedia.org/wiki/Unicode&quot; title=&quot;Unicode&quot;&gt;Unicode&lt;/a&gt; character used to signal the &lt;a href=&quot;http://en.wikipedia.org/wiki/Endianness&quot; title=&quot;Endianness&quot;&gt;endianness&lt;/a&gt; (byte order) of a text file or stream. It is encoded at U+FEFF byte order mark (BOM). BOM use is optional, and, if used, should appear at the start of the text stream. Beyond its specific use as a byte-order indicator, the BOM character may also indicate which of the several Unicode representations the text is encoded in.”&lt;/p&gt;

&lt;pre&gt;ï»¿&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&lt;/pre&gt;

&lt;p&gt;After a hardly time wasted working on it, I finally found the solution. Two things:&lt;/p&gt;

&lt;pre&gt;$server-&amp;gt;soap_defencoding = &apos;UTF-8&apos;;
$server-&amp;gt;decode_utf8 = false;
$server-&amp;gt;encode_utf8 = true;&lt;/pre&gt;

&lt;p&gt;I also tryed to change the defaultcharset encoding in my php.ini and httpd.conf. But it didnt’t work so well.&lt;/p&gt;

&lt;p&gt;The really solution was change the charset of my config.php&lt;/p&gt;

&lt;pre&gt;require_once(&quot;config.php&quot;);&lt;/pre&gt;

&lt;p&gt;Can you belive? It killed all my worries.&lt;/p&gt;

</description>
        <pubDate>Wed, 12 Mar 2014 15:23:03 -0400</pubDate>
        <link>https://rodolfo.ca/2014/03/12/how-to-remove-utf-8-bom-characters-in-your-nusoap-php.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/03/12/how-to-remove-utf-8-bom-characters-in-your-nusoap-php.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Using iconv to change character encoding in Linux</title>
        <description>&lt;p&gt;You can use “iconv” to convert file encoding&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;iconv -f old-encoding -t new-encoding file.txt &amp;gt; newfile.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To check all kind of encodings:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;iconv -l | grep UTF
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Fri, 07 Mar 2014 11:32:12 -0500</pubDate>
        <link>https://rodolfo.ca/2014/03/07/using-iconv-to-change-character-encoding-in-linux.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/03/07/using-iconv-to-change-character-encoding-in-linux.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Too many simultaneous connections in your linux? How to check?</title>
        <description>&lt;p&gt;How to see how many active connections in my linux server?&lt;/p&gt;

&lt;pre&gt;[root@myserver rodolfo]# netstat -an | grep -c EST
&lt;strong&gt;12&lt;/strong&gt;
[root@myserver rodolfo]#&lt;/pre&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Thu, 06 Mar 2014 04:15:21 -0500</pubDate>
        <link>https://rodolfo.ca/2014/03/06/too-many-simultaneous-connections-in-your-linux-how-to-check.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/03/06/too-many-simultaneous-connections-in-your-linux-how-to-check.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Welcome to Symfony Framework</title>
        <description>&lt;p&gt;In this post I will describe my experience installing the Symfony PHP Framework on CentOS Linux Server&lt;/p&gt;

&lt;p&gt;At first, download the Symfony in: &lt;a href=&quot;http://symfony.com/download&quot; target=&quot;_blank&quot;&gt;http://symfony.com/download&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I decided for this one: (&lt;a href=&quot;http://symfony.com/download?v=Symfony_Standard_Vendors_2.4.2.tgz&quot; target=&quot;_blank&quot;&gt;http://symfony.com/download?v=Symfony_Standard_Vendors_2.4.2.tgz&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;wget http://symfony.com/download?v=Symfony_Standard_Vendors_2.4.2.tgz&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you are familiar with Composer 2, you can download Composer and then run the following command instead of downloading the archive. Its a good option to use it because it downloads all dependencies of symfony: (&lt;a href=&quot;https://getcomposer.org/download/&quot; target=&quot;_blank&quot;&gt;https://getcomposer.org/download/&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Installing using CURL:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;curl -sS https://getcomposer.org/installer | php&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Extracting the .tgz in my PUBLIC_HTML directory, we can test using this url:&lt;/p&gt;

&lt;p&gt;http://YourWebSite/Symfony/web/app_dev.php&lt;/p&gt;

&lt;p&gt;I got this message:** “ClassNotFoundException: Attempted to load class “DOMDocument” from the global namespace in” **&lt;/p&gt;

&lt;p&gt;The solution I found in StackOverflow: (&lt;a href=&quot;http://stackoverflow.com/questions/21918356/symfony-app-dev-php-install-domdomain-error&quot; target=&quot;_blank&quot;&gt;http://stackoverflow.com/questions/21918356/symfony-app-dev-php-install-domdomain-error&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;This message was showing because my server doesn’t have DOM extensions. I solve it just typing:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo yum install php-xml&amp;lt;br /&amp;gt;
sudo service httpd restart&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After installing php-xml, I got other error message:  &lt;strong&gt;“ContextErrorException: Warning: date_default_timezone_get(): It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Etc/GMT+3′ for ‘GMT+3/-3.0/no DST’ instead in”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I found the solution in StackOverflow: (&lt;a href=&quot;http://stackoverflow.com/questions/20483830/symfony2-on-ubuntu-contexterror-default-timezome&quot; target=&quot;_blank&quot;&gt;http://stackoverflow.com/questions/20483830/symfony2-on-ubuntu-contexterror-default-timezome&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo vim php.ini&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And edit this line:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;date.timezone = America/Sao_Paulo&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can find all timezone areas in this website: (&lt;a href=&quot;http://br1.php.net/manual/en/timezones.php&quot; target=&quot;_blank&quot;&gt;http://br1.php.net/manual/en/timezones.php&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo httpd restart&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you are using Ubuntu running on Amazon AWS EC2, you have to change the policy of your /var/www/html folder. Some exceptions is gonna happen if you don’t put your ubuntu user to www-data group and change the html folder to www-data group.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo usermod -a -G www-data ubuntu&amp;lt;br /&amp;gt;
groups ubuntu&amp;lt;br /&amp;gt;
sudo chgrp -hR /var/www/html www-data&amp;lt;br /&amp;gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Yeah! It’s working! I have to agree I didn’t like of the installation problems. I hope codding with Symfony is gonna worth something!&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;thumbnail aligncenter size-medium wp-image-736&quot; src=&quot;http://www.rodolfobandeira.com/wp-content/uploads/2014/03/MySymfony2-300x259.png&quot; alt=&quot;MySymfony2&quot; width=&quot;300&quot; height=&quot;259&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Thu, 06 Mar 2014 02:12:21 -0500</pubDate>
        <link>https://rodolfo.ca/2014/03/06/wellcome-to-symfony-framework.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/03/06/wellcome-to-symfony-framework.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to create a .zip file in Linux</title>
        <description>&lt;p&gt;Hey guys what’s up?&lt;br /&gt;
How to create a .zip file in your linux? From a folder and all these sub files?&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bash-3.2$ zip -9 -y -r -q YOUR_FILE.zip FOLDER_TO_ZIP/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Sun, 23 Feb 2014 11:31:25 -0500</pubDate>
        <link>https://rodolfo.ca/2014/02/23/how-to-create-a-zip-file-in-linux.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/02/23/how-to-create-a-zip-file-in-linux.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Examples using Date and SimpleDateFormat in Java</title>
        <description>&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Test {

	public static void main(String[] args) throws ParseException 
	{	
		// Converting Date to String
		SimpleDateFormat df = new SimpleDateFormat(&quot;dd/MM/yyyy&quot;);
		Date d = new Date();
		String date = df.format(d); 
		System.out.println(date);  // 23/02/2014
		
		// Converting String to Date
        SimpleDateFormat df2 = new SimpleDateFormat(&quot;dd-MM-yyyy hh:mm:ss&quot;);
        String dateInString = &quot;23-02-2014 10:20:56&quot;;
        Date date2 = df2.parse(dateInString);
        System.out.println(date2); // Sun Feb 23 10:20:56 BRT 2014	
        
        // Getting the current DateTime
    	SimpleDateFormat df3 = new SimpleDateFormat(&quot;yyyy/MM/dd HH:mm:ss&quot;);
    	Date date3 = new Date();
    	System.out.println(df3.format(date3)); // 2014/02/23 22:21:14
    	
	}
}

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Sun, 23 Feb 2014 11:31:25 -0500</pubDate>
        <link>https://rodolfo.ca/2014/02/23/examples-using-date-and-calendar-in-java.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/02/23/examples-using-date-and-calendar-in-java.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Error: Cannot load from mysql.proc. The table is probably corrupted</title>
        <description>&lt;p&gt;Today I had this problem when I updated the mysql version from 5.1 to 5.5 in CentOS.&lt;/p&gt;

&lt;p&gt;I fixed this problem by typing:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo mysql_upgrade -uroot -p
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Thu, 20 Feb 2014 04:11:24 -0500</pubDate>
        <link>https://rodolfo.ca/2014/02/20/error-cannot-load-from-mysql-proc-the-table-is-probably-corrupted.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/02/20/error-cannot-load-from-mysql-proc-the-table-is-probably-corrupted.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Installing OSSEC HIDS in CentOS</title>
        <description>&lt;p&gt;From the OSSEC HIDS website: [http://www.ossec.net/][1]&lt;/p&gt;

&lt;p&gt;&lt;em&gt;“OSSEC is an Open Source Host-based Intrusion Detection System that performs log analysis, file integrity checking, policy monitoring, rootkit detection, real-time alerting and active response.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;It runs on [most operating systems][2], including Linux, MacOS, Solaris, HP-UX, AIX and Windows.”&lt;/em&gt;&lt;/p&gt;

&lt;pre&gt;wget http://www.ossec.net/files/ossec-hids-2.7.1.tar.gz
tar -xzvf ossec-hids-2.7.1.tar.gz
cd ossec-hids-2.7.1
./install.sh&lt;/pre&gt;

&lt;p&gt;By now, you have to read and answer all questions in installation. It’s easy. In the end of installation, you will receive all informations about how to configure, how to start OSSEC HIDS and how to stop.&lt;/p&gt;

&lt;pre&gt;/var/ossec/bin/ossec-control start
/var/ossec/bin/ossec-control stop
/var/ossec/etc/ossec.conf&lt;/pre&gt;

&lt;p&gt;This is my first e-mail notification that I’ve received:&lt;/p&gt;

&lt;pre&gt;OSSEC HIDS Notification.
2014 Feb 20 17:03:18

Received From: srvcob-&amp;gt;ossec-monitord
Rule: 502 fired (level 3) -&amp;gt; &quot;Ossec server started.&quot;
Portion of the log(s):

ossec: Ossec started.

 --END OF NOTIFICATION&lt;/pre&gt;

&lt;p&gt;[http://ossec.net/ossec-docs/OSSEC-book-Ch02_SA240.pdf]&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.ossec.net/&quot;&gt;http://www.ossec.net/&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Thu, 20 Feb 2014 03:12:22 -0500</pubDate>
        <link>https://rodolfo.ca/2014/02/20/installing-ossec-hids-in-centos.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/02/20/installing-ossec-hids-in-centos.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to delete an user in CentOS Linux</title>
        <description>&lt;p&gt;The procedure to delete a user on CentOS is here:&lt;/p&gt;

&lt;p&gt;You can use -r flag to remove user and the user’s directory as well&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo userdel -r newuser
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Thu, 20 Feb 2014 03:12:22 -0500</pubDate>
        <link>https://rodolfo.ca/2014/02/20/how-to-delete-an-user-in-centos-linux.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/02/20/how-to-delete-an-user-in-centos-linux.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to use the grep command in linux using recursive mode</title>
        <description>&lt;p&gt;If you want to search a file with a specific string inside it, just use this command line in your linux terminal:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;grep -rl &quot;string&quot; /path&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Wed, 19 Feb 2014 01:05:21 -0500</pubDate>
        <link>https://rodolfo.ca/2014/02/19/how-to-use-the-grep-command-in-linux-using-recursive-mode.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/02/19/how-to-use-the-grep-command-in-linux-using-recursive-mode.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to install snmpwalk in CentOS</title>
        <description>&lt;p&gt;Wanna use snmpwalk to call snmp informations in your network?&lt;/p&gt;

&lt;p&gt;Just type:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo yum install net-snmp-utils
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Tue, 18 Feb 2014 20:28:55 -0500</pubDate>
        <link>https://rodolfo.ca/2014/02/18/how-to-install-snmpwalk-in-centos.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/02/18/how-to-install-snmpwalk-in-centos.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to clear all iptables rules</title>
        <description>&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;#!/bin/sh
echo &quot;Stopping firewall and allowing everyone...&quot;
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Mon, 17 Feb 2014 11:01:23 -0500</pubDate>
        <link>https://rodolfo.ca/2014/02/17/how-to-clear-all-iptables-rules.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/02/17/how-to-clear-all-iptables-rules.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to use crontab in CentOS Linux</title>
        <description>&lt;p&gt;If you want to automate tasks in CentOS, you must to edit /etc/crontab like the user you want to run your application.&lt;/p&gt;

&lt;p&gt;Let’s see what we have in default /etc/crontab:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be 
#
#For instance, if you want to run a mysql.sh file every day, just use this:
# This like executes mysql.sh every 12:45pm, 6:45pm, 2:45am every 
45 12,18,02 * * * /root/mysql.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is mysql.sh file:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[root@srvcob ~]# cat mysql.sh
#!/bin/bash
# Simple script to backup MySQL databases

# Parent backup directory
backup_parent_dir=&quot;/var/backups/mysql&quot;

# MySQL settings
mysql_user=&quot;USER&quot;
mysql_password=&quot;PASSWORD&quot;
mysql_host=&quot;HOSTNAME&quot;

# Read MySQL password from stdin if empty
if [ -z &quot;${mysql_password}&quot; ]; then
 echo -n &quot;Enter MySQL ${mysql_user} password: &quot;
 read -s mysql_password
 echo
fi

# Check MySQL password
echo exit | mysql -h ${mysql_host} --user=${mysql_user} --password=${mysql_password} -B 2&amp;amp;gt;/dev/null
if [ &quot;$?&quot; -gt 0 ]; then
 echo &quot;MySQL ${mysql_user} password incorrect&quot;
 exit 1
else
 echo &quot;MySQL ${mysql_user} password correct.&quot;
fi

# Create backup directory and set permissions
backup_date=`date +%Y_%m_%d_%H_%M`
backup_dir=&quot;${backup_parent_dir}/${backup_date}&quot;
echo &quot;Backup directory: ${backup_dir}&quot;
mkdir -p &quot;${backup_dir}&quot;
chmod 700 &quot;${backup_dir}&quot;

# Get MySQL databases
mysql_databases=`echo &apos;show databases&apos; | mysql -h ${mysql_host} --user=${mysql_user} --password=${mysql_password} -B | sed /^Database$/d`

# Backup and compress each database
for database in $mysql_databases
do
 if [ &quot;${database}&quot; == &quot;information_schema&quot; ] || [ &quot;${database}&quot; == &quot;performance_schema&quot; ]; then
 additional_mysqldump_params=&quot;--skip-lock-tables&quot;
 else
 additional_mysqldump_params=&quot;&quot;
 fi
 echo &quot;Creating backup of \&quot;${database}\&quot; database&quot;
 mysqldump ${additional_mysqldump_params} -h ${mysql_host} --user=${mysql_user} --password=${mysql_password} ${database} | gzip &amp;amp;gt; &quot;${backup_dir}/${database}.gz&quot;
 chmod 600 &quot;${backup_dir}/${database}.gz&quot;
done
[root@srvcob ~]#
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Mon, 17 Feb 2014 10:21:04 -0500</pubDate>
        <link>https://rodolfo.ca/2014/02/17/how-to-use-crontab-in-centos-linux.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/02/17/how-to-use-crontab-in-centos-linux.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to enable federated engine in MySQL</title>
        <description>&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[root@server etc]#mysql -h localhost -u root -p

Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.52 Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type &apos;help;&apos; or &apos;\h&apos; for help. Type &apos;\c&apos; to clear the current input statement.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mysql&amp;gt; show engines;
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| Engine     | Support | Comment                                                    | Transactions | XA   | Savepoints |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| MRG_MYISAM | YES     | Collection of identical MyISAM tables                      | NO           | NO   | NO         |
| CSV        | YES     | CSV storage engine                                         | NO           | NO   | NO         |
| MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance     | NO           | NO   | NO         |
| InnoDB     | YES     | Supports transactions, row-level locking, and foreign keys | YES          | YES  | YES        |
| MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables  | NO           | NO   | NO         |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
5 rows in set (0.00 sec)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mysql&amp;gt;install plugin federated soname &apos;ha_federated.so&apos;;
Query OK, 0 rows affected, 1 warning (0.01 sec)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mysql&amp;gt; show engines;
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| Engine     | Support | Comment                                                    | Transactions | XA   | Savepoints |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| &amp;lt;span style=&quot;color: #0000ff;&quot;&amp;gt;FEDERATED  | NO      | Federated MySQL storage engine                             | NULL         | NULL | NULL       |&amp;lt;/span&amp;gt;
| CSV        | YES     | CSV storage engine                                         | NO           | NO   | NO         |
| MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance     | NO           | NO   | NO         |
| InnoDB     | YES     | Supports transactions, row-level locking, and foreign keys | YES          | YES  | YES        |
| MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables  | NO           | NO   | NO         |
| MRG_MYISAM | YES     | Collection of identical MyISAM tables                      | NO           | NO   | NO         |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
6 rows in set (0.00 sec)

mysql&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then, edit your /etc/my.cnf and put the word federated in [mysqld] sector:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    user=mysql
    # Disabling symbolic-links is recommended to prevent assorted security risks
    symbolic-links=0
    &amp;lt;strong&amp;gt;federated&amp;lt;/strong&amp;gt;

    [mysqld_safe]
    log-error=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;service mysqld restart&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mysql&amp;gt; show engines;
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| Engine     | Support | Comment                                                    | Transactions | XA   | Savepoints |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| FEDERATED  |&amp;lt;span style=&quot;color: #ff0000;&quot;&amp;gt;&amp;lt;strong&amp;gt; YES&amp;lt;/strong&amp;gt;&amp;lt;/span&amp;gt;     | Federated MySQL storage engine                             | NO           | NO   | NO         |
| CSV        | YES     | CSV storage engine                                         | NO           | NO   | NO         |
| MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance     | NO           | NO   | NO         |
| InnoDB     | YES     | Supports transactions, row-level locking, and foreign keys | YES          | YES  | YES        |
| MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables  | NO           | NO   | NO         |
| MRG_MYISAM | YES     | Collection of identical MyISAM tables                      | NO           | NO   | NO         |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
6 rows in set (0.00 sec)

mysql&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;p&gt;If you want to restore your databases:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$ sudo mysql_install_db&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$ sudo service mysql start&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$ sudo mysql_secure_installation&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$ mysql -u root -p&lt;/code&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Mon, 17 Feb 2014 09:49:12 -0500</pubDate>
        <link>https://rodolfo.ca/2014/02/17/how-to-enable-federated-engine-in-mysql.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/02/17/how-to-enable-federated-engine-in-mysql.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to enable remote root access in MySQL</title>
        <description>&lt;p&gt;First you must to connect to your mysql server:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mysql -h localhost -u root -p&amp;lt;/pre&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After this, you have to grand privileges:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;GRANT ALL PRIVILEGES ON *.* TO &apos;root&apos;@&apos;%&apos; IDENTIFIED BY &apos;password&apos;;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then, you have to restart the mysqld service.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;service mysqld restart
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Mon, 17 Feb 2014 08:53:21 -0500</pubDate>
        <link>https://rodolfo.ca/2014/02/17/how-to-enable-remote-root-access-in-mysql.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/02/17/how-to-enable-remote-root-access-in-mysql.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How To Install Linux, Apache, MySQL, PHP (LAMP) on CentOS 6</title>
        <description>&lt;p&gt;This is a very simple steps to configure a CentOS server. Apache, PHP, MySQL&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Installing the Apache HTTP Server:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;[root@srvcob ~]# yum install httpd Starting the server:
[root@srvcob ~]# service httpd start&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;How to search all php modules availables:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;[root@srvcob ~]# yum search php-&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;How to install PHP:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;[root@srvcob ~]# yum install php&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Installing php-mysql module:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;[root@srvcob ~]# yum install php-mysql&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Installing the php-cli module:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;[root@srvcob ~]# yum install php-cli&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Installing the net-snmp:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;[root@srvcob ~]# yum install net-snmp&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Install php-snmp using the .rpm file:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;[root@srvcob ~]# rpm -ivh php-snmp-5.3.3-3.el6_1.3.x86_64.rpm&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Install MySQL Server:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;[root@srvcob ~]# yum install mysql-server&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Start the MySQL Server:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;[root@srvcob ~]# service mysqld start&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Downloading the phpMyAdmin:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;[root@srvcob ~]# wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/4.1.6/phpMyAdmin-4.1.6-all-languages.tar.gz?r=http%3A%2F%2Fwww.phpmyadmin.net%2Fhome_page%2Fdownloads.php&amp;amp;ts=1391532364&amp;amp;use_mirror=ufpr&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Extracting the .tar.gz file:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;[root@srvcob html]# tar -xzvf phpMyAdmin-4.1.6-all-languages.tar.gz&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Removing the .tar.gz file:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;[root@srvcob html]# rm -rf *.tar.gz&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;If you want to rename the phpmyadmin folder:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;[root@srvcob html]# mv phpMyAdmin-4.1.6-all-languages/ phpmyadmin
[root@srvcob html]# cd phpmyadmin/&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Setting up the configuration file:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;[root@srvcob phpmyadmin]# mv config.sample.inc.php config.inc.php&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Set the httpd and mysqld to start automatctly if the server has restarted:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;[root@srvcob /]# chkconfig httpd on
[root@srvcob /]# chkconfig mysqld on&lt;/pre&gt;
</description>
        <pubDate>Thu, 06 Feb 2014 22:59:01 -0500</pubDate>
        <link>https://rodolfo.ca/2014/02/06/how-to-install-linux-apache-mysql-php-lamp-on-centos-6.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/02/06/how-to-install-linux-apache-mysql-php-lamp-on-centos-6.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Format a double number to shows two numbers after comma in JAVA</title>
        <description>&lt;p&gt;How to format a double number to shows a decimal number with two numbers after comma? (In JAVA)&lt;/p&gt;

&lt;pre class=&quot;brush: java;&quot;&gt;import java.text.DecimalFormat;   
DecimalFormat df = new DecimalFormat(&quot;#,###.00&quot;);
df.format(1234.36);&lt;/pre&gt;

&lt;p&gt;and you can use this other way:&lt;/p&gt;

&lt;pre class=&quot;brush: java;&quot;&gt;double x = 123.123;
System.out.printf( &quot;%.2f&quot;, x );&lt;/pre&gt;
</description>
        <pubDate>Fri, 24 Jan 2014 18:12:09 -0500</pubDate>
        <link>https://rodolfo.ca/2014/01/24/format-a-double-number-to-shows-two-numbers-after-comma-in-java.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/01/24/format-a-double-number-to-shows-two-numbers-after-comma-in-java.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to prints the Fibonacci sequence from 0 to 100 using JAVA</title>
        <description>&lt;p&gt;I’m studying again some about JAVA. I’ve gotten some interesting codes and I’d like to share with you guys some of it. This code prints the Fibonacci sequence from 0 to 100 using Java.&lt;/p&gt;

&lt;pre class=&quot;brush: java;&quot;&gt;package myJavaCodes;

public class example4 {

    public static void main(String[] args) {
        // Prints Fibonacci sequence from 0 until 100

        int oneNumberBefore = 1;
        int twoNumbersBefore = 1;
        int nextNumber = 1;
        int y = 1;
        
        while(true)
        {
            if (y &amp;gt; 2)
            {
                nextNumber = oneNumberBefore + twoNumbersBefore;
                twoNumbersBefore = oneNumberBefore;
                oneNumberBefore = nextNumber;                
            }
            
            if (nextNumber &amp;gt;= 100)
            {
                break;
            }
            
            System.out.println(nextNumber);
            y++;
        }
    }

}
&lt;/pre&gt;

&lt;p&gt;And we got the follow output code:&lt;/p&gt;

&lt;pre&gt;1
1
2
3
5
8
13
21
34
55
89
&lt;/pre&gt;
</description>
        <pubDate>Wed, 15 Jan 2014 17:13:14 -0500</pubDate>
        <link>https://rodolfo.ca/2014/01/15/how-to-prints-the-fibonacci-sequence-from-0-to-100-using-java.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2014/01/15/how-to-prints-the-fibonacci-sequence-from-0-to-100-using-java.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to run a command and not close it after logoff</title>
        <description>&lt;p&gt;How to run a command and not close it after logoout in LINUX COMMAND LINE INTERFACE (CLI)?&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nohup command-with-options &amp;amp;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Mon, 11 Nov 2013 20:03:55 -0500</pubDate>
        <link>https://rodolfo.ca/2013/11/11/how-to-run-a-command-and-doesnt-close-it-after-logoff.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2013/11/11/how-to-run-a-command-and-doesnt-close-it-after-logoff.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to redirect all http to https in your Apache</title>
        <description>&lt;p&gt;How to redirect all http to https in your Apache?&lt;/p&gt;

&lt;p&gt;Just edit your httpd.conf in the VirtualHost section and put this code:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;VirtualHost *:80&amp;gt;
    ServerAdmin YOUR_EMAIL_ADMIN_HERE
    DocumentRoot /var/www
    ServerName YOUR_SERVER_DOMAIN_HERE
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
&amp;lt;/VirtualHost&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Mon, 11 Nov 2013 04:02:12 -0500</pubDate>
        <link>https://rodolfo.ca/2013/11/11/how-to-redirect-all-http-to-https-in-your-apache.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2013/11/11/how-to-redirect-all-http-to-https-in-your-apache.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to show fraction result in HP 50g calculator</title>
        <description>&lt;p&gt;Do you wanna show fraction results in your HP 50g? You can simply follow the steps above:&lt;/p&gt;

&lt;p&gt;MODE &amp;gt; FLAGS &amp;gt; 105 Aprox. Mode on&lt;/p&gt;
</description>
        <pubDate>Sat, 09 Nov 2013 21:12:04 -0500</pubDate>
        <link>https://rodolfo.ca/2013/11/09/how-to-show-fraction-result-in-hp-50g-calculator.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2013/11/09/how-to-show-fraction-result-in-hp-50g-calculator.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to create a .tar.gz file of a directory</title>
        <description>&lt;p&gt;If you want to download all files of your website running linux, you can simply create a zipped file (.tar.gz) in your linux server and download only one file instead of multiple files. It makes your download more faster than downloading using multiple files.&lt;/p&gt;

&lt;p&gt;Be very careful with this command. You can delete all your files with a wrong command syntax.&lt;/p&gt;

&lt;pre&gt;tar -czvf filecompressed.tar.gz directory_to_compress/&lt;/pre&gt;

&lt;p&gt;Just to you know:&lt;/p&gt;

&lt;pre&gt;-c (Create file)
-v (Verbose mode. Show all files that has been compressed)
-z (Work with a gunzip file)
-f (File. If you want to work with device use F in uppercase)
&lt;/pre&gt;

&lt;p&gt;Hope you enjoy. &lt;br /&gt;
Rodolfo&lt;/p&gt;
</description>
        <pubDate>Sun, 03 Nov 2013 23:23:14 -0500</pubDate>
        <link>https://rodolfo.ca/2013/11/03/how-to-create-a-tar-gz-file-of-a-directory.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2013/11/03/how-to-create-a-tar-gz-file-of-a-directory.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Why this happens? tar: Error exit delayed from previous errors</title>
        <description>&lt;p&gt;Why this happens?&lt;/p&gt;

&lt;pre&gt;tar: Error exit delayed from previous errors&lt;/pre&gt;

&lt;p&gt;If you would like to create a .tar.gz file of a directory but you gotten this error, you can simple use the follow command to see what’s happening. Usually, this happens because you don’t have access in a file or folder. When you found the problem, you can fix it just typing:&lt;/p&gt;

&lt;pre&gt;chmod 777 your_file_or_directory&lt;/pre&gt;

&lt;p&gt;To see what folder you have to set the new chmod:&lt;/p&gt;

&lt;pre&gt;tar -czvf file_compressed.tar.gz directory_to_compress &amp;gt; show_me_all_logs.log&lt;/pre&gt;

&lt;p&gt;You gonna see something like this:&lt;/p&gt;

&lt;pre&gt;$ tar -czvf file_compressed.tar.gz directory_to_compress &amp;gt; show_me_all_logs.log
tar: public_html/directory/file_denied.xml: Cannot open: Permission denied
tar: Error exit delayed from previous errors&lt;/pre&gt;
</description>
        <pubDate>Sun, 03 Nov 2013 23:22:11 -0500</pubDate>
        <link>https://rodolfo.ca/2013/11/03/why-this-happens-tar-error-exit-delayed-from-previous-errors.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2013/11/03/why-this-happens-tar-error-exit-delayed-from-previous-errors.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to create a read-only user in MySQL</title>
        <description>&lt;p&gt;Do you want to create a read-only user in a MySQL account? Just follow the commands above:&lt;/p&gt;

&lt;pre class=&quot;brush: sql;&quot;&gt;CREATE USER &apos;name_of_your_user&apos;@&apos;%&apos; IDENTIFIED BY &apos;password_of_your_user&apos;;
GRANT SELECT ON *.* TO &apos;name_of_your_user&apos;@&apos;%&apos;;
FLUSH PRIVILEGES;

SELECT host,user,password FROM mysql.user;
# DROP USER &apos;name_of_your_user&apos;@&apos;%&apos;;


If you wanna create a user with all permissions to a specific database, just use:

GRANT ALL ON database_to_set_permissions.* TO &apos;name_of_your_user&apos;@&apos;%&apos;;

&lt;/pre&gt;

&lt;p&gt;Hope you enjoy guys! Thanks!&lt;/p&gt;

&lt;p&gt;Rodolfo Bandeira&lt;/p&gt;
</description>
        <pubDate>Fri, 25 Oct 2013 00:23:14 -0400</pubDate>
        <link>https://rodolfo.ca/ubuntu/linux/2013/10/25/how-to-create-a-readonly-user-in-mysql-only-select-command.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/ubuntu/linux/2013/10/25/how-to-create-a-readonly-user-in-mysql-only-select-command.html</guid>
        
        <category>MySQL</category>
        
        <category>Linux</category>
        
        
        <category>Ubuntu</category>
        
        <category>Linux</category>
        
      </item>
      
    
    
      <item>
        <title>How to check listen process in your linux?</title>
        <description>&lt;p&gt;Do you want to check what softwares are running in listen mode? Just type this command in your cli interface:&lt;/p&gt;

&lt;pre&gt;lsof -i| grep LISTEN&lt;/pre&gt;
</description>
        <pubDate>Thu, 24 Oct 2013 00:23:14 -0400</pubDate>
        <link>https://rodolfo.ca/ubuntu/linux/2013/10/24/how-to-check-listen-process-in-your-linux.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/ubuntu/linux/2013/10/24/how-to-check-listen-process-in-your-linux.html</guid>
        
        <category>Ubuntu</category>
        
        <category>Linux</category>
        
        
        <category>Ubuntu</category>
        
        <category>Linux</category>
        
      </item>
      
    
    
      <item>
        <title>How to sum a number to an IP Address using PHP?</title>
        <description>&lt;p&gt;Hi there!&lt;/p&gt;

&lt;p&gt;Today I got a situation that I needed to sum a number to an IP Address. 
So.. check this simple solution to solve it using PHP:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;?php
echo long2ip( ip2long(&quot;192.168.23.2&quot;) + 1);
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can see this code running in this website: &lt;a title=&quot;http://codepad.org/oiAOiqmX&quot; href=&quot;http://codepad.org/oiAOiqmX&quot; target=&quot;_blank&quot;&gt;http://codepad.org/oiAOiqmX&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Mon, 14 Oct 2013 04:12:22 -0400</pubDate>
        <link>https://rodolfo.ca/2013/10/14/how-to-sum-a-number-to-an-ip-address-using-php.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2013/10/14/how-to-sum-a-number-to-an-ip-address-using-php.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to set up proxy in apt-get</title>
        <description>&lt;p&gt;If you need to use apt-get but all connections in your network is working thought a proxy server, just use the follow tips:&lt;/p&gt;

&lt;pre&gt;export http_proxy=http://yourproxyaddress:proxyport&lt;/pre&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Thu, 03 Oct 2013 00:23:14 -0400</pubDate>
        <link>https://rodolfo.ca/ubuntu/linux/2013/10/03/how-to-set-up-proxy-in-apt-get.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/ubuntu/linux/2013/10/03/how-to-set-up-proxy-in-apt-get.html</guid>
        
        <category>Ubuntu</category>
        
        <category>Linux</category>
        
        
        <category>Ubuntu</category>
        
        <category>Linux</category>
        
      </item>
      
    
    
      <item>
        <title>Checking your Ubuntu Version</title>
        <description>&lt;p&gt;In order to figure out which ubuntu version are you running on your server, just open the terminal and type:&lt;/p&gt;

&lt;pre&gt;lsb_release -a&lt;/pre&gt;

&lt;p&gt;Hope you enjoy!&lt;/p&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Tue, 01 Oct 2013 00:23:14 -0400</pubDate>
        <link>https://rodolfo.ca/ubuntu/linux/2013/10/01/checking-your-ubuntu-version.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/ubuntu/linux/2013/10/01/checking-your-ubuntu-version.html</guid>
        
        <category>Ubuntu</category>
        
        <category>Linux</category>
        
        
        <category>Ubuntu</category>
        
        <category>Linux</category>
        
      </item>
      
    
    
      <item>
        <title>OLT Huawei for Passive Gigabit Networks GPON</title>
        <description>&lt;p&gt;This is a OLT MT5600 Huawei. This equipment puts the network traffic in broadcast using GPON technology.
In each fiber connector as you can see in the left of the image, it
sends +3dBm of signal and it can attend to some splitters and so much clients per fiber.&lt;/p&gt;

&lt;p&gt;In this infrastructure, we adopt 64 clients in maximum because we serve internet connections
between 20MB until 100MB.&lt;/p&gt;

&lt;p&gt;There are two source power boards, six fiber to clients boards, and two main cpu boards.
There’s also two 10gb boards but we didn’t connected fibers through it.
The internet traffic comes from a double fiber SFP 1.25Gbps adapter.&lt;/p&gt;

&lt;p&gt;As I already show here in my blog, this internet traffic comes from a NE40 Gibagit Huawei Router.
In other post, I’m going to show you the equipment that we use in a Client.&lt;/p&gt;

&lt;p&gt;A ONT with four ethernet ports, two voip ports and in some cases, CTV port.&lt;/p&gt;

</description>
        <pubDate>Sun, 04 Aug 2013 00:23:14 -0400</pubDate>
        <link>https://rodolfo.ca/fiber%20optics/telecommunications/networks/2013/08/04/olt-huawei-for-passive-gigabit-networks-gpon.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/fiber%20optics/telecommunications/networks/2013/08/04/olt-huawei-for-passive-gigabit-networks-gpon.html</guid>
        
        <category>Fiber Optics</category>
        
        <category>Telecommunications</category>
        
        <category>Networks</category>
        
        
        <category>Fiber Optics</category>
        
        <category>Telecommunications</category>
        
        <category>Networks</category>
        
      </item>
      
    
    
      <item>
        <title>NE40 Gigabit Router</title>
        <description>&lt;p&gt;&lt;img src=&quot;https://static.rodolfo.io/images/20210417/01459376a37aaa16e359f56190e0a95525a67850a7a7.jpg&quot; alt=&quot;Huawei NE40&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This monster has 7.08 Tbps of switching capacity. 1600 Mpps of forwarding performance. 130 kg of weight in full
configuration.&lt;/p&gt;

&lt;p&gt;Supports the static routing protocol and IPv4 dynamic routing protocols such as RIP, OSPF, IS-IS, and BGP-4.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;More information:&lt;/strong&gt; http://enterprise.huawei.com/en/products/network/router/ne/hw-201679.htm&lt;/p&gt;
</description>
        <pubDate>Sat, 03 Aug 2013 00:23:14 -0400</pubDate>
        <link>https://rodolfo.ca/fiber%20optics/telecommunications/networks/2013/08/03/ne40-gigabit-router.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/fiber%20optics/telecommunications/networks/2013/08/03/ne40-gigabit-router.html</guid>
        
        <category>Fiber Optics</category>
        
        <category>Telecommunications</category>
        
        <category>Networks</category>
        
        
        <category>Fiber Optics</category>
        
        <category>Telecommunications</category>
        
        <category>Networks</category>
        
      </item>
      
    
    
      <item>
        <title>Optical Power Multi Meter</title>
        <description>&lt;p style=&quot;text-align: justify;&quot;&gt;
  &lt;a href=&quot;http://www.rodolfobandeira.com/wp-content/uploads/2013/07/wpid-20130724_095931.jpg&quot;&gt;&lt;img class=&quot;size-full aligncenter&quot; style=&quot;border: 8px solid white;&quot; alt=&quot;image&quot; src=&quot;http://www.rodolfobandeira.com/wp-content/uploads/2013/07/wpid-20130724_095931.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt; With this equipment we can measure the light intensity from our switchers, media converters or signals from the pen optic. We can select what wave length usually 1310, 1550 or 1610 for GPON. Some monofiber equipments sends a signal TX using 1550 nm and the RX signal sends information in 1310 nm. Because of it, in some cases we can measure if there&amp;#8217;s signal in fibers. With this equipment we can also generate signal to check connectivity in other points. Some equipments runs from +3dBm to -27dBm. Of course that&amp;#8217;s depends on technology you&amp;#8217;re using.
&lt;/p&gt;
</description>
        <pubDate>Sun, 07 Jul 2013 00:23:14 -0400</pubDate>
        <link>https://rodolfo.ca/fiber%20optics/telecommunications/networks/2013/07/07/optical-power-multi-meter.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/fiber%20optics/telecommunications/networks/2013/07/07/optical-power-multi-meter.html</guid>
        
        <category>Fiber Optics</category>
        
        <category>Telecommunications</category>
        
        <category>Networks</category>
        
        
        <category>Fiber Optics</category>
        
        <category>Telecommunications</category>
        
        <category>Networks</category>
        
      </item>
      
    
    
      <item>
        <title>How to set up Broadcom BCM4312 wireless network in Ubuntu Server Linux</title>
        <description>&lt;p&gt;Hello everyone!&lt;/p&gt;

&lt;p&gt;How to configure the Broadcom BCM4312 wireless network in Ubuntu Server Linux. This is the wireless board of my old laptop model: (Philco PHN14003)&lt;/p&gt;

&lt;p&gt;At first we need to confirm that you really have the BCM4312.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre&gt;root@linux:/# lspci | grep Network
02:00.0 Network controller: Broadcom Corporation BCM4312 802.11b/g LP-PHY (rev 01)
root@linux:/#
&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;root@linux:/# &lt;/code&gt;apt-get update
&lt;code&gt;root@linux:/# &lt;/code&gt;apt-get install b43-fwcutter firmware-b43-lpphy-installer
&lt;code&gt;root@linux:/# &lt;/code&gt;ifconfig wlan0 up
&lt;code&gt;root@linux:/# &lt;/code&gt;iwconfig
&lt;code&gt;root@linux:/# iwlist scan &amp;gt; log_wifi.txt
 &lt;/code&gt;&amp;lt;/pre&amp;gt;&lt;/p&gt;

&lt;p&gt;Than, you have to find your SSID inside your .txt file. In my case, the name is “safe”&lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre&gt;root@linux:/# wpa_passphrase MY_SSID MY_PASSWORD &amp;gt; /etc/wpa_supplicant.conf&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;You have to put your ssid and your wireless password as you see.&lt;/p&gt;

&lt;p&gt;Thus, we have to edit the /etc/network/interfaces and put this:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;code&amp;gt;auto wlan 
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant.conf&amp;lt;/code&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;  &lt;/div&gt;
&lt;/blockquote&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;That’s it! Just reboot with &lt;strong&gt;reboot -n&lt;/strong&gt; and its working!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;More informations:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://askubuntu.com/questions/55868/how-to-install-broadcom-wireless-drivers/60395#60395&quot; title=&quot;http://askubuntu.com/questions/55868/how-to-install-broadcom-wireless-drivers/60395#60395&quot;&gt;http://askubuntu.com/questions/55868/how-to-install-broadcom-wireless-drivers/60395#60395&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://prupert.wordpress.com/2010/06/25/how-to-configure-wireless-wifi-networking-in-ubuntu-via-the-command-line-cli/&quot; title=&quot;https://prupert.wordpress.com/2010/06/25/how-to-configure-wireless-wifi-networking-in-ubuntu-via-the-command-line-cli/&quot;&gt;https://prupert.wordpress.com/2010/06/25/how-to-configure-wireless-wifi-networking-in-ubuntu-via-the-command-line-cli/&lt;/a&gt;&lt;/p&gt;

</description>
        <pubDate>Sun, 07 Jul 2013 00:23:14 -0400</pubDate>
        <link>https://rodolfo.ca/wireless/ubuntu/linux/2013/07/07/how-to-set-up-broadcom-bcm4312-wireless-network-board-in-ubuntu-server-linux.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/wireless/ubuntu/linux/2013/07/07/how-to-set-up-broadcom-bcm4312-wireless-network-board-in-ubuntu-server-linux.html</guid>
        
        <category>wireless</category>
        
        <category>ubuntu</category>
        
        <category>linux</category>
        
        
        <category>wireless</category>
        
        <category>ubuntu</category>
        
        <category>linux</category>
        
      </item>
      
    
    
      <item>
        <title>How to change console linux resolution Ubuntu Server 12.04</title>
        <description>&lt;p&gt;Hello everyone,&lt;/p&gt;

&lt;p&gt;If you would like to change the console linux resolution, here we have a simple tip to help you. Just remembering, I’m using Ubuntu Server 12.04.&lt;/p&gt;

&lt;p&gt;Let’s edit the Grub file located in:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre&gt;/etc/default/grub&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;Remove the comment of this line:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre&gt;GRUB_GFXMODE=1024x768&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;Put your resolution there. If you ain’t a graphical card guru, I recommend to use a 800×600 or 1024×768&lt;/p&gt;

&lt;p&gt;Reboot and enjoy your new linux cli!&lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre&gt;reboot -n&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt; &lt;/p&gt;
</description>
        <pubDate>Sun, 07 Jul 2013 00:22:14 -0400</pubDate>
        <link>https://rodolfo.ca/grubscp/ubuntu/linux/2013/07/07/how-to-change-console-linux-resolution-ubuntu-server-12-04.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/grubscp/ubuntu/linux/2013/07/07/how-to-change-console-linux-resolution-ubuntu-server-12-04.html</guid>
        
        <category>grub</category>
        
        <category>ubuntu</category>
        
        <category>linux</category>
        
        
        <category>grubscp</category>
        
        <category>ubuntu</category>
        
        <category>linux</category>
        
      </item>
      
    
    
      <item>
        <title>Using SCP to copy files safely</title>
        <description>&lt;p&gt;How to transfer files safely? Don’t you know the SCP yet? (Secure Copy Protocol)&lt;/p&gt;

&lt;p&gt;Do you know SCP ? This is a amazing tool to push or pull files using SSH with the same mechanisms for authentication of SSH.&lt;/p&gt;

&lt;p&gt;As I always say.. let’s go to the examples!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;From your computer to server running sshd:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre&gt;&lt;tt&gt;scp SourceFile user@host:directory/TargetFile
&lt;/tt&gt;&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;From server to your computer:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre&gt;&lt;tt&gt;scp user@host:directory/SourceFile TargetFile&lt;/tt&gt;&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;From server to server:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre&gt;&lt;tt&gt;scp SourceFile user@host:directory/TargetFile
&lt;/tt&gt;&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;So easy don’t you think? Yeah! And now the last tip:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;From your computer to server using a specific ssh port:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre&gt;scp -P YOUR_PORT SourceFile user@host:directory/TargetFile&lt;/pre&gt;
&lt;/blockquote&gt;
</description>
        <pubDate>Thu, 04 Jul 2013 00:22:14 -0400</pubDate>
        <link>https://rodolfo.ca/scp/ssh/unix/2013/07/04/using-scp-to-copy-files-safely.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/scp/ssh/unix/2013/07/04/using-scp-to-copy-files-safely.html</guid>
        
        <category>scp</category>
        
        <category>ssh</category>
        
        <category>Unix</category>
        
        
        <category>scp</category>
        
        <category>ssh</category>
        
        <category>Unix</category>
        
      </item>
      
    
    
      <item>
        <title>Shellscript Command Cut</title>
        <description>&lt;p&gt;With the command &lt;strong&gt;cut&lt;/strong&gt; in bash you can extract some part of a string (characters or bytes).
Let’s stop talking and put our hands on some examples:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rodolfo@ubuntu:/tmp$ cut -b1-6 ajax_clock_small.gif | head -n 1
 GIF89a
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The command cut the first byte until the byte number six from a binary file.
In this case a image file. The command pipe &lt;strong&gt;|&lt;/strong&gt; on the and of the string is to extract only the first row.
 Yeah, the cut command goes thought all lines of the file.&lt;/p&gt;

&lt;p&gt;If you use -c instead of -b you will got the same result. “GIF89a”&lt;/p&gt;

&lt;p&gt;You can also use a -d option to set a delimitation character.
If you are using the -d option, you can get the fields in something like a array of elements.
 Just using the option -f and specifying the column.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rodolfo@ubuntu:/&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cut&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt;: &lt;span class=&quot;nt&quot;&gt;-f1&lt;/span&gt;,2,3 /etc/passwd | &lt;span class=&quot;nb&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; 3
 root:x:0
 daemon:x:1
 bin:x:2
 rodolfo@ubuntu:/&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Tue, 02 Jul 2013 00:22:14 -0400</pubDate>
        <link>https://rodolfo.ca/linux/shellscript/unix/2013/07/02/shellscript-command-cut.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/linux/shellscript/unix/2013/07/02/shellscript-command-cut.html</guid>
        
        <category>Linux</category>
        
        <category>Shellscript</category>
        
        <category>Unix</category>
        
        
        <category>Linux</category>
        
        <category>Shellscript</category>
        
        <category>Unix</category>
        
      </item>
      
    
    
      <item>
        <title>How to scroll window to the left or right using jQuery</title>
        <description>&lt;p&gt;Hey&lt;/p&gt;

&lt;p&gt;I’m posting this information because I spent some hours to make this working fine in Firefox and Safari. We can find on google a lot of examples to scroll window or div elements up or down. But left or right isn’t so easy.&lt;/p&gt;

&lt;pre class=&quot;brush: javascript;&quot;&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;  
        $(function() 
                {
                $(&quot;#moveLeft&quot;).click(function() {
                    $(&quot;html, body&quot;).animate({ scrollLeft: &apos;-=500px&apos; }, &quot;slow&quot;);
                });

                $(&quot;#moveRight&quot;).click(function() { 
                    $(&quot;html, body&quot;).animate({ scrollLeft: &apos;+=500px&apos; }, &quot;slow&quot;);
                });
        });            
&amp;lt;/script&amp;gt;&lt;/pre&gt;
</description>
        <pubDate>Sat, 29 Jun 2013 00:22:14 -0400</pubDate>
        <link>https://rodolfo.ca/javascript/jquery/2013/06/29/how-to-scroll-window-to-the-left-or-right-using-jquery.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/javascript/jquery/2013/06/29/how-to-scroll-window-to-the-left-or-right-using-jquery.html</guid>
        
        <category>Javascript</category>
        
        <category>jQuery</category>
        
        
        <category>Javascript</category>
        
        <category>jQuery</category>
        
      </item>
      
    
    
      <item>
        <title>EDT-135 Acterna E1 and Data Tester</title>
        <description>&lt;p&gt;This is the EDT-135 Acterna E1 and Data Tester.
A powerful tester includes a full set of measurements to install, commission and troubleshoot E1 and data circuits,
along with the services that run over them.
Some network technicians  in Brazil call it “Maleta” like Suitcase.
Yeah, maybe because its more easy to say.&lt;/p&gt;

&lt;p&gt;We just use this tester to make loop tests in deterministic networks connections.
We have a diagram that shows all the path between our telecommunication center to our client-network.
We just make a logical loop in equipments like SDH MUX or coaxial connections in our telecommunications center. When the signal from EDT-135 TX go away and comes to RX without any error, the message OK is shown in the screen.&lt;/p&gt;

&lt;p&gt;The most usual connections that We use with it is V.35 and G.703. In some cases v.35 to network speed until 2Mbps and E1 to 2048Mbps. This kind of network connections is becoming outdate of the telecommunications market every day. The most usual clients that uses it nowadays is bank ATM networks. Here in Brazil we say: “Maquininhas de cartã0″. (Little credit card machines in a literal translation). Some network engineers say that this kind of connections is more safe and stable for financials transactions. I’ve gotten a lot of companies that doesn’t want to change your infrastructure and insist to use old cisco routers with G.703 connections or V.35. Do you believe that some companies contract connections of 64kbps or 128 kbps? Really, in some automation circuits or financial circuits that send serial RS232 information converted to different kind of standards communications.&lt;/p&gt;

&lt;p style=&quot;text-align: center;&quot;&gt;
  In this example, we have a OK massage in a loop test using V.35 connection and 384Kpbs speed connection.
&lt;/p&gt;

&lt;p style=&quot;text-align: left;&quot;&gt;
  The EDT-135 was discontinued and know have two alternatives from JDSU manufacturer. JDSU bought the Acterna Inc in 2005 from $760 million.
&lt;/p&gt;

&lt;div&gt;
  &lt;a href=&quot;http://www.jdsu.com/ja-jp/Test-and-Measurement/Products/a-z-product-list/Pages/hst-3000.aspx&quot;&gt;HST-3000 Handheld Services Tester&lt;/a&gt;
&lt;/div&gt;

&lt;div&gt;
  &lt;a href=&quot;http://www.jdsu.com/ja-jp/Test-and-Measurement/Products/a-z-product-list/Pages/smartclass-e1.aspx&quot;&gt;SmartClass E1/Datacom Tester&lt;/a&gt;
&lt;/div&gt;

</description>
        <pubDate>Sat, 01 Jun 2013 00:22:14 -0400</pubDate>
        <link>https://rodolfo.ca/networks/telecommunications/2013/06/01/edt-135-acterna-e1-and-data-tester.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/networks/telecommunications/2013/06/01/edt-135-acterna-e1-and-data-tester.html</guid>
        
        <category>Networks</category>
        
        <category>Telecommunications</category>
        
        
        <category>Networks</category>
        
        <category>Telecommunications</category>
        
      </item>
      
    
    
      <item>
        <title>How to run the last command you used on UNIX</title>
        <description>&lt;p&gt;That’s it:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;!!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This command searches in the .bash_history file about the last command have you used.
Crazy dont’t you think?&lt;/p&gt;

</description>
        <pubDate>Fri, 31 May 2013 00:23:55 -0400</pubDate>
        <link>https://rodolfo.ca/linux/shellscript/unix/2013/05/31/how-to-run-the-last-command-you-used-on-unix.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/linux/shellscript/unix/2013/05/31/how-to-run-the-last-command-you-used-on-unix.html</guid>
        
        <category>linux</category>
        
        <category>shellscript</category>
        
        <category>unix</category>
        
        
        <category>linux</category>
        
        <category>shellscript</category>
        
        <category>unix</category>
        
      </item>
      
    
    
      <item>
        <title>Replace white spaces to underline in a text file on UNIX</title>
        <description>&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;s, ,_,g&quot;&lt;/span&gt; file.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To more informations about sed, please type the best command:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;man &lt;span class=&quot;nb&quot;&gt;sed&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Or just google it.&lt;/p&gt;
</description>
        <pubDate>Fri, 31 May 2013 00:22:14 -0400</pubDate>
        <link>https://rodolfo.ca/linux/shellscript/unix/2013/05/31/replace-white-spaces-to-underline-in-a-text-file-on-unix.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/linux/shellscript/unix/2013/05/31/replace-white-spaces-to-underline-in-a-text-file-on-unix.html</guid>
        
        <category>linux</category>
        
        <category>shellscript</category>
        
        <category>unix</category>
        
        
        <category>linux</category>
        
        <category>shellscript</category>
        
        <category>unix</category>
        
      </item>
      
    
    
      <item>
        <title>Go to the last directory using command CAT on Linux</title>
        <description>&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; -
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That’s it! Type this and you’re gonna jump to the last directory.&lt;/p&gt;
</description>
        <pubDate>Fri, 31 May 2013 00:22:14 -0400</pubDate>
        <link>https://rodolfo.ca/linux/shellscript/unix/2013/05/31/go-to-the-back-directory-using-command-cat-on-linux.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/linux/shellscript/unix/2013/05/31/go-to-the-back-directory-using-command-cat-on-linux.html</guid>
        
        <category>linux</category>
        
        <category>shellscript</category>
        
        <category>unix</category>
        
        
        <category>linux</category>
        
        <category>shellscript</category>
        
        <category>unix</category>
        
      </item>
      
    
    
      <item>
        <title>How to install PHP CURL in Ubuntu Linux</title>
        <description>&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;curl libcurl3 php5-curl
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Restart the web server with following command:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo&lt;/span&gt; /etc/init.d/apache2 restart
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Thanks&lt;/p&gt;
</description>
        <pubDate>Wed, 29 May 2013 00:22:14 -0400</pubDate>
        <link>https://rodolfo.ca/2013/05/29/how-to-install-php-curl-in-ubuntu-linux.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2013/05/29/how-to-install-php-curl-in-ubuntu-linux.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Using MySQL C API for Linux</title>
        <description>&lt;p&gt;Hi, if you are using Ubuntu linux just type this message below:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;mysql-server
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;libmysql-dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And after, create an file with extention “.c” and put this code into the file:&lt;/p&gt;

&lt;div class=&quot;language-c highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cp&quot;&gt;#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&amp;lt;mysql/mysql.h&amp;gt;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;MYSQL&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;mysql_init&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mysql_real_connect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;hostname&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;user&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;password&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;database&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Yes! Connected&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;mysql_close&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Fail!&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Error %d : %s&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mysql_errno&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mysql_error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When you compile it, you may put some variables. You have to use the command line below:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;gcc &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;test&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt;/usr/lib/mysql &lt;span class=&quot;nt&quot;&gt;-lmysqlclient&lt;/span&gt; test.c
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Have fun!
:)&lt;/p&gt;
</description>
        <pubDate>Sun, 01 Jan 2012 21:13:08 -0500</pubDate>
        <link>https://rodolfo.ca/2012/01/01/using-mysql-c-api-for-linux.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2012/01/01/using-mysql-c-api-for-linux.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Using postgresql in C programs for Linux</title>
        <description>&lt;p&gt;Hi everyone!&lt;/p&gt;

&lt;p&gt;In last year at my last Job, I wrote some softwares in linux to access postgresql database.
So, I’ll show you how to make a simple code using your favorite text editor and GCC linux compiler.
We may use the LIB &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;libpq-dev&lt;/code&gt; in our linux.&lt;/p&gt;

&lt;p&gt;First step is install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;libpq-dev&lt;/code&gt; using apt-get on Ubuntu of course: &lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;libpq-dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You may use this code to compile your .C file: &lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;gcc your_program.c &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; your_program -lpq
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-c highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cp&quot;&gt;#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&amp;lt;string.h&amp;gt;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&amp;lt;stdlib.h&amp;gt;&lt;/span&gt;&lt;span class=&quot;c1&quot;&gt; // atoi&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Lib used to connect to PostgreSQL database&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&amp;lt;libpq-fe.h&amp;gt;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;#define IP_DB &quot;YOUR_IP&quot;
#define USER_DB &quot;YOUR_USER&quot;
#define PASS_DB &quot;YOUR_PASSWORD&quot;
#define DATABASE_DB &quot;YOUR_DATABASE&quot;
&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;main&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;PGconn&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;conn&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;PGresult&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;resultInsert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
  &lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;queryString&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;sprintf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;host=%s user=%s password=%s dbname=%s&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IP_DB&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;USER_DB&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;PASS_DB&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DATABASE_DB&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;conn&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;PQconnectdb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;stringConexao&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PQstatus&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;conn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;CONNECTION_OK&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; Error while try to connect. &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Error: %s  &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;PQerrorMessage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;conn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;PQfinish&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;conn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; Connected in: %s &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IP_DB&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;sprintf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;queryString&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;&quot;INSERT INTO your_table (field_one, field_two, field_three) VALUES (%d, &apos;%s&apos;, %d);&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;atoi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valueOne&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;valueTwo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;valueThree&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;resultSelect&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;PQexec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;conn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;queryString&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;resultSelect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Error &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Ok &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;PQfinish&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;conn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;END&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Bye friends, see you!&lt;/p&gt;

&lt;p&gt;Rodolfo Bandeira&lt;/p&gt;
</description>
        <pubDate>Sun, 01 Jan 2012 19:33:08 -0500</pubDate>
        <link>https://rodolfo.ca/2012/01/01/using-postgresql-in-c-programs-for-linux.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2012/01/01/using-postgresql-in-c-programs-for-linux.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Working with date intervals in PostgreSQL</title>
        <description>&lt;p&gt;Hi everyone!&lt;/p&gt;

&lt;p&gt;Some tips to work with date/time intervals in PostgreSQL.&lt;/p&gt;

&lt;p&gt;The first tip is how to know what day was yesterday:&lt;/p&gt;

&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;date_trunc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;DAY&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;now&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;INTERVAL&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;- 1 day&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)::&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;date&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We can show the function date_trunc() and the function now(). So, the result can be formatted using the “::date”
 cast operator. We can use cast to convert timestamp to date also using:&lt;/p&gt;

&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;cast&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;date_trunc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;DAY&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;now&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;INTERVAL&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;- 1 day&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;date&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you want to know what day is tomorrow, you can use something like this:&lt;/p&gt;

&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;date_trunc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;DAY&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;now&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;INTERVAL&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;1 day&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)::&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;date&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you want to get the last day of this month, you can use something like this:&lt;/p&gt;

&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;date_trunc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;MONTH&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;now&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;INTERVAL&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;1 MONTH - 1 day&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)::&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;date&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You should already saw “days” in INTERVAL parameter. You can use “days” or “day”. Both will works well&lt;/p&gt;
</description>
        <pubDate>Sun, 01 Jan 2012 19:12:42 -0500</pubDate>
        <link>https://rodolfo.ca/2012/01/01/working-with-date-intervals-in-postgresql.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2012/01/01/working-with-date-intervals-in-postgresql.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to use DB::PEAR in PHP and PostgreSQL</title>
        <description>&lt;p&gt;Hello Everybody!&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DB::PEAR&lt;/code&gt; is a class of PHP Pear that can connect your script to a lot of kinds of databases just changing one line.
The connection line. Here we can see the simple example for connect through PostgreSQL and select some informations.
I’m using Ubuntu linux in that example. So.. let’s go!&lt;/p&gt;

&lt;p&gt;If you are using ubuntu, type the follows commands to install php pear, and postgresql libs in PHP.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;php5-pgsql
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;php-db
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-php highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;DB.php&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$dsn&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;pgsql://YOUR_LOGIN:YOUR_PASSWORD@IP_OF_DATABASE/YOUR_DATABASE&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$options&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&apos;debug&apos;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&apos;portability&apos;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;DB_PORTABILITY_ALL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$db&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;DB&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;connect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$dsn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$options&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;PEAR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;isError&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getMessage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;());&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$sql&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;select * from YOUR_TABLE&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$sql&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Results: &quot;&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$result&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;numRows&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$result&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;fetchInto&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$entry&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Field 1: &quot;&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$entry&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot; ;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Field 2: &quot;&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$entry&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot; ;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Field 3: &quot;&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$entry&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot; ;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Field 4: &quot;&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$entry&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot; ;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Field 5: &quot;&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$entry&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot; ;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$db&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;disconnect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

&lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Hope you enjoy!&lt;/p&gt;

&lt;p&gt;Rodolfo&lt;/p&gt;
</description>
        <pubDate>Sun, 01 Jan 2012 02:04:23 -0500</pubDate>
        <link>https://rodolfo.ca/2012/01/01/how-to-use-dbpear-in-php-and-postgresql.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2012/01/01/how-to-use-dbpear-in-php-and-postgresql.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>Welcome to Stock Exchange</title>
        <description>&lt;p&gt;Hey everyone!&lt;/p&gt;

&lt;p&gt;I started studying about stock exchange few months ago.
I got an amazing book here that is called: “Bem vindo à Bolsa de Valores” (pt-BR), in English:
 “Welcome to Stock Exchange”.&lt;/p&gt;

&lt;p&gt;So, this book teaches how stocks works, and how to apply to your first investment at Bovespa
(The Brazilian Stock Exchange). When I was reading this book, I decided to do my first investment.  Until now, I didn’t
get financial losses and I’m so glad because of it.&lt;/p&gt;

&lt;p&gt;I’m learning every day and understanding how the market
works in the world. Bovespa is a fragile market and every time Europe or North America has any problems, it affects us here as well.&lt;/p&gt;

&lt;p&gt;I think the most difficult to get with this kind of investment is to find time to keep reading every day about the
economic news in the world and Brazil. My goal is definitely grow my monday and keep investing more and more.&lt;/p&gt;

&lt;p&gt;Maybe one day I’ll become a full-time trader? Perhaps not but always learning more about all this :)&lt;/p&gt;

&lt;p&gt;See you guys!
God bless all.&lt;/p&gt;
</description>
        <pubDate>Sat, 01 Oct 2011 22:55:23 -0400</pubDate>
        <link>https://rodolfo.ca/2011/10/01/welcome-to-stock-exchange.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/2011/10/01/welcome-to-stock-exchange.html</guid>
        
        
      </item>
      
    
    
      <item>
        <title>How to change the hostname of a computer running OpenBSD</title>
        <description>&lt;p&gt;This is how you can change the hostname of a computer/server running OpenBSD.
As you can see, after every &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bash-3.1#&lt;/code&gt; you’ll see each command. Make sure
you’re running this as root user.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;bash-3.1# &lt;span class=&quot;nb&quot;&gt;uname&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;id
&lt;/span&gt;OpenBSD localhost.localdomain 4.0 GENERIC#1362 i386
&lt;span class=&quot;nv&quot;&gt;uid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;root&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;gid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;wheel&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;groups&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;wheel&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, 2&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;kmem&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, 3&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;sys&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, 4&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;tty&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, 5&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;operator&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, 20&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;staff&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, 31&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;guest&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;-bash-3&lt;/span&gt;.1# vi /etc/myname
&lt;span class=&quot;nt&quot;&gt;-bash-3&lt;/span&gt;.1# ksh /etc/netstart
DHCPREQUEST on pcn0 to 255.255.255.255 port 67
DHCPACK from 192.168.164.254
bound to 192.168.164.129 &lt;span class=&quot;nt&quot;&gt;--&lt;/span&gt; renewal &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;900 seconds.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;-bash-3&lt;/span&gt;.1# &lt;span class=&quot;nb&quot;&gt;uname&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&amp;lt;/strong&amp;gt;
 OpenBSD OpenBSD 4.0 GENERIC#1362 i386
&lt;span class=&quot;nv&quot;&gt;uid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;root&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;gid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;wheel&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;groups&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;wheel&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, 2&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;kmem&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, 3&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;sys&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, 4&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;tty&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, 5&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;operator&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, 20&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;staff&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, 31&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;guest&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Done!&lt;/p&gt;
</description>
        <pubDate>Sun, 31 Jul 2011 23:18:05 -0400</pubDate>
        <link>https://rodolfo.ca/devops/sysadmin/2011/07/31/how-to-change-the-hostname-of-a-computer-running-openbsd.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/devops/sysadmin/2011/07/31/how-to-change-the-hostname-of-a-computer-running-openbsd.html</guid>
        
        <category>unix</category>
        
        <category>openbsd</category>
        
        
        <category>devops</category>
        
        <category>sysadmin</category>
        
      </item>
      
    
    
      <item>
        <title>How to list files from a tar.gz file</title>
        <description>&lt;p&gt;Before this became automatically in my mind, I used to google that all the time.
So here we go:&lt;/p&gt;

&lt;p&gt;If you want just to see which files are inside the &lt;strong&gt;.tar.gz&lt;/strong&gt; file you may use &lt;strong&gt;-t&lt;/strong&gt; option:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;tar&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-ztvf&lt;/span&gt; file.tar.gz&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;If you want to extract files, you may use &lt;strong&gt;-x&lt;/strong&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;tar&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-xzvf&lt;/span&gt; file.tar.gz&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Bye!&lt;/p&gt;
</description>
        <pubDate>Wed, 27 Jul 2011 19:12:28 -0400</pubDate>
        <link>https://rodolfo.ca/devops/sysadmin/2011/07/27/how-to-list-files-from-a-tar-gz-file.html</link>
        <guid isPermaLink="true">https://rodolfo.ca/devops/sysadmin/2011/07/27/how-to-list-files-from-a-tar-gz-file.html</guid>
        
        <category>unix</category>
        
        <category>linux</category>
        
        
        <category>devops</category>
        
        <category>sysadmin</category>
        
      </item>
      
    
  </channel>
</rss>
