Copy files over an SSH tunel

In my working environment I am connecting to the production server using a gateway where I have my public key but sometimes I need to copy files from/to production servers.

I could copy it first on the ssh gateway and after that in my machine, but I prefer to do it through an SSH tunnel.

Assuming the ssh gateway is named ssh-server (should have an entry in /etc/hosts or dns) and the production server where I want to connect has the IP 192.168.0.10, I open the tunnel on my laptop like this:

Switch between branches using Nginx - part 1

For some of my projects, most of the time I use two branches: master and dev and I work mostly in dev. If I need to send the url to some clients with some dev/beta features I should create another (sub)domain like dev.myproject.com and sometimes, if I forget to change some configurations about the domain name (specially with some "very intelligent" CMSes that keeps the configuration in the database) I will get an email back saying "the new feature is not working" :)

How to send an ajax request with CURL

curl --header "X-Requested-With: XMLHttpRequest" --data "param1=razvan&param2=value2" http://my.domain.com/request.php

Tags: 

How to use python sched in a daemon process

Let's assume we want to download a file (or to do some tasks) to every 5 seconds, but the condition is to not do the same task twice or more times at the same moment, even if takes more than 5 seconds. For example, we have a to download a file and this will take 8 seconds. Also, if takes more than 5 seconds, it should not wait until the next iteration, to start again (3 seconds more), but will start the download immediately.

So, the traditional cronjob/lock file combination was not suitable for my case.

git tags use

Today I had to read about git tags in order to be able to explain better why somebody would use tags and for what. The old (and still good) git workflow explains very well how to develop using branches but doesn't explain too well why we create the tags and how should be used on production. It just saying "that commit on master must be tagged for easy future reference to this historical version".

$5 for any Packt ebook

All Packt ebooks and videos are than $5 until 3rd January (2014).

Tags: 

Today's readings

REST Anti-Patterns - A lot of people (or companies) pretend to have a REST API. Read this article and you will understand that not all the API's that implement GET and POST methods are REST APIs. It is an old article (from 2008), but still valid.

Crashing Google Chrome on Google website

Used version of Google Chrome Version 31.0.1650.63

OS Version: Ubuntu 12.04.3 LTS, Linux work 3.2.0-57-generic #87-Ubuntu SMP Tue Nov 12 21:35:10 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Go on Google Trends website http://www.google.com/trends/topcharts?zg=full

Click View #my2013 Gallery

Click any picture

Click the browser's back button

Click again the browser's back button

Crashed... or it will take between 20 seconds and 1-2 minutes to refresh that page.

Making a super fast blog with Drupal 7

Yesterday I decided to try to make my blog to load under 200 ms from my laptop using Drupal 7 without loose my old links to blog posts, from SEO reasons. I know, some people would say there are better solutions for a blog others than Drupal, but... I wanted to give a try to Drupal because it has one of the biggest community, a lot of modules and features and of course for fun.

So, first step it was to install Drupal 7 on a separate domain and to do all the work there.

HLS Video on Demand streaming

In this blog post we will show you how you can stream Video on Demand through HLS protocol, using only free open-source tools, as nginx web server and ffmpeg.

Pages

Subscribe to Răzvan Tudorică RSS