Skip to content

Instantly share code, notes, and snippets.

@pmolchanov
pmolchanov / sd-fbn-search
Created October 14, 2015 21:34
San Diego Fictitious Business Name search from the command line!
@pmolchanov
pmolchanov / ExecWithFileMonitoring.sh
Created December 5, 2015 14:24
Run a command and see what files were changed
find / -xdev -printf '%p\t%c\n' | sort > /tmp/before
# Do some command here!!!
find / -xdev -printf '%p\t%c\n' | sort > /tmp/after
diff -u /tmp/before /tmp/after | less
rm /tmp/before
rm /tmp/after
@pmolchanov
pmolchanov / bathroom-break
Last active March 8, 2016 04:44
Stream WebCam over HTTP using VLC to android smartphone for bathroom break
#!/usr/bin/env bash
# sudo apt-get install qrencode
# sudo apt-get install imagemagick
port=8080
# Lock screen in 10 seconds
(sleep 10; gnome-screensaver-command -l) &
@pmolchanov
pmolchanov / ChromeSilentInstall.ps1
Created July 6, 2016 14:20
Silent chrome install via PowerShell
&{
(New-Object System.Net.WebClient).DownloadFile("http://dl.google.com/chrome/install/chrome_installer.exe", "$env:TEMP\chrome_installer.exe")
& "$env:TEMP\chrome_installer.exe" /silent /install
}
@pmolchanov
pmolchanov / ListAllIISWebsites
Created July 18, 2016 21:06
Lists all IIS websites in URL form
Import-Module Webadministration
Get-ChildItem -Path IIS:\Sites | Where-Object { $_.State -eq 'Started' } | ForEach-Object { $_.Bindings.Collection } | ForEach-Object { $_.Protocol + '://' + $_.BindingInformation.Split(":")[2] } | Sort-Object
@pmolchanov
pmolchanov / ubuntu15.10-command-line-install-android-sdk
Last active August 26, 2016 12:14 — forked from wenzhixin/ubuntu14.04-command-line-install-android-sdk
Ubuntu 15.10 command line install android sdk
# install openjdk
sudo apt-get install openjdk-7-jdk
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
# install all sdk packages
@pmolchanov
pmolchanov / sslcertinfo.sh
Created February 8, 2016 04:07
Get SSL certificate info
#!/usr/bin/env bash
echo -n "Enter the host name and press [ENTER]: "
read host
echo | openssl s_client -connect $host:443 2>/dev/null | openssl x509 -noout -text
@pmolchanov
pmolchanov / FindLargeFiles.ps1
Created April 1, 2015 22:29
Finds large files on your C: drive
Get-ChildItem C:\ -Recurse -ErrorAction 'silentlycontinue' | Where-Object {$_.Length -gt 100MB} | Sort-Object -Property Length -Descending | Select-Object -First 10 | Format-Table -AutoSize -Wrap -Property FullName,Length | Out-String -Width 4096 | Out-File "foo.txt"
@pmolchanov
pmolchanov / netcathttp.sh
Created March 5, 2016 18:40
Simple NetCat HTTP server
while true ; do echo -e "HTTP/1.1 200 OK\n\n $(date)" | nc -l -p 1500 ; done
@pmolchanov
pmolchanov / ImportSSLCert.ps1
Created July 6, 2016 17:06
Import SSL Certificate
&{
# Select PFX file dialog
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
$OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog
$OpenFileDialog.Title = "Select SSL Certificate in PFX format"
$OpenFileDialog.Filter = "Personal Information Exchange (*.pfx)|*.pfx"
$OpenFileDialog.ShowDialog() | Out-Null
$PFXFile = $OpenFileDialog.FileName
# Get password dialog