Skip to content

Instantly share code, notes, and snippets.

@stamm
stamm / docker-compose.json
Created April 16, 2018 15:04
Docker compose for vpn and socks proxy
version: "3"
services:
sockd:
image: stamm/docker-dante:1.0
env_file: socks.env
ports:
- "8088:8088"
restart: always
vpn:
image: "hwdsl2/ipsec-vpn-server"
@stamm
stamm / golang_parse_goroutines_dump.rb
Last active February 3, 2017 10:17
Parse goroutines dump (get by kill -6 PID) and group by count of file:line
contents = File.read('goroutines_dump.txt')
p = contents.scan(/goroutine\s(\d+).+?^\t(\S+\.go:\d+)/m)
counts = Hash.new(0)
p.each do |el|
counts[el[1]] += 1
end
puts counts.sort_by { |k,v| -v }
@stamm
stamm / wanted
Created January 29, 2015 14:04
Хотелки для 0xDBE
* Редактор схемы целиком (индексов, check, триггеров) таблицы, а не по отдельности, как сейчас
* Сохранение запросов с именами (типо закладок)
* Сохранение Filter Criteria тоже с именами
* Отчищение таблицы по клику из меню
* Возможность сделать копии таблицы (только схему или с данными) через меню
* Экспорт/Импорт
@stamm
stamm / install_phpbrew.sh
Created October 6, 2014 07:48
install php
phpbrew install 5.6.1 +default +openssl +opcache +dbs +intl +fpm
@stamm
stamm / disable_frame.js
Created September 23, 2014 09:30
Disable show page in frame
if (top != self) {
var enable = ["example.com","dev.example.com"];
var ourPage = false;
var hostname = document.referrer.split("/")[2].split(":")[0];
for (var i=0; i < enable.length; i++) {
if (hostname == enable[i] || hostname == "www." + enable[i]) {
ourPage = true;
break;
}
}
@stamm
stamm / find_symlinks
Last active August 29, 2015 14:06
Find symlinks in directory
@stamm
stamm / scan.rb
Last active August 29, 2015 14:05
find files with russian symbols
Dir['/path/to/**/*'].select do |path|
[*'а'..'я', 'е', 'ё'].any? { |char| path.downcase.count(char) > 0 }
end
@stamm
stamm / maintenance.html
Created April 6, 2014 14:52
Maintenance page
<!DOCTYPE html>
<html>
<head>
<title>Site is down for maintenence - [Client Name]</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
####### PHP 5.4.23 BENCHMARK #######
Start : 12/24/2013 16:49:12 pm
Server : @
Platform : Darwin
PHP version: 5.4.23
####################################
for : 0.02550 sec
while : 0.01702 sec
if else : 0.08580 sec
switch : 0.11273 sec
@stamm
stamm / vk_remove_all_from_wall.js
Created August 8, 2013 18:27
Remove all from your wall. 1) repeatedly press end on your wall. 2) insert this code in google chrome console and press enter
var posts=$$('.post_delete_button'), length = posts.length; for (i=0; i <length; i++) { posts[i].click() }