Skip to content

Instantly share code, notes, and snippets.

@royharoush
royharoush / runinscreen
Created January 30, 2017 14:27
run a commad in screen without opening screen
screen -S 'client1' -d -m dnmap_client -s 127.0.0.1 -p 46001
#!/bin/bash
#wget https://gist.githubusercontent.com/royharoush/f4c26a20eb6db711c2fa73a5db89e4b6/raw/31e1a6dec164418d45fd8e52b7d794359d7cae57/bash_completion_tmux.sh -O /etc/bash_completion.d/tmux_completion.sh
# tmux completion
# See: http://www.debian-administration.org/articles/317 for how to write more.
# Usage: Put "source bash_completion_tmux.sh" into your .bashrc
# Based upon the example at http://paste-it.appspot.com/Pj4mLycDE
_tmux_expand ()
{
[ "$cur" != "${cur%\\}" ] && cur="$cur"'\';
#drivers http://www.gc14.com/hcon/downloads/USB-IntelAndGenericDrivers.rar
#the sources folder in windows installation contains a bad copy of dism, so we need to ponit directly at the windows 7 dism version.
mkdir c:\temp\mount1
cd d:\sources\
C:\Windows\SysWOW64\Dism.exe /mount-wim /wimfile:boot.wim /index:2 /mountdir:c:\temp\mount1
cd d:\sources\drivers
C:\Windows\SysWOW64\Dism.exe /image:c:\temp\mount1 /Add-Driver /driver:d:\sources\drivers /recurse
C:\Windows\SysWOW64\Dism.exe /unmount-wim /mountdir:c:\temp\mount1\ /commit
@royharoush
royharoush / backup.sh
Created July 18, 2017 09:17
backup all text files in /root folder
find /root -size -20M -exec file {} \; | grep ".*: .* text" | sed "s;\(.*\): .* text.*;\1;" > kalibackup.list && tar cvzf /mnt/hgfs/VMSharedFolder/en/kali-`date '+%m%d%y'`.tar.gz --files-from=kalibackup.list
[Commands]
1\Name=Unpin
1\Command="
copyq: plugins.itempinned.unpinData()
"
1\Input=application/x-copyq-item-pinned
1\InMenu=true
1\Icon=\xf08d
1\Shortcut=ctrl+shift+p
2\Name=Pin
#!/bin/bash
# update apt-get
export DEBIAN_FRONTEND="noninteractive"
sudo apt-get update
# remove previously installed Docker
sudo apt-get purge lxc-docker*
sudo apt-get purge docker.io*
@royharoush
royharoush / testPort.ps1
Created November 15, 2017 11:58
a quick script to test for open ports, use by importing the module then calling with ip and port
function Test-Port($hostname, $port)
{
# This works no matter in which form we get $host - hostname or ip address
try {
$ip = [System.Net.Dns]::GetHostAddresses($hostname) |
select-object IPAddressToString -expandproperty IPAddressToString
if($ip.GetType().Name -eq "Object[]")
{
#If we have several ip's for that address, let's take first one
$ip = $ip[0]
#!/bin/bash
# update apt-get
export DEBIAN_FRONTEND="noninteractive"
sudo apt-get update
# remove previously installed Docker
sudo apt-get remove docker docker-engine docker.io* lxc-docker* -y
# install dependencies 4 cert
{
"background": {
"scripts": [ "vendor/jquery-1.7.2_min.js", "vendor/encoder.js", "background.js" ]
},
"browser_action": {
"default_icon": "img/umbrella_19.png",
"default_popup": "popup.html",
"default_title": "Copy URLs to clipboard"
},
"commands": {
@royharoush
royharoush / commonport.sh
Last active December 9, 2018 08:05
get most commonly used ports from nmap
cat /usr/share/nmap/nmap-services | grep -i tcp| sort -k 3 -n -r | awk '{print $2}' | cut -d"/" -f1 | head -500
cat /usr/share/nmap/nmap-services | grep -i tcp| sort -k 3 -n -r | awk '{print $2}' | cut -d"/" -f1 | head -500 > ports