Skip to content

Instantly share code, notes, and snippets.

<VAST version='3.0'><Ad id='llxzrwli'><InLine><AdSystem version='1.0'>The Trade Desk</AdSystem><AdTitle><![CDATA[TTD-OguryApp_PMP_NA_NONSKIP_APP_CON_CA_GM-601-R_20s-FalcoCalcioCamion-NewsSportMotori-8345553]]></AdTitle><Description /><Error><![CDATA[https://enduser.adsrvr.org/enduser/video/?ve=error&vec=[ERRORCODE]&ast=[ASSETURI]&imp=463dd238-8249-40c3-a88b-64699d0cda26&ag=mfe4dqy&crid=llxzrwli&cf=6717357&fq=0&t=1&td_s=net.wooga.junes_journey_hidden_object_mystery_game&rcats=app-4mg,app-gts&mste=&mfld=2&mssi=&mfsi=&sv=ogury&uhow=102&agsa=&wp=${AUCTION_PRICE}&rgz=&dt=Mobile&osf=Android&os=Android110&br=WebView&svpid=9e7f72da61b19608383c9c078816c70c&rlangs=sm,it&mlang=&did=Ogury-20231222-IT-279fa1&rcxt=InApp&tmpc=17.350000000000023&vrtd=14,15&osi=&osv=&daid=&dnr=0&vpb=InterstitialSliderFloating&c=CgVJdGFseRIEUm9tZRoAIgRSb21lMAM4AUgAUAFYAoABAIgBApABArABALoBBQjORRgGyQGamZmZmZlBQOABAOgBAP0BAAAAAJICJDBjZTYzNmQwLWM3YTEtMDEzOS1mN2ZmLTAyNDJhYzEyMDAwNNgCiA7gAogO6AK0AfACAPgCAYADAogDApADAZgDBKADPbgD0cAGmgQHdGFxcWZ6bA..&d
@carlessistare
carlessistare / gist:c4ae073859721b781d448364a676b501
Created June 20, 2016 09:53
Git prune non existing branches on remote
git fetch -p
@carlessistare
carlessistare / ssh-key-travis.sh
Last active May 19, 2018 11:39
Output de text to copy to .travis.yml for the splitted secured ssh private key
base64 --wrap=0 ~/.ssh/id_rsa_travis > ~/.ssh/id_rsa_travis_64
cat ~/.ssh/id_rsa_travis_64 | perl -pe 's/(.{100})/$1\n/g' | nl | perl -pe 's/\s*(\d+)\s*(.*)/echo " - secure: `travis encrypt ID_RSA_TRAVIS_$1=$2 --pro`"/' | sh
# OUTPUT
# - secure: "...="
# - secure: "...="
# - secure: "...="
# ...
# - secure: "...="
Couchbase = require 'couchbase'
fs = require('fs')
readline = require('readline')
stream = require('stream')
async = require('async')
elasticsearch = require('elasticsearch')
host = "xxx"
cluster = new Couchbase.Cluster("couchbase://#{host}")
couchbase = cluster.openBucket("users")
@carlessistare
carlessistare / list-ssh-tunnels.sh
Created April 16, 2015 10:21
List SSH tunnels
sudo lsof -i -n | egrep '\<ssh\>'
@carlessistare
carlessistare / clear-memory-cache.sh
Created October 29, 2013 16:54
Clear memory cache linux
sudo su
sync; echo 3 > /proc/sys/vm/drop_caches
@carlessistare
carlessistare / remove_npm_modules_global.sh
Created October 4, 2013 12:45
This removes all npm modules globally
npm -g ls | grep -v 'npm@' | awk '/@/ {print $2}' | awk -F@ '{print $1}' | xargs npm -g rm
@carlessistare
carlessistare / is_float.js
Created October 2, 2013 15:14
Is float is int
function isInt(n)
{
return n != "" && !isNaN(n) && Math.round(n) == n;
}
function isFloat(n){
return n != "" && !isNaN(n) && Math.round(n) != n;
}
@carlessistare
carlessistare / update_puppet_locally
Created September 17, 2013 16:32
Update puppet catalog locally
sudo puppet apply --modulepath=/opt/node/puppet/modules /opt/node/puppet/manifests/ini.pp
sudo puppet apply --modulepath=/vagrant/puppet/modules /vagrant/puppet/manifests/ini.pp
@carlessistare
carlessistare / tuning_nginx_nodejs
Created September 2, 2013 20:34
Tuning Nginx for heavy loading with nodejs as upstream. Short requests and a lot of concurrence.
# This number should be, at maximum, the number of CPU cores on your system.
# (since nginx doesn't benefit from more than one worker per CPU.)
worker_processes 8;
# Determines how many clients will be served by each worker process.
# (Max clients = worker_connections * worker_processes)
# "Max clients" is also limited by the number of socket connections available on the system (~64k)
# run ss -s and u'll see a timewait param
# The reason for TIMED_WAIT is to handle the case of packets arriving after the socket is closed.