Skip to content

Instantly share code, notes, and snippets.

View koraysaritas's full-sized avatar

Koray Sarıtaş koraysaritas

View GitHub Profile
@koraysaritas
koraysaritas / list-num-ports.ps1
Created October 21, 2019 05:55
List number of open ports
Get-NetTCPConnection | Group-Object -Property State, OwningProcess | Select -Property Count, Name, @{Name="ProcessName";Expression={(Get-Process -PID ($_.Name.Split(',')[-1].Trim(' '))).Name}}, Group | Sort Count -Descending
@koraysaritas
koraysaritas / tfs-checkout-sample.bat
Created September 30, 2019 09:50 — forked from glombard/tfs-checkout-sample.bat
TFS checkout files from a batch file
@echo off
setlocal EnableExtensions
set tfuser=glombard
set tflogin=/login:DOMAIN\%tfuser%,password
set tfworkspace=TFSWorkspace
set tfdir=C:\temp\MyWorkspace
set tfsource=$/PROJ/Source
set tfurl=http://127.0.0.1:8080/tfs/TEAM/
@koraysaritas
koraysaritas / tfs-checkout-sample.bat
Created September 30, 2019 09:50 — forked from glombard/tfs-checkout-sample.bat
TFS checkout files from a batch file
@echo off
setlocal EnableExtensions
set tfuser=glombard
set tflogin=/login:DOMAIN\%tfuser%,password
set tfworkspace=TFSWorkspace
set tfdir=C:\temp\MyWorkspace
set tfsource=$/PROJ/Source
set tfurl=http://127.0.0.1:8080/tfs/TEAM/
@koraysaritas
koraysaritas / pyc2py
Created September 20, 2019 15:41
pyc2py
forfiles /s /p C:\Users\koray\Desktop\Scripts /m *.pyc /c "cmd /c uncompyle6 -o @path.py @path
@koraysaritas
koraysaritas / eventListener.js
Created July 24, 2019 14:11 — forked from shayanb/eventListener.js
simple NodeJS app to display triggered events on a smart contract
// This is a simple NodeJS app to display triggered events on a smart contract
// you need your contract ABI and deployed address and also a synced geth running
// github.com/shayanb
var optionsABI = [YOUR_CONTRACT_ABI]
var contractAddress = "0xYOUR_CONTRACT_ADDRESS"
var Web3 = require('web3');
@koraysaritas
koraysaritas / mac-clear-icon-cache.sh
Created July 12, 2019 19:59 — forked from ismyrnow/mac-clear-icon-cache.sh
Clear the icon cache on a Mac when you start seeing generic icons in Finder or the Dock
sudo rm -rfv /Library/Caches/com.apple.iconservices.store; sudo find /private/var/folders/ \( -name com.apple.dock.iconcache -or -name com.apple.iconservices \) -exec rm -rfv {} \; ; sleep 3;sudo touch /Applications/* ; killall Dock; killall Finder
#!/usr/local/bin/python3
from itertools import count
def stop():
raise StopIteration
every15 = set()
list(stop() if (n % 1000) in every15 else every15.add(n % 1000) for n in count(1, step=15))
print(1000 - len(every15))
@koraysaritas
koraysaritas / ht.py
Last active October 22, 2017 16:09
ht
from urllib import parse
from bs4 import BeautifulSoup
elem = '<a title="Sakura Sakura Onsen" href="https://www.google.com/maps?ll=31.8623230000,130.8571860000&amp;spn=0.006130,0.009795&amp;t=k&amp;hl=en">3 BLUE</a>'
# ll
split = parse.urlsplit(elem)
qs = parse.parse_qs(split.query)
ll = qs['ll'][0].split(',')
0x54CDb5A0303480fb10Fb9163D51785955764e8B8
@koraysaritas
koraysaritas / osquery.txt
Last active May 16, 2017 07:18
Processes which have open network sockets
-- C:\WINDOWS\system32>echo select p.name, p.pid, s.local_address, s.local_port, s.remote_address, s.remote_port from process_open_sockets s join processes p on p.pid = s.pid; | osqueryi
osquery> select p.name, p.pid, s.local_address, s.local_port, s.remote_address, s.remote_port from process_open_sockets s join processes p on p.pid = s.pid;
-- https://osquery.io/docs/tables/#process_open_sockets
-- https://osquery.io/docs/tables/#processes
+------------------------------+-------+---------------------------+------------+---------------------------+-------------+
| name | pid | local_address | local_port | remote_address | remote_port |
+------------------------------+-------+---------------------------+------------+---------------------------+-------------+