Skip to content

Instantly share code, notes, and snippets.

View omarkurt's full-sized avatar
:octocat:
Working from home

OK omarkurt

:octocat:
Working from home
View GitHub Profile
@s4l1h
s4l1h / php-fcgi.sh
Created March 11, 2012 11:54
FAST CGI
#!/bin/bash
#BIND=127.0.0.1:9000
BIND=/tmp/php.socket
USER=www-data
ulimit -v 512000
PHP_FCGI_CHILDREN=15
PHP_FCGI_MAX_REQUESTS=50000
PHP_CGI=/usr/bin/php-cgi
PHP_CGI_NAME=`basename $PHP_CGI`
@s4l1h
s4l1h / php-cgi-ram.sh
Created March 13, 2012 11:10
php-cgi'nin ne kadar ram kullandığı gösterir.
#/bin/sh
total=0; for i in `ps -C php-cgi -o rss=`; do total=$(($total+$i)); done; echo "php-cgi memory usage: $total kb";
@s4l1h
s4l1h / nginx-ram.sh
Created March 13, 2012 11:12
Nginx'in ne kadar ram kullandığı gösterir.
#/bin/sh
total=0; for i in `ps -C nginx -o rss=`; do total=$(($total+$i)); done; echo "Nginx memory usage: $total kb";
@s4l1h
s4l1h / online.sh
Created December 20, 2012 16:17
Sunucuda 80 portuna yapılan istek sayısı ve ip adreslerini görüntüler.
#/bin/sh
netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1
@s4l1h
s4l1h / count.sh
Created December 20, 2012 16:21
Sunucunun 80 portuna istek gönderen unique ip adres sayısını gösterir.
#/bin/sh
netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1|wc -l
@azer
azer / gist:5184224
Created March 18, 2013 00:15
Ömer Hayyam Dörtlükleri
Ey özünün sırlarına akıl ermeyen;
Suçumuza, duamıza önem vermeyen;
Günahtan sarhoştum, ama dilekten ayık;
Umudumu rahmetine bağlamışım ben.
Büyükse de isyanım, kötülüklerim,
Yüce Tanrı'dan umut kesmiş değilim;
Bugün sarhoş ve harap ölsem de yarın
Rahmete kavuşur elbet kemiklerim.
@willurd
willurd / web-servers.md
Last active May 30, 2024 02:54
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@BuffaloWill
BuffaloWill / cloud_metadata.txt
Last active May 25, 2024 21:22
Cloud Metadata Dictionary useful for SSRF Testing
## IPv6 Tests
http://[::ffff:169.254.169.254]
http://[0:0:0:0:0:ffff:169.254.169.254]
## AWS
# Amazon Web Services (No Header Required)
# from http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html#instancedata-data-categories
http://169.254.169.254/latest/meta-data/iam/security-credentials/dummy
http://169.254.169.254/latest/user-data
http://169.254.169.254/latest/user-data/iam/security-credentials/[ROLE NAME]
@eduncan911
eduncan911 / go-build-all
Last active April 11, 2024 07:14
Go Cross-Compile Script
#!/bin/bash
#
# GoLang cross-compile snippet for Go 1.6+ based loosely on Dave Chaney's cross-compile script:
# http://dave.cheney.net/2012/09/08/an-introduction-to-cross-compilation-with-go
#
# To use:
#
# $ cd ~/path-to/my-awesome-project
# $ go-build-all
#
@pgilad
pgilad / json-to-toml.py
Created May 16, 2016 12:56
Convert a json file to toml
#!/usr/bin/env python2
# don't forget to `pip install toml`
import json
import sys
import toml
if len(sys.argv) < 3: raise Exception('Usage is `json_to_toml.py input.json output.toml`')
json_file = sys.argv[1]