Skip to content

Instantly share code, notes, and snippets.

@cdolek
cdolek / gist:89e24d71ce1a63c16e2d
Last active August 29, 2015 14:14
collecting vimeo video titles and links from vimeo.com // works on console
// paste
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// wait and paste
jQuery.noConflict();
// each paste will print the list on console, copy and paste + remove unnecessary lines
var a = jQuery('#browse_content li a');
@cdolek
cdolek / gist:b72c81f813f03b043e37
Last active August 29, 2015 14:09
apache exclude static assets from access log
SetEnvIf Request_URI "\.gif$|\.jpg$|\.js$|\.css$|\.ico$|\.png$|\.ttf$|\.woff$|\.eot$|\.svg$|\.jpeg$|\.txt$" is_static
CustomLog /var/yourlogs/apache.access_log combined env=!is_static
@cdolek
cdolek / gist:a015abc3c09808fb14b7
Created October 31, 2014 00:50
haproxy v0.5 configuration for mysql cluster load balancing
global
log 127.0.0.1 local0 notice
chroot /var/lib/haproxy
user haproxy
group haproxy
# daemon
defaults
log global
# mode http
@cdolek
cdolek / template-worker.php
Last active August 29, 2015 14:01
Download attached images from a wordpress blog and save them into folders based on post title under uploads dir
<?php
/**
* Template Name: worker
*/
$args = array(
'posts_per_page'=> '-1',
'post_type'=> 'post',
'post_status' => array('publish'),
'order' => 'ASC',
@cdolek
cdolek / linux_command_line_cheatsheet.txt
Last active December 24, 2015 21:49
linux command line cheatsheet
# kill multiple processes using keyword
kill -9 `ps -ef | grep keyword | grep -v grep | awk '{print $2}'`
# upgrade everything on debian
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade && sudo apt-get -y autoremove
apt-get update && apt-get -y upgrade && apt-get -y dist-upgrade && apt-get -y autoremove
# viewing a user's ulimit's on debian (check /etc/security/limits.conf and /etc/pam.d/su)
su mysql -s /bin/sh -c "ulimit -a"