Sal Aguilar's Adventures in IT

computers are easier to deal with than people

Oh-My-ZSH on MacOS Sierra — June 22, 2017

Oh-My-ZSH on MacOS Sierra


If you are a developer, coder, sysadmin or IT Pro I assume that you have used the terminal either on your Unix, Linux, Mac o Windows. And the shell that usually comes as default is the good old faithful BASH shell, which is nice but not cool.

What is Oh-My-Zsh?

Oh-My-Zsh is an open source, community-driven framework for managing your ZSH configuration. It comes bundled with a ton of helpful functions, helpers, plugins, themes, and a other cool things.

Below are some facts about it:

  • More than 200 plugins. Enhance your productivity with plugins that integrate into git, google, youtube, sublime and much more.
  • More than 1000 contributors.  Since its Open Source, the code is available for free on GitHub and you can add your modifications, plugins and themes. Just submit your pull request!
  • More than 140. Don’t be a dull bird using the old BASH simple theme. Add colors and other functionalities by using any of the themes.

Still not convinced?

Check this screen captures:

And these are just some of the ways your terminal or console can look like. Pretty awesome right?

Now, how do I install Oh My ZSH on my Mac?

Dude, its a piece of cake. Just go to your Terminal or iTerm2

mac-terminal-1

And type:

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

This will do the entire process of installing all the required pieces to make it work. Once it finishes you can go ahead and customize the themes & plugins.

Picking a different theme

As default, Oh-My-ZSH comes with the theme default which is robbyrussell. But if you want to choose a different please go to the Themes page in GitHub. Choose the one you like the most and then use your favorite text editor (nano, vim, emacs, sublimetext or even textedit) to edit the file .zshrc located on your home folder. Below are the commands to open such file on nano & vim:

nano ~/.zshrc
vim ~/.zshrc

Then you will have to locate the string:

ZSH_THEME=robbyrussell

And change it to the theme that you selected, on this case I chose the theme called Blinks, so I went ahead and edited the .zshrc file and put this string instead of the one above:

ZSH_THEME=blinks

Then save the file and exit the editor. Please note that you will NOT see an immediate change on your current session. You would have to start a new terminal session to see the new theme applied there.

Now if you are a free soul like me, then you might want to set the value to random, that way each time you open the terminal you will experience a new theme until you find the one that you love the most. To enable this awesomeness simply use this string instead of the two previous ones:

ZSH_THEME="random"

Cool? Dude you know it is cool!

So, what about plugins?

Just like Themes, enabling and disabling plugins is done thru a text editor and your file .zshrc. You will need to look for the string:

plugins=(xxxx)

Where xxxx can be anything.

Since you are on Mac, I suggest all these plugins to be enabled:

plugins=(brew rails git ruby terminalapp sublime screen rvm perms osx history github encode64)

But there are several more, just go to the Plugins page on GitHub to learn about them all.

Please note that the same rule of the themes applies here, you will need to save the file and open a new session to see the plugins enabled.

So that is all folks. Start experimenting with Oh-My-ZSH and help the creator of this awesome shell by buying some swag for you and your friends!

Comment below if I missed anything! Thanks!

Advertisements
Clearing CloudProxy cache via PHP — October 18, 2016

Clearing CloudProxy cache via PHP


For those who are not familiar let me explain what CloudProxy is. CloudProxy is the Web Application Firewall & Caching service from my employer, Sucuri.net. This service is setup at the DNS level and helps filtering all the HTTP requests that get to your website and speeding the performance a the same time.

Below is a simple graphic to explains how it works:

sucuri-cloudproxy-how-it-works
A brief explanation on how Sucuri’s CloudProxy works

How can I clear CloudProxy Cache?

It’s simple there are two ways:

  • Via CloudProxy‘s dashboard on Sucuri’s website
  • Using the API

Clearing the cache via the dashboard

Just follow this steps:

  1. Login to your account via https://login.sucuri.net
  2. Then go to CloudProxy (check your left menu) or simply type this: https://waf.sucuri.net on your browser address bar.
  3. Once on the CloudProxy Dashboard, click on settings and select the website you want to clear the cache for.
  4. Once there click on Performance, and then simply on the button to clear the cache. And in less than 2 minutes the cache will be trashed from all the CDN servers.

You can also check their tutorial on their Knowledge Base: CloudProxy – Clearing Cache

This is convenient when you are not making that many changes into your website. However if you are pushing changes everyday or building an webapp, then you need something easier.

Clearing the cache via PHP

I am currently building a web app with some friends and we faced the issue that after deploying each change, I needed to login to my account and clear the cache manually. This becomes tediously when you are committing changes several times a day 5 days a week. So I had to come up with a simple solution to get the job done.

That is why I turned to CloudProxy’s API, which offers me the ability to clear the cache by calling a simple string. You can see the basic code  below:

<?php
/**
 * Simple Script in PHP to clear sucuri's cloudproxy cache via php 
 * 
 * Author: Salvador Aguilar
 * Email: sal.aguilar81@gmail.com
 * Web: salrocks.com
 */
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_RETURNTRANSFER => 1,
    CURLOPT_URL => 'https://waf.sucuri.net/api?v2',
    CURLOPT_POST => 1,
    CURLOPT_POSTFIELDS => array(
        // this is the Sucuri CloudProxy API key for this website
        k => 'your-cloudproxy-api-key-goes-here',
        // this is the Sucuri CloudProxy API secret for this website
        s => 'your-cloudproxy-api-secret-goes-here',
        // this is the Sucuri CloudProxy API action for this website
        a => 'clear_cache'
    )
));
// Send the request & save response to $resp
$resp = curl_exec($curl);
echo '<pre>' . $resp . '</re>';
// Close request to clear up some resources
curl_close($curl);

https://gist.github.com/riper81/2f070c485f8172364bf4efd7a30f2b2c.js

That is the initial version of the script, if you want other features or to fork it you can get it from GitHub: https://github.com/riper81/clear_cache_cloudproxy_php 

What’s next?

Once you have the file, you simply put it on your website root and you edit with the proper values from your Sucuri account and then simply run it via a web browser or command line and you cache will be cleared.

I added this script into my deployment script so I can update from my git repo and then clear the cache from Sucuri. Making things easy for us 🙂

If you have an idea, hit me up!

How websites get hacked? And WordPress meetup Managua — June 11, 2016

How websites get hacked? And WordPress meetup Managua


On May, I had the opportunity to participate on Desarrolladores WordPress Nicaragua (You can find them facebookmeetup ) monthly meetup.

Both my business partner and co-founder of SenorCoders.com and myself gave talks. While I talked about How Websites get Hacked, Kharron talked about Developing a Mobile App using WordPress as the backend.

My presentation was based out of the work that I do each day as part of the Remediation team in Sucuri. You can find my presentation here:

 

Special thanks to:

  • Daniel Gordon & Steven Hansen from Rain for sponsoring the venue, sodas and pizzas.
  • Tom Sepper @ Site5 for sponsoring the web hosting accounts

 

 

Alternative to PayPal in Nicaragua: Costa Rica — March 10, 2016

Alternative to PayPal in Nicaragua: Costa Rica


After an overwhelming traffic to my previous post 2 Alternatives to Paypal in Nicaragua, I was asked to expand my comments on each case, so today I am bringing you more information about using Paypal in Nicaragua, and yes its thru our southern neighbor country, Costa Rica.

As many of you already know, we can receive payments but we can’t cash them out locally. So after research online and conversations with many friends, such as Hosmel Quintana, an awesome Nicaraguan Developer working on UpWork and making a living.

So let’s now get straight to the point. The how-to begins now.

How this works?

Simple, Paypal works in Costa Rica, for both making and receiving payments and cashing them out. But there is a trick, it ONLY works with Banco Nacional but you will be able to transfer your money from Paypal to your Savings Account, which is what we want access to our money!!!

What do you need?

  1. Go to Costa Rica with a valid passport.
  2. Go to any branch of Banco Nacional.
  3. Open a Savings account with your passport. Do not explicitly state that you only want it for Paypal.
  4. Be sure to get the token that they give you to access BN Internet Banking, you will need it afterwards when enabling Paypal.
  5. Once your account is activated. You would need to open a new Paypal account and provide address of Costa Rica. You can look online and even  use any address listed here. You can check out this guide for step by step guidance.
  6. Once your costa rican Paypal account is activated, you would need to link the bank account using the information of your Savings Account from Banco Nacional. Upon activation it will ask you for the token, which you will use to finish the setup.
  7. You are done!

Restrictions and warnings: its not that simple

  1. You can NOT transfer from Paypal to Banco Nacional USD999 or more. This will raise red flags and would probably be forced to legally open a business in Costa Rica pay all the according taxes.
  2. If you want to cash out USD1,000 or more you would have to legally open a company, and open a business account with them. You would have a limit of USD10,000 per transaction and USD50,000 per day. That is a LOT if you ask me. These are the requirements for the business account. 
  3. You need to use an email that was not previously activated on Paypal. Be sure to follow the proper instructions listed here.
  4. The commissions, the ugly part, are these:
    1. Banco Nacional will charge you 0.5% if its more than USD 2,200.
    2. Banco Nacional will charge you USD 11 if its less than USD 2,200.

Getting the cash: How to transfer from Paypal to Banco Nacional?

  1. Login to your BN Internet Banking with your username and password.
  2. Once inside, look for PAGOS and then select PAYPAL.
  3. On the left menu, you should see the following option: Retirar fondos de cuenta PayPal. Click there.
  4. You will then have to type the number that was generated on your Token.
  5. Banco Nacional will now list the terms and conditions, which you have to accept if you want to continue.
  6. You will then select the Paypal account to which you want to perform the transfer to.
  7. Next step is to define how much money you want to transfer.
  8. Then you will have to confirm the transaction. Be sure to review the amount.
  9. Once confirmed, the transfer takes up to 5 business days to hit your account.
  10. After 5 days you should have your money ready. Awesome!

Conclusion

Even though is not the best option, it’s an option if you want to be able to cash out your Paypal funds on any ATM. I am still not sure about the specific ATM withdrawals fee, but that is something I am working on currently. If any one has already done it, I would appreciate you share the fees so I can include them here, and give you the proper credits on this article as well.

Thanks for reading and feel free to contact me for questions or suggestions. Jokes are welcomed too!

2 Alternatives to Paypal in Nicaragua — March 2, 2016

2 Alternatives to Paypal in Nicaragua


Last year I wrote an article about how Paypal is working on Nicaragua, and its 2016 and we are still on the same place: we can get money in, but we can’t cash it out locally 😦 , we need to spend it again via Paypal, which on my particular case has come in handy when paying for servers in Digital Ocean (please use this affiliate link – thanks for using it), Domains & Hosting in Site5 (please use this affiliate link), Games on the XBOX store (I’m a HUGE batman fan).

But at the end of the day you need hard, cold cash. So below are some options you can use instead of Paypal if you work with foreign customers.

PayOneer

aaeaaqaaaaaaaam6aaaajdeymjm0mwjhlti5ngqtndc2mc1hndmzlti2ytc2mwywztkxmq

This is a very known Mastercard debit card that is used by many freelancers who work and get paid via UpWork.com and other similar sites. This is a service that provides you with a US based checking account in Bank of America that companies on the US can deposit money and it will be linked to your card. Unfortunately that only works to get deposits from business or corporate accounts.

They do offer however a credit card based service, which it was suspended a couple of years ago and it seems is working again. The service will basically send an email to your client and they will go to a page from Payoneer where they can put their credit card information and perform the payment. They can even decide who is going to pay the fee for the transaction.

In Nicaragua, you can use this card on any ATM from banks who take Mastercard, I have being told by some freelancer friends that ProCredit ATMs offer the lowest fees, followed by BANPRO and lastly BAC being the most expensive one.

Payoneer Fees

Debit Card Annual fee: USD 29.95
Deposits to US Checking account: 1% (if you get paid 500 USD, they will charge you USD 5). Maximum is USD3000 per transaction.
Credit Card payments: 3% per transaction, the only take MASTERCARD & VISA, Maximum is USD2000 per transaction.

ATM Withdrawal fee:  3.15% per transaction (some ATMs add another charge on top of this percentage)

As a conclusion, this is a very good solution if you are getting payments from different customers and your transactions are below the USD2000. My suggestion is to use it when you can and instead of cashing out, to avoid the fees, try to use it as a debit card to pay for stuff like groceries, internet, gas or entertainment!

You can use my affiliate link to ORDER YOUR CARD TODAY FOR FREE

PaypalPanamá via LAFISE

This is a solution that has been suggested to me recently and for which I am still on the process of requesting it to LAFISE, since they are a regional bank with offices in Panama, you can open a bank account in LAFISE PANAMA without ever even leaving Nicaragua. You will have to go to your nearest LAFISE branch and talk to Customer Service (servicios bancarios in Spanish) and they will provide a list of the requirements to do so. Once you have filled all the requirements they will give you the bank account information. It cost around USD 20 since you are required to get LAFISE ID, which is their security method to login plus around USD200 cash to have there to keep your account opened.

They you will need to open a new Paypal account, but open it as if you were living in Panamá. After that you will link your LAFISE PANAMA Bank account to Paypal so you can start getting payments. Since LAFISE also has offices here, the transfers between countries are free.

All normal Paypal fees apply.

 

2Checkout

2co_logoA friend of mine, who owns a business directory website, has used their service for many years now. What they basically do, is they provide a back end so your customers can login there, put the credit card information and process the payment. 2checkout would then give you the option to wire you the money to your Nicaraguan bank account.

They do ask a lot of questions and are very strict about knowing exactly who you are, so they will ask you to provide a lot of documentation, but in the end you will be able to get payments internationally, so on my humble opinion, it’s worth it.

2checkout fees

Credit Card Transactions: 3.9% + 45¢
Wire Transfer cost: USD40-65

What’s next?

There are some options I didn’t include on this list because they would need you to open legal companies in other countries or ar alternative methods of sending money to Nicaragua so I am just going to list them briefly:

  1. Open a US company or LLC on any state, file with the IRS to get EIN, open a bank account on the business name and then start using services like Stripe or Authorize.net.
  2. Open a bank account in Costa Rica, in Banco Nacional and  create a Paypal account as if you were living in Costa Rica and link it to that account.
  3. Use Western Union, Moneygram, Xoom, etc.

If you have any tips or other ways that we as Nicaraguan Freelancers and entrepreneurs can benefit from, please let me know!

DLNA on Mac: The Ultimate Guide — February 24, 2016

DLNA on Mac: The Ultimate Guide


Well folks, many of you have read my article from Streaming from Mac OS X to a Roku Streaming Device and Stream Media from Debian to XBOX One, now it comes this guide, which is basically a different way of using DLNA on your Mac OS X (El Capitan).

Requirements

  • Mac OS X El Capitan
  • Internet access
  • Brew
  • Any DLNA capable device (Android device, Roku, Windows based computer, Playstation 4, XBOX or any SmartTV. The device needs to be on the same network as your Mac OS X computer.
  • Time, and willing to geek out!!

Step 1: Install Brew

Brew is the missing package manager for Mac OS X, it’s what aptitude is for Debian, yum for Red Hat based Linux distributions (RHEL, Fedora, CentOS, etc).It makes your life really easy if you are a developer or sysadmin. Install packages just like you would do on linux. Forget about downloading sources and compiling. This is the way to roll.

  1. Open your Terminal on your Mac OS X computer.
  2. Type the following command:
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  3. Wait for Brew to be installed. If it fails for any reason, please visit this link for further information.

Step 2: Install minidlna

On linux, we have minidlna which is a daemon used to share media contents in your network using DLNA. The daemon is now called ReadyMedia. The full description is:

ReadyMedia (formerly MiniDLNA) is server software with the aim of being fully compliant with DLNA/UPnP-AV clients.

  1. Once Brew is installed, go back to your terminal and get ready.
  2. Type the following command on your terminal to install minidlna:
    brew install minidlna
  3. This will download & install minidlna on your device. If you get any errors, then please run this command and then go back to step 2:
    brew update
  4. If minidlna installed without problems, move to the next step.

Some clarifications:

  • The software is installed on the folder /usr/local/Cellar/minidlna/x.x.x (x.x.x would be the version of minidlna installed.

Step 3: Setup minidlna sharing folders

This step is about to setup all the following: device name, folder where your media is stored and that you want to share across your network.

  1. Go back to your terminal.
  2. Open a text editor to modify the configuration file. So type the following command:
    nano /usr/local/Cellar/minidlna/x.x.x/share/minidlna/minidlna.conf
  3. Now customize your settings, please make sure that you customize the media_dir with the actual path where your media is stored, below is an example that you can use :
    friendly_name=Mac DLNA Server
    media_dir=/Users/salvador_aguilar/movies/

    Please note that you can name it what ever you’d like and the media_dir NEEDS to be an existing directory/folder on your computer so be sure to put the right path.

  4. Brew does not creates the symbolic links for minidlna to work well, so we are going to have to do this:
    ln -s /usr/local/Cellar/minidlna/x.x.x/sbin/minidlnad /usr/local/bin/minidlnad

    What you are doing here is basically creating a shortcut from our recently installed minidlna on the brew directory to our /usr/local/bin directly which is where most used commands are stored. In a few words to make your life easier. Less is more, enjoy!

  5. Launch minidlna with the following command:
    minidlna

    If you have OS X firewall turned on, then you will get a prompt that you will need to approve to give permission to minidlna to serve files on your network.

  6. Voilá! Now you can turn on your TV, XBOX, Android Device or any DLNA capable device that is connected to the same network as your Mac, and you should be able to see your Mac serving media files via DLNA.

    No need for Apple TV or any other Apple branded media devices. This will make your Mac talk to EVERYONE using a STANDARD that they have refused to use or implement! Bad Apple!

Let me know if you need a guide for a specific device, XBOX, Playstation, Roku, etc. I’m always eager for new challenges!


					
Avoid SSH Timeouts on the Mac Terminal — February 18, 2016

Avoid SSH Timeouts on the Mac Terminal


I admit it, I’m always with a lot of applications opened, Chrome with at least 6 tabs, Skype, Slack, PHPStorm or SublimeText, Airmail or Outlook for Mac, Photoshop and terminal.

I regularly login via SSH to VPS in Digital Ocean and AWS EC2 and then run some commands like:

wp plugin install wordfence

Then I go to the wordpress site and start adjusting the settings, but by the time I get back to the terminal (5 – 10 minutes), the SSH session is frozen, so I’m forced to open a new one. I honestly became tired of this, and I remembered that SSH was built on TCP and as such it should have some “Keep Alive” settings like on SIP (sorry I come from the call center world). And after some search online, I found that you can make this change both from the server side (SSHD: Secure SHell Daemon) or from your CLI (*nix, Linux & Mac).

Reduce SSH Timeouts from the server

Reduce SSH Timeouts from your computer

All you need to do is to setup your ssh client to send a “Keep Alive” signal to the server every certain amount of seconds. So you can add the following text to your ~/.ssh/config file:

Host remote-host
HostName remote-host.com
ServerAliveInterval 120

This basically tells your computer to send “keep alive” signals to remote-host.com every 120 seconds (2 minutes). That way the session will not get frozen for that server.

If you want to enable this for all of the hosts that you connect to, then simply add the following strings instead:

Host *
  ServerAliveInterval 120

This will setup the “keep alive” signal interval to 2 minutes for any host that you connect to via SSH.

After you finish editing the file, please make sure to change the permissions on the file using the following command:

chmod 600 ~/.ssh/config

And there you go, as simple as that! No more timeouts on my terminal app on my Mac OS El capitan MBP!

WordPress.org vs WordPress.com – An Idiot’s Guide — February 6, 2016

WordPress.org vs WordPress.com – An Idiot’s Guide


wpcomvswporg

For you that are starting with WordPress and you are trying this on your own, let me help you on clarifying this:

WordPress is a Content Management System (CMS) that is built on PHP (one of the most popular programming languages, see php.net for more info) and using MySQL as the database to store your user info, settings, posts and other information.

The company that developed WordPress is Automatic, they are the ones that coordinate the development of WordPress. And have made (and acquired) other popular WordPress plugins such as bbPress, BuddyPress, Jetpack, etc.

As many open software companies, they created a community version of WordPress which is open source and whose source code is hosted on GitHub and they made a commercial service that provides a hosted WordPress service that has both FREE and PAID plans.

WordPress.com: The service

For novice (n00b) users, I strongly suggest that they start experimenting with wordpress.com which already comes with many of the features someone would need to start a blog or website. You would get familiarized with the setting and would probably fall in love with Calypso which is wordpress.com backend GUI. Since the service is free and already comes with SSL, you would not have to worry about hacks, or performance, or security like you would do when you are using the open source version.

Sites like CNN, Time, UPS, Chrysler and NBC run on WordPress VIP, which is a paid version of WordPress that is made to provide the highest quality of service, no wonder why the pricing starts at USD 5,000 a month (Five Thousand US Dollars).

The FREE version of WordPress.com is limited. Well if it’s free it has to have some limits don’t you think? Well, at least I do. So what are the limits:

The limitations of wordpress.com

  • Limited availability of plugins. Only a small list of preapproved plugins.
  • Limited availability of themes.
  • You can’t edit the themes much.
  • You can’t run or place Ads on any site you create here.

The awesomeness of wordpress.com

  • Works straight up. No much setup needed.
  • It comes with FREE SSL (Wildcard SSL * .wordpress.com)
  • No SysAdmin work needed: security, upgrade, performance, everything is managed by them.
  • Callypso is so much cooler.
  • Built In stats
  • Social Media syndication

What’s the ideal usage for wordpress.com?

If you want to run a blog and only want to care about writing contents, with limited features and you do not want to worry about server & software maintenance. Or big companies with lots of cash, who need dedicated and professional hosting and support for their highly visited websites.

WordPress.org: The software

WordPress.org is where the software that is the core of wordpress.com lives. The difference is that WordPress.com is not an integrated platform, but a software that you can install on any server as long as it can interpret PHP nad have a MySQL database.

WordPress is pretty extendable and is sitting on 25% of all websites in the world. People have build business websites, helpdesks, knowledge bases, ecommerce stores and even social networking sites with it. Since it’s FREE, and you have thousands and thousands of both themes and plugins, is pretty popular amongst developers and non-IT folks.

The limitations of wordpress.org

  • It requires a lot of things and concepts to be learned: php, mysql, etc.
  • It does not come with a good security protection from scratch
  • It requires constant upgrading and sometimes this results on broken themes and plugins.
  • Has a lot of XSS Cross site Scripting exploits
  • Common target of hackers and script kiddies

The awesomeness of wordpress.org

  • Since its open source, you can use it however you like & customize it
  • It has thousands and thousands of plugins and themes available
  • Its easier to get assistance on wordpress.org than wordpress.com
  • It can be used to build almost every type of website.

What’s the ideal usage for wordpress.org?

A web designer or business owner that wants a tool for his business to use for sales (ecommerce, product catalog, services showdown, etc), marketing or other things like CRM and even social media. Someone looking for incredible flexibility and easy to change.

Conclusion

If you basically want an easy way to publish your stuff online, then go with wordpress.com. But if you have a vision and would like way more flexibility, and be able to upload custom plugins, then I definitely suggest you go with wordpress.org

What about you guys ? What is another difference between them?

Upgrading to Debian Jessie 8.3 — January 31, 2016

Upgrading to Debian Jessie 8.3


Recently I became aware that there was an update to my favorite Linux, Debian. I have been using Debian Jessie 8.2 on my laptop (Dell XPS 14) since it came out and honestly I did not have any problems at all.

But recently I was requested to install a Linux server for a small app developed on Ruby on Rails. And honestly my first choice is, and probably always be Debian; unfortunately when I came to the meeting with the good folks who wanted my assistance, I was informed that the server was already installed and that the developer installed Ubuntu 14.04 on it. Well that shouldn’t be much of a problem, after all is Debian at heart.

But due to many issues with it (performance and others), I wiped the install and did a Debian Jessie 8.2 install on the beautiful Dell server. Everything went well during the installation, but the error stroke after the first boot 😦 video issues all over the place. I couldn’t see the console or screen due to some odd conflicts with the drivers and the Matrox video card. I did see several issues and complaints on some forums about the same that I was experiencing, but it has its positive side. The developer was using this server as a workstation and had the GUI installed and used tools like Atom and other things and was going to use the server to do the training. And now with the issues with video, I had the perfect excuse to make him use his laptop. #Win for me.

Today, I was happy to read that many video issues have been patched with 8.3 and I intend to do the upgrade on the server tomorrow night. But I did try to do the upgrade on my computer and everything went well.

How to upgrade to Debian 8.3 from Debian 8.x?

The process itself is pretty easy, on your terminal using an account with sudo rights, run the following commands:

sudo apt-get update

This command will request all the latest versions from all the repositories that you have on setup on your sources.list.

sudo apt-get upgrade

The upgrade modifier on apt-get compares the latest versions of software on the catalog available online against the local catalog of installed software on your machine, and tells you which are the ones that you can upgrade to newer versions.

sudo apt-get dist-upgrade

The dist-upgrade modifier, besides doing the same thing as upgrade it also changes the dependencies with newer version of packages. It will prioritize the most important packages to upgrade.

sudo reboot

After the reboot your computer should be now running full Debian 8.3 and you can verify it by running the following command:

lsb_release -a

The output should be something like this:

Distributor ID: Debian
Description: Debian GNU/Linux 8.3 (jessie)
Release: 8.3
Codename: jessie

And there you go, Debian Jessie 8.3 installed, enjoy!

If you face errors or have questions, let me know!

PS: Thanks to Christian Torres for the correction!

Overcoming the WordPress’ white screen of death — November 18, 2015

Overcoming the WordPress’ white screen of death


Yesterday’s incident with La Prensa Nicaragua reminded me that I wanted to write about this 6 months ago. So I took some time and wrote this up. I really hope this helps someone.

If you have ever played with WordPress, plugins and themes a bit, it is very likely that you have faced the dreadful white screen of death. This can be very frustrating and even irritating if you do not know where to look for clues. So below I’m sharing a few tips for what I normally do on these cases.

Option 1: Enabling WP_DEBUG on wp_config.php

The file named wp-config.php is where all the important settings are for your site are stored. You will find the database hostname, name, username and password for the MySQL instance that your site is using. But it also holds some other very important features, and one of them is the one we need to enable with the following line:

define( 'WP_DEBUG', true );

By default your wp-config.php comes with this setting set to false, just change it to true to enable the debugging feature. Once the debugging mode is enabled, your wordpress instance will now show you on screen all the errors from themes and plugins.

You can alternatively also enable the feature for wordpress to write a log of all the errors and not show them on screen; this is especially handy if you are debugging on a production environment and you do not want the visitors to notice the errors. You do that adding the following code to the file:

// Enable WP_DEBUG mode
define('WP_DEBUG', true);

// Enable logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);

// Disable display of errors and warnings 
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);

Once you have added this to the wp-config.php file, you can check all the error messages of your site on the file located on /wp-content/debug.log. You can now find what is the error that you are getting and start fixing it.

Option 2: Troubleshoot with a plugin

If you search on the WordPress’ Plugin repository you will find that there are several plugins that help you on your troubleshooting tasks. So if you still have access to the WordPress Dashboard, then you use any of the plugins.

To start up with I suggest you try one of these plugins:

If you are running a Multisite instance of WordPress, then I suggest you use a plugin that was done specifically for networks and super admins, and is called Debug This.

I suggest you try them and based on your preferences you pick your favorite and start finding all the errors.

Option 3: Check the Error log on your web hosting Control Panel

This works if you are using whether cPanel or Plesk.

cPanel instructions

On your cPanel go to Logs and then Error Log.

Plesk instructions

Go to Files, then on the left side select the Logs folder, and then scroll down to find the file named error_log.

For other web hosting control panels, you would have to do an online search to find the proper instructions where to find the error log. The same it goes if you are using a Linux instance without any control panel. Please look for your linux distribution to find the error log of the web server (either Apache or NGINX).

Other things you can do

Disable plugins

Sometimes upgrading the plugins can break your site. It sucks but its true. So you can simply disable any of them by renaming the folder of the plugin to something else.

A radical measure its just to rename the entire plugin directory (/wp-content/plugins/)

Disable the themes

Yup, even some themes have caused the White Screen of Death many times. Easiesy way to disable it, just like with plugins is to rename the theme folder (/wp-content/themes/yourtheme).

You can also go to the MySQL database for this wordpress website, and look for the table wp_options, and change the theme to one of the builtin themes like twenty fifthteen, twenty fourteen & twenty thirdteen.

.htaccess issues

This is another of the most common issues, faulty rules on .htaccess. It can be a wrong rewrite, redirect or even a wrong add directive.

The good news is that errors caused by .htaccess are visible on your error_log. You can find that file based on your system configuration (cPanel, Plesk, Linux, Windows, etc).

Be sure to check Apache’s documentation for .htaccess. Or simply grab a clean version of the htaccess from WordPress’ Codex and backup the one you have for security purposes. Using the clean version of .htaccess will most likely solve the errors if you do not have time to troubleshoot and need the site back online asap.

If you want me to lend you a hand, contact me so we can take a look at your issue.

%d bloggers like this: