adobe How to disable Adobe Flash Player update notification Well, lets not talk about the history/legacy of Flash/HTML5 etc here. Flash has its place but its really annoying when the Adobe Flash Player updater pops in when you are working on something important and distracts you. And even worse, you are presented with only option to Remind
ruby Disable pry and exit debugger without killing the main program in Ruby You ever ran into a situation where you had a huge loop running and you put a binding.pry within that loop for debugging and wondered how the hell you would exit the debugger? The answer is simple disable-pry is your saviour.! via GIPHY [https://giphy.com/gifs/loki-saviour-l2QEjYgve6wmqLKog] This
postgres Don't forget to update the sequence in PostgreSQL after a COPY command You might have noticed that after bulk inserting records using the COPY statement in PostgreSQL the sequence IDs are not getting updated for any further inserts later on, and it would throw duplicate sequence ID errors. So you would be wondering what makes this COPY statement different that it does
postgresql Copy data from one postgres instance to another. remote copy options explored: Copy, CSV and STDIN Various options to copy data from one Postgres database/table to another Postgres database or table using copy command.
postgresql Escape character sequence "E" in PostgreSQL explained What's the "E" before a Postgres statement mean? Explaining the postgreSQL escape character sequence.
rake Passing multiple options/argument with default options in rake Rake task allows you to accept multiple arguments which can be used within the task, and also allows us to specify default options for these arguments. Accept multiple arguments/options Lets say we have a simple rake task to sync data from/across our servers to different enviroments. We can
rails How to fix the Index name too long error in rails migrations Today, I was reviewing some legacy code, trying to isolate the bottlenecks and pinpoint the optimisation strategies for scaling and performance optimisations of a rails app. As the usual procedure, I wanted to check the database indexes and see if something was missing here. And my guess was in the
SQL Find out which part of your code is triggering ActiveRecord or SQL queries. Today, I got a new pet project to play with and my job was to identify the bottlenecks and performance improvements we can make in the application. So I wanted to jump in and wanted to see what SQL queries were being triggered when someone requests data. Going through the
ssh Bypassing ssh firewall by overriding Type of Service headers for TCP packets in routers I was recently having issues when trying to ssh into one of my servers. The normal debugging techniques and solutions didn't work for me and I had to debug this in depth to figure out the issue was actually with my router blocking the packets The actual problem.! When you
git Debugging Git network connection issues using GIT_TRACE I have been travelling a lot this month and working remotely from cafes and public places during my stay in Europe. And most often I was connected to the internet using the public hot spots or free Wifi provided by the cafes or restaurants. The quality of the connections were
ruby Script/runner vz Rake tasks When it comes to running Rails tasks the common question that comes to mind is whether to use script/runner or to call a rake task script/runner long_running_task VZ rake long_running_task To understand it better we need to understand how both works under the hood.
ruby Elegant way to silently ignore a Ruby exception I was working on a small hobby project and wanted to ignore some of the Exceptions that were raised. The first version of the code that I wrote was something similar to: def ignore_exception begin yield rescue Exception end end and using ignore_exception { puts "Ignoring Exception"; raise Exception;
osx brew cask: Error: Unknown command: cask After upgrading my OS to Sierra I was having an issue with homebrew. It failed to recognize the cask command and was throwing an error: brew cask install haskell-platform Error: Unknown command: cask Brew wasn't able to find the correct path and was causing this issue. Fix: brew update brew
devops Manage sidekiq workers using deployment setup and Capistrano In real world, most of the Rails applications would be having a Sidekiq instance as its companion in production systems. And it's a necessary thing to have some sort of mechanism to manage your Sidekiq instance with your deployment setup. In this post, I am going to throw light on
rails How to turn on SQL debug logging for ActiveRecord If you want to see the SQL queries that your apps are running and want o optimize them or tune them, then it is a nice idea to log them. You can either log it to your log file or even to STDOUT. You can set the log level in
js How to fix Npm install failed with "cannot run in wd" I was trying to upgrade my blogs ghost version to 0.9(which btw has some cool features) and I stumbled upon an issue when trying to upgrade the packages. Every time I run sudo npm install --production on my server, I get the following error: npm WARN cannot run
docker Copy file from host machine to docker container The docker cp utility copies the contents of SRC_PATH to the DEST_PATH. You can copy from the container’s file system to the local machine or the reverse, from the local filesystem to the container. If - is specified for either the SRC_PATH or DEST_PATH, you
ruby How to load rake task from a custom file or directory If you are wondering how you can load a rake task from a custom file, then this is guide will help you to accomplish your task. Lets assume you have a rake task named hello.rake under your project directory's lib folder like: /lib/tasks/hello.rake Then you can
docker docker-compose up is slow on docker for mac os beta I have been trying with Docker beta on Mac OS and was facing an issue with docker-compose. It was taking ages for the docker-compose commands to get executed. After digging into a while I figured out that the dns lookup was causing the issues. docker-compose is trying to resolve localunixsocket.
authentication Injecting auth-headers into angular.js application using http.config vz using interceptors. We have been building a client app in Angular.js and decided on using token auth with JWTs, pretty much the normal choice. We got everything set up on the server side and am receiving the token on the client side, but now we just need to send the token
API How to enable support for CORS with custom headers like authentication in Rails I was building a client side application for my API that I built using Rails/Grape. So in order to access the resources using the API from the client application the first thing that I need to do was to enable CORS support in the API. Enabling CORS using rack-cors
docker How to install a specific package version in Alpine and Docker? I was building a docker image for a backend API application that I was working on, so that my colleague, who is a front-end guy can easily setup the docker container and get it up and running. I chose Alpine Linux to build the Docker image bcos its light weight.
elixir TDD in Elixir with ExUnit and Doctest ExUnit & DocTest Elixir has it's own test framework built in natively, called ExUnit. ExUnit is a core component of Elixir itself, as much as the task runner and dependency manager mix. When you start a new project with mix, everything is directly set up for you, including basic unit tests
rails How to fix Incomplete response received from application from nginx / passenger in a rails application I was trying to deploy a simple rails application( stack is Ruby 2.2.4, Rails 4.2.5, with passenger/Nginx as application/web server) to AWS EC2 and I was getting a weird error. Incomplete response received from application And looking at the Nginx/passenger logs I wasn't
elixir Tail Call Optimisation Tail Call Optimization is the process by which a smart compiler can make a call to a function and take no additional stack space. The only situation in which this happens is if the last instruction executed in a function is a call to another function or the function itself.