Skip to content

Instantly share code, notes, and snippets.

🌴
Apa?

Soheil Rashidi soheilpro

View GitHub Profile
@soheilpro
soheilpro / example.sh
Last active Mar 22, 2019
Easy IIS log file format specification for goaccess.
View example.sh
goaccess -f u_ex150629.log --log-format "$(cat u_ex150629.log | ./goiisformat.sh)" --date-format '%Y-%m-%d' --time-format '%H:%M:%S'
@soheilpro
soheilpro / gitreplace.sh
Created Mar 25, 2014
Replace string in all Git history.
View gitreplace.sh
git filter-branch --tree-filter "find . -name '*.*' -exec sed -i '' -e 's/OLDSTRING/NEWSTRING/g' {} \;" -f
View gist:c35ab5717ffa90f4d5b99d6361d9aefd
POST /sql-2018.8.20/_analyze
{
"field": "query_base.keyword",
"text" : "foo"
}
@soheilpro
soheilpro / request.json
Created Aug 21, 2018
Elasticsearch Index Template
View request.json
PUT _template/sql
{
"template": "sql-*",
"mappings": {
"event": {
"properties": {
"query_base": {
"type": "text",
"fields": {
"keyword": {
View attack.js
#!/usr/bin/env node
var http = require('http');
if (process.argv.length <= 2) {
console.log('Usage: node attack.js <ip[:port]> <connections>')
return;
}
var address = process.argv[2];
@soheilpro
soheilpro / NSObject+Retry.h
Created May 24, 2013
A simple Objective-C category for retrying a block for n number of times.
View NSObject+Retry.h
@interface NSObject (Retry)
- (void)for:(NSInteger)times timesTryBlock:(void(^)(void(^)(NSError*)))block;
- (void)for:(NSInteger)times timesTryBlock:(void(^)(void(^)(NSError*)))block callback:(void(^)(NSError* error))callback;
@end
View bars.json
[
{
"time": 1438415960000,
"open": 2570,
"high": 2630,
"low": 2513,
"close": 2522,
"volume": 1336207
},
{
View keybase.md

Keybase proof

I hereby claim:

  • I am soheilpro on github.
  • I am soheilpro (https://keybase.io/soheilpro) on keybase.
  • I have a public key whose fingerprint is EEA6 88EB 1846 D21A 94FE 61BC 5CD3 FD19 5F77 2375

To claim this, I am signing this object:

View command.sh
git config --global alias.fu = "!f() { git commit --fixup $1; EDITOR=cat git rebase --interactive --autosquash $1~; }; f"
@soheilpro
soheilpro / ping.sh
Created Jul 29, 2015
Simple web site monitoring script.
View ping.sh
#!/usr/bin/env bash
DATE=$(TZ=Asia/Tehran date +"%Y-%m-%d %H:%M")
TIMESTAMP=$(TZ=Asia/Tehran date +"%Y%m%d%H%M")
# URLs
URLS=(
"google|https://www.google.com"
"wikipedia|https://www.wikipedia.org"
You can’t perform that action at this time.