Skip to content

Instantly share code, notes, and snippets.

@pcurylo
pcurylo / enable_pst.txt
Created May 28, 2019 15:04
When Outlook PSTs are blocked
HCKU\Software\Policies\Microsoft\office\16.0\outlook\disablepst
@pcurylo
pcurylo / get_travel_warnings
Created February 10, 2017 18:16
Get Travel Warnings
#!/bin/bash
# acquires and cleans travel warnings from US State Department
curl 'https://travel.state.gov/content/passports/en/alertswarnings.html' \
| tr "\n" "|" \
| grep -o '<table.*</table>' \
| tr "|" "\n" \
| sed 's/^[\ \t]*//g' \
| tr -d '\n\r' \
| sed 's/\(<[^>]*>\)\s*\([^>]*\)\s*\(<\/[^>]*>\)/\1\2\3/Ig' \
| sed 's/<\/TR[^>]*>/\n/Ig' \
@pcurylo
pcurylo / get_country_codes
Created February 10, 2017 17:19
Country Codes
#!/bin/bash
# acquires and cleans country codes
curl 'http://www.worldatlas.com/aatlas/ctycodes.htm' \
| tr "\n" "|" \
| grep -o '<table.*</table>' \
| tr "|" "\n" \
| tr -d '\n\r' \
| sed 's/\(<[^>]*>\)\s*\([^>]*\)\s*\(<\/[^>]*>\)/\1\2\3/Ig' \
| sed 's/<\/TR[^>]*>/\n/Ig' \
| sed 's/<\?\(TABLE\|TBODY\|TR\)[^>]*>//Ig' \
@pcurylo
pcurylo / install_horizon_2_fedora
Last active April 7, 2023 10:59
VMWare Horizon Client on Fedora
VMWare Horizon 4.3 On Fedora64
Prepare the client workstation
Update all installed packages
sudo dnf upgrade (or sudo dnf install fedora-upgrade; sudo fedora-upgrade)
sudo dnf update
Need the following packages/libraries
RDesktop v1.7.0
sudo dnf install rdesktop
@pcurylo
pcurylo / install_horizon_2_ubuntu
Last active December 5, 2020 05:24
VMWare Horizon Client 4.3.0 on Ubuntu 16.04
VMWare Horizon 4.3 On Ubuntu 16.04
Prepare the client workstation
Update all installed packages
sudo apt-get update
sudo apt-get upgrade -y
(or sudo apt-get update && sudo apt-get upgrade -y)
Find package containing a file: dpkg [-S | --search] *filename*
Find out if package is installed: apt-cache policy pkgname*
@pcurylo
pcurylo / setup_openssh.sh
Last active January 30, 2017 00:11
Setup OpenSSH on Ubuntu
#!/bin/bash
#source: https://wiki.mozilla.org/Security/Guidelines/OpenSSH#Modern_.28OpenSSH_6.7.2B.29
#source: manpage
#source: http://www.tedunangst.com/flak/post/new-openssh-key-format-and-bcrypt-pbkdf
#source: https://blog.g3rt.nl/upgrade-your-ssh-keys.html
YEL='\033[1;33m'
RED='\033[1;31m'
GRN='\033[1;32m'
@pcurylo
pcurylo / ssh-check-keys.sh
Created January 3, 2017 04:27
Check SSH key lengths
#!/bin/bash
files=$@
for keyfile in $files; do ssh-keygen -l -f "${keyfile}"; done | uniq
@pcurylo
pcurylo / kali_dhcpd
Created January 2, 2017 00:42
Add DHCPD to Kali
#!/usr/bin/env view
command prefixes: $ normal user; # sudo
file contents between ............
check if dhcpd installed
$ apt --list|grep isc-dhcp-server
if not, install it
# apt-get install isc-dhcp-server -y
@pcurylo
pcurylo / add_wifi_nic_to_server.txt
Last active February 20, 2017 00:10
Add WiFI NIC to Ubuntu server
Network work via CL
iw replaces iwconfig
ip replaces ifconfig, route
systemd --> networkctl list;
Check if hardware is detected
# lshw [-class network | -C network]
$ ls /sys/class/net
$ lsusb
$ lspci
PowerShell - already on Win7+
-create profile folder ~/Documents/WindowsPowershell/
-create modules folder ~/Documents/WindowsPowershell/Modules
-Keep this handy: http://technet.microsoft.com/en-us/library/ee692764.aspx
-recommend
installing Chocolatey: http://chocolatey.org/ (you'll need something like CPAN for Perl to keep track of PS stuff and other things)
to install:
cmd.exe> @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin - See more at: http://chocolatey.org/#sthash.5KjLIpD5.dpuf
IMPORTANT NOTE: You can install apps through Chocolatey as .Install or not (.Install shows up in Windows Add/Remove Pgm; the other is "portable")
See the following for more info: