Skip to content

Instantly share code, notes, and snippets.

View isa's full-sized avatar
☀️
Working, whatd'ya think..

Isa Goksu isa

☀️
Working, whatd'ya think..
View GitHub Profile
#!/bin/sh
# The bandwidth to simulate, here about 56kilobit per second. This is layer 2 bandwidth, so TCP/UDP and IP overhead will apply
BW="56kbps"
# _Half_ the latency that we aim for. Since this applies to both the WAN port and Wi-Fi, the delay is applied twice, so this actually puts it at around 120+ms
LATENCY="60ms"
# Chance of packet loss. Also applied to both interfaces, so it is 1%.
LOSS="0.5%"
# The device name of your wifi device.
WIFI="wlan0"
@isa
isa / ds
Last active August 29, 2015 14:09
Directory Usage script made pure with Unix functions
#!/bin/sh
find ${1:-.} -type f -exec ls -lnq {} \+ | awk '
function pp() {
u="+Ki+Mi+Gi+Ti";
split(u,unit,"+");
v=sum;
r=0;
for(i=1;i<5;i++) {
if(v<1024) break;
r=v%1024;
@isa
isa / iterm2 colors
Created March 28, 2011 06:14
my iterm2 colors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.27149322628974915</real>
<key>Green Component</key>
<real>0.27149322628974915</real>
@isa
isa / gist:1139163
Created August 11, 2011 08:30
Brew Readline Installation
$ brew install -v readline
==> Downloading ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz
File already downloaded in /Users/isa/Library/Caches/Homebrew
/usr/bin/tar xf /Users/isa/Library/Caches/Homebrew/readline-6.2.1.tar.gz
==> Downloading patches
/usr/bin/curl -f#LA Homebrew 0.8 (Ruby 1.8.7-249; Mac OS X 10.7) ftp://ftp.cwru.edu/pub/bash/readline-6.2-patches/readline62-001 -o 001-homebrew.diff
######################################################################## 100.0%
######################################################################## 100.0%==> Patching
/usr/bin/patch -f -p0 -i 001-homebrew.diff
patching file vi_mode.c
@isa
isa / gist:1557061
Created January 3, 2012 21:36
Perforce p4python module installation
λ sudo easy_install p4python
Password:
Searching for p4python
Reading http://pypi.python.org/simple/p4python/
Reading http://public.perforce.com/guest/robert_cowham/perforce/API/python/index.html
Best match: p4python [unknown version]
Downloading ftp://ftp.perforce.com/perforce/r11.1/bin.tools/p4python.tgz
Processing p4python.tgz
Running p4python-2011.1.389946/setup.py -q bdist_egg --dist-dir /tmp/easy_install-nMvjJm/p4python-2011.1.389946/egg-dist-tmp-UF4I0y
Cannot find Version file in API dir or distribution dir.
@isa
isa / gist:1576855
Created January 8, 2012 02:01
jinja2 template
{% extends "layout.html" %}
{% block title %}Order Management Team{% endblock %}
{% block head %}
{{ super() }}
{% endblock %}
{% block header %}
<h1><span>Current Team Members</span> <a>¶</a> <a href="{{ url_for('.list_services')}}" class='home'>Go Back &raquo;</a></h1>
{% endblock %}
{% block content %}
<p>The following little facebook should explain who is doing what in the team :) Names are in alphabetical order but my name:P If your picture is missing, please do contact to <strong>Isa Goksu</strong>.</p>
@isa
isa / gist:1641809
Created January 19, 2012 18:51
Stupid powershell returns object[] instead of string
function Trigger-Builds($WaitForCore = $True) {
$ServiceUrl = 'http://jenkins:8080/job/e3.components.omt.services.OrderService.v1.1'
$LastServiceBuildNumber = Get-LastSuccessfulBuildNumber "$ServiceUrl/rssAll"
$ServiceVersion = 0
$ServiceBuildResult = Trigger-Build "$ServiceUrl/build"
Write-Host "Building service now.."
while ($ServiceBuildResult) {
Sleep -Seconds 20
@isa
isa / gist:1776924
Created February 9, 2012 03:09
Powershell Awkwardness
C:\>$files = (gci -Recurse | Where { $_.Name -eq "some.file" }
C:\>$files.Length # prints 45
C:\>$files | %{ $_.FullName } # displays each file name properly
C:\>$files | %{ Get-Content $_ } # prints the first file content 45 times WTF?
@isa
isa / gist:1794653
Created February 11, 2012 00:49
new-webserviceproxy
$service = new-webserviceproxy -uri http://xxx/service?wsdl -Namespace com
$request = new-object com.ExecuteTestsResponseType
$service.executeTests($request)
you get this:
Cannot convert argument "0", with value: "com.ExecuteTestsRequestType", for "executeTests" to type "com.ExecuteTestsRequestType": "Cannot convert the "com.ExecuteTestsRequestType" value of type "com.ExecuteTestsRequestType" to type "com.ExecuteTestsRequestType"."
At line:1 char:18
+ $xxx.executeTests <<<< ($request)
+ CategoryInfo : NotSpecified: (:) [], MethodException
@isa
isa / gist:1982808
Created March 6, 2012 01:48
Windows Command Prompt Failures
1- Proper selections (like not everything is block, sometimes I wanna select a command that wraps to next line)
2- Proper copy / paste
3- Allow re-sizing the terminal window with mouse with no limit or blockage. Why is it any different than any other window anyways?
4- Infinite buffer and scrollback capabilities
5- Multiple tab support
6- Proper find dialog where I don't have to click top-left menu-> edit -> search
7- Fucking 256 color support, who supports only 8 colors anymore
Possible shell improvements