Skip to content

Instantly share code, notes, and snippets.

View mayrund's full-sized avatar

May run mayrund

View GitHub Profile
@mayrund
mayrund / uninstall_windows_service.vbs
Created June 8, 2016 12:20
Uninstall Windows Service VBScript
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
("Select * from Win32_Service Where Name = 'Name_Of_Service_You_Want_To_Uninstall_Here'")
For Each objService in colListOfServices
objService.StopService()
objService.Delete()
@mayrund
mayrund / getPortByProcessName.bat
Last active November 19, 2016 19:58
Windows Get Port by Process Name
for /f "tokens=2 delims=," %F in ('tasklist /nh /fi "imagename eq sqlservr.exe" /fo csv') do netstat -oan | findstr %~F
(Note: Please replace % with %% when running in Batch file instead of Command Line)
@mayrund
mayrund / KB2468871
Created December 8, 2015 15:21
Microsoft.Bcl.Async not being able to resolve System.Core version 2.0.5.0.
Please install KB2468871, which solves the issue related to Microsoft.Bcl.Async not being able to resolve System.Core version 2.0.5.0.
See also Issue 8 in the async targeting pack knowledge base.
Here are the direct download links for the fixes, for the x86 and x64 environments:
http://download.microsoft.com/download/2/B/F/2BF4D7D1-E781-4EE0-9E4F-FDD44A2F8934/NDP40-KB2468871-v2-x86.exe
http://download.microsoft.com/download/2/B/F/2BF4D7D1-E781-4EE0-9E4F-FDD44A2F8934/NDP40-KB2468871-v2-x64.exe
@mayrund
mayrund / windows_must_have_apps
Last active November 17, 2015 10:14
# windows must have apps #
# Generic
* Beyond Compare
* grepWin - find and replace tool
* BareTail - A free real-time log file monitoring tool
* TreeSize Free - Quickly Scan Directory Sizes and Find Space Hogs
* Lockhunter - release locked files
* CDBurnerXP - burn cd/dvd and create iso files
* VirtualCloneDrive - mount iso files
* WinRAR / 7zip
mkdir projectName
cd projectName
virtualenv --no-site-package venv
pip install flask
touch app.py
mkdir static
mkdir templates
@mayrund
mayrund / removeWord.js
Created August 4, 2015 14:34
remove text from json collection
function transform(data) {
// filter functions are passed the whole API response object
// you may manipulate or add to this data as you want
// query parameters exist in the global scope, for example:
// http://www.kimonolabs.com/apis/<API_ID>/?apikey=<API_KEY>&myparam=test
// query.myparam == 'test'; // true
function removeWord(text, wordToRemove) {
text = text.replace(wordToRemove, '')
virtualenv --distribute venv
source venv/bin/activate
pip install scrapy-redis
git clone https://github.com/darkrho/scrapy-redis.git
cd scrapy-redis
python setup.py install
require 'socket'
def tcpconnect(username, password)
temp_data = ''
begin
s = TCPSocket.new($host, 21)
temp_data = s.gets
s.puts("USER #{username}\r\n")
@mayrund
mayrund / osx_cli_tricks
Created July 14, 2015 16:11
osx CLI tricks
# list all open network connections by PID
lsof -i | grep -E "(LISTEN|ESTABLISHED)"
@mayrund
mayrund / Logwatch installation
Created July 10, 2015 15:01
Logwatch installation
apt-get install logwatch
vim /etc/cron.daily/00logwatch
add this line:
/usr/sbin/logwatch --output mail --mailto test@gmail.com --detail high