Skip to content

Instantly share code, notes, and snippets.

View pavank's full-sized avatar
:octocat:

Pavan Keerthi pavank

:octocat:
View GitHub Profile
@pavank
pavank / Manage Windows Firewall
Last active September 24, 2020 15:58 — forked from ig0774/gist:1068598
Manage Windows Advanced Firewall with PowerShell
Set-StrictMode -Version Latest
# Constants
if (!(Test-Path variable:\NET_FW_DISABLED)) { Set-Variable NET_FW_DISABLED -Option Constant $False }
if (!(Test-Path variable:\NET_FW_ENABLED)) { Set-Variable NET_FW_ENABLED -Option Constant $True }
if (!(Test-Path variable:\NET_FW_IP_PROTOCOL_TCP)) { Set-Variable NET_FW_IP_PROTOCOL_TCP -Option Constant 6 }
if (!(Test-Path variable:\NET_FW_IP_PROTOCOL_UDP)) { Set-Variable NET_FW_IP_PROTOCOL_UDP -Option Constant 17 }
if (!(Test-Path variable:\NET_FW_PROFILE_DOMAIN)) { Set-Variable NET_FW_PROFILE_DOMAIN -Option Constant 0x1 }
if (!(Test-Path variable:\NET_FW_PROFILE_PRIVATE)) { Set-Variable NET_FW_PROFILE_PRIVATE -Option Constant 0x2 }
if (!(Test-Path variable:\NET_FW_PROFILE_PUBLIC)) { Set-Variable NET_FW_PROFILE_PUBLIC -Option Constant 0x2 }
@pavank
pavank / Modify_RDP_Rule.ps1
Created March 24, 2012 11:19
Open Locked out RDP Firewall Rule
<# Take General Parameters from User #>
param([string] $ServerName=(Read-Host -prompt "Please Enter Server Name"),[string] $UserName=(Read-Host -prompt "Please Enter Your User Name"),[string] $Password=(Read-Host -prompt "Please Enter Your Password"))
function Job(){
cls
#Local Firewall
$fw = New-Object -ComObject hnetcfg.fwpolicy2
#Delete Existing Rules
@pavank
pavank / Enabling WinRM HTTPS Listener
Last active April 8, 2019 13:28
Enabling WinRM HTTPS Listener
1)Generate SSL Certificate with one of these options
-CA Authority(e.g:Versign)
-Active Directory Certificate Services
-Self Signed(Not to be used in Production)
Code : cd 'C:\Program Files (x86)\Windows Kits\8.0\bin\x64\'
makecert -r -pe -n "CN=3dmxvm-solar.cloudapp.net " -b 01/01/2012 -e 01/01/2022 -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localMachine -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12
2) Export Certificate in .pfx format to store into Trusted Root Store of Client Machine
3) Enable WinRm Trusted Source IP addresses
@pavank
pavank / List Installed Apps on PC
Last active March 5, 2020 18:32
List out Installed Programs on PC
Get-WmiObject Win32_Product | Sort-Object Name | Select Name,version,Vendor |export-csv myprogramlist.csv
@pavank
pavank / Win 8 Cisco VPN Fix
Last active August 29, 2015 14:00
Windows 8 -Old Cisco VPN Software Error - Fix via Registry Hack
1) Go to path [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\vpnva]
2) There might be some junk characters in the Display name before the word "Cisco....". Delete them
3) the display name should read like "DisplayName"="Cisco AnyConnect VPN Virtual Miniport Adapter for Windows x64"
@pavank
pavank / WinRM Trusted Hosts
Last active January 27, 2017 13:41
WinRM Trusted Hosts
#List existing Hosts
ls WSMan:\localhost\Client\TrustedHosts
#Add new Host
winrm set winrm/config/client '@{TrustedHosts="HostName"}'
@pavank
pavank / copyInstalledPackages.r
Last active December 28, 2018 16:10 — forked from florianhartig/copyInstalledPackages.r
Script to copy the packages installed on one computer or R version to another. Originally from http://stackoverflow.com/questions/1401904/painless-way-to-install-a-new-version-of-r-on-windows
# run on win computer / r version
setwd("C:/Users/pavan/RLibrary/") # or any other existing temp directory
packages <- installed.packages()[,"Package"]
save(packages, file="Rpackages")
# run on ubuntu computer / r version
setwd("/RLibrary") # or any other existing temp directory
load("Rpackages")
for (p in setdiff(packages, installed.packages()[,"Package"]))
@pavank
pavank / sshconfig
Last active June 14, 2024 23:11
Linux Client-OpenSSH Config
# Save file as ~/.ssh/config
# Add permissions chmod 600 ~/.ssh/config
# Optional permissions chmod $USER ~/.ssh/config
##default for all hosts##
Host *
ForwardAgent No
ForwardX11 no
Compression yes
@pavank
pavank / Gunicorn Config
Created May 28, 2019 09:36
Gunicorn Config
"""gunicorn WSGI server configuration."""
from multiprocessing import cpu_count
from os import environ
def max_workers():
return cpu_count() * 2 + 1
# Config Properties
bind = '0.0.0.0:' + environ.get('PORT', '8080')
max_requests = 1000
@pavank
pavank / ubuntu-rocksdb-pyrocksdb
Last active June 25, 2019 08:51
Pyrocksdb Installation
#Install build libraries
sudo apt-get install build-essential libssl-dev libgflags-dev libreadline-dev libsqlite3-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev
#If using Python3.7 via Dead snakes PPA install python3.7-dev
sudo apt-get install python3.7-dev
#Clone repo
git clone https://github.com/facebook/rocksdb.git
#build locally (https://github.com/facebook/rocksdb/blob/master/INSTALL.md)