Skip to content

Instantly share code, notes, and snippets.

Jerry Uanino juanino

View GitHub Profile
@juanino
juanino / getinstalledapps
Created Jan 22, 2019
powershell list of installed apps
View getinstalledapps
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize
@juanino
juanino / gist:d88f70bf8b37017fa51a8d3b7ac04908
Created Sep 10, 2017
post to dweet.io with a curl line
View gist:d88f70bf8b37017fa51a8d3b7ac04908
# post json to dweet.io
curl \
--header "Content-Type:application/json" \
--header "Accept: application/json" \
--request POST \
--data '{"temp_last":"2:3:aa","temp":"20"}' \
https://dweet.io/dweet/for/DWEETname
@juanino
juanino / gist:e8043be04cec2dadbbb5202bf9a6e29a
Created Sep 4, 2017
check ansible yml file for package existence in raspian (or any apt system for that matter)
View gist:e8043be04cec2dadbbb5202bf9a6e29a
# problem: you have a bunch of files in some ansible playbook but some don't exist
# solution: apt-cache show each of them and check return code $?
cat pi-base.yml | grep "\- " | grep -v name\: | grep -v hosts\: | sed 's/.*- //g' | awk {'print "echo -n " $1 " ; apt-cache show " $1 " 1>/dev/null ;echo \" \" $?" '} | sh | tee /tmp/output
@juanino
juanino / lstags.sh
Created Dec 13, 2016
get a listing of aws instances and name and project tags
View lstags.sh
/usr/bin/aws ec2 describe-instances --output table --query 'Reservations[].Instances[].[join(`,`,Tags[?Key==`Name`].Value),State.Name,PublicIpAddress,join(`,`,Tags[?Key==`project`].Value),join(`,`,Tags[?Key==`aws:ec2spot:fleet-request-id`].Value)]'
@juanino
juanino / gist:2beaddc294b30cc877e6
Created Jan 28, 2016
when does my machine think a timezone change occurs
View gist:2beaddc294b30cc877e6
# pass your own location
# syntax of name is in /usr/share/zoneinfo/ usually
zdump -v "America/New_York"
@juanino
juanino / py big ls
Last active Nov 6, 2016
do an ls in a huge dir and print out a shell script to remove. better than shell globbing
View py big ls
# when you have millions of files
# this is faster than ls if you don't need the other metadata
# like mod times or perms
from os import listdir
files = listdir(".")
# here we can output the giant list with some rm commands
# then you can pipe it to sh -x to perform the operations you wawnt
# or grep out the noise first
You can’t perform that action at this time.