Skip to content

Instantly share code, notes, and snippets.

View josy1024's full-sized avatar

josef lahmer josy1024

View GitHub Profile
@josy1024
josy1024 / show_old_programs_installdate_before_2010.ps1
Last active December 12, 2015 09:41
show old programs (installed before 2010) #sam
# author: [email protected]
# 2015_12_12
# show old programs: (installdate before 2010PS >
# source: https://gist.github.com/josy1024/d464770253fbab2642ed
# http://josy1024.blogspot.co.at/2015/06/automated-uninstall-of-old-programs.html
Get-WmiObject -Class Win32_Product -ComputerName . | Where-Object -FilterScript {$_.InstallDate -lt "20100000"} | Where-Object -FilterScript {$_.Name -NotLike "windows*"} | Where-Object -FilterScript {$_.Name -NotLike "Microsoft*"} | Where-Object -FilterScript {$_.Name -NotLike "AMD*"} | Where-Object -FilterScript {$_.Name -NotLike "google*"} | Where-Object -FilterScript {$_.Name -NotLike "7-zip*"} |Where-Object -FilterScript {$_.Name -NotLike ""} | Format-List -Property Name,InstallDate
@josy1024
josy1024 / remove_old_programs_before_2010.ps1
Last active December 12, 2015 09:41
remove old programs installed befor 2010
# author: [email protected]
# 2015_12_12
# source: https://gist.github.com/josy1024/c654fccb3d21df0d275d/
# http://josy1024.blogspot.co.at/2015/06/automated-uninstall-of-old-programs.html
#remove old programs:
#PS >
( Get-WmiObject -Class Win32_Product -ComputerName . | Where-Object -FilterScript {$_.InstallDate -lt "20100000"} | Where-Object -FilterScript {$_.Name -NotLike "windows*"} | Where-Object -FilterScript {$_.Name -NotLike "Microsoft*"} | Where-Object -FilterScript {$_.Name -NotLike "AMD*"} | Where-Object -FilterScript {$_.Name -NotLike ""} ).Uninstall()
# remove all microsoft visualstudio programs:( Get-WmiObject -Class Win32_Product -ComputerName . | Where-Object -FilterScript {$_.Name -Like "Microsoft Visual*"} ).Uninstall()
@josy1024
josy1024 / prestageRDP.ps1
Last active January 14, 2016 17:16
prestage remote desktop logons for other users
# prestage remote desktop logons for other users... (have to know passwords #
# author: josef lahmer
#
# USE https://gallery.technet.microsoft.com/scriptcenter/Connect-Mstsc-Open-RDP-2064b10b
# https://gist.github.com/josy1024/917715eef3a87a3c0bf3
# optimisations:
# (would be nice to know if i can store password hashes)? (to avoid clear text passwords)
@josy1024
josy1024 / runtastic_activities_download.js
Last active December 22, 2015 22:17
download runtastic activities in BULK tcx gpx heart rate file
var links = []; $('.type > a').each ( function () {
links.push($(this).attr('href'))
} )
setInterval(function () {
if ( !links.length) { return; }
var link = links.shift();
link += '.tcx';
var newFrame = document.createElement('iframe');
document.body.appendChild(newFrame);
newFrame.style = 'width: 1px; height: 1px;';
@josy1024
josy1024 / tcx2gpx.ps1
Created January 3, 2016 16:43
convert tcx to gpx tracks
#author: josef lahmer
# 3.1.2016
#
# PowerShell.exe -ExecutionPolicy Bypass -File .tcx2gpx.ps1
#
# tcx = garmin training center tcx
# gpx = gpx xml
# depencies
# powershell, gpsbabel from http://www.gpsbabel.org/
@josy1024
josy1024 / tcx2xml.ps1
Created January 6, 2016 19:05
simple file extentsion rename tcx to xml files... powershell
Get-ChildItem -Filter "*.tcx" -Recurse | Rename-Item -NewName {$_.name -replace 'tcx','xml' }
@josy1024
josy1024 / noaccess.sh
Last active January 11, 2016 16:19
searches with in current directory for "not accessable" files puts it out to console and stores it to /tmp/noaccess
#!/bin/bash
# searches with in current directory for "not accessable" files puts it out to console and stores it to /tmp/noaccess
# noaccess no access
#
# author: Josef lahmer
# 11.1.2016
# https://gist.github.com/josy1024/fe39201169f5e3cec115
# http://josy1024.blogspot.co.at/2016/01/mr-robots-noaccess.html
#
# inspired by MR. ROBOT
@josy1024
josy1024 / connect_azure_ad.ps1
Created January 13, 2016 09:13
connect azure (office365 msonline service)
# connect to azure and office365 with powershell
# 2016-01-13
# get password
$cred = Get-Credential
#office365 session
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $cred -Authentication Basic -AllowRedirection
Import-PSSession $Session
@josy1024
josy1024 / kernelupdate.pp
Last active January 20, 2016 15:38
puppet kernel update ensure latest an reboot
#snipplet
package { "at" : ensure => installed }
case $virtual {
"xenu":
{
package { "kernel" :
name => "kernel-xen",
@josy1024
josy1024 / arp_find_who-has_requests.sh
Last active January 25, 2016 10:59
arp find who-has requests with DNS
#!/bin/bash
#
# inspired from: Zeitmanagement für Systemadministratoren Thomas A. Limoncelli
#take a sample of 100 requests...
# -i any (most systems have more than one interface)
tcpdump -i any -l -n arp | grep 'who-has' |head -100 > /tmp/arprequests.txt
# wich sources?
cat /tmp/arprequests.txt | awk '{ print $NF }' | sort | uniq -c | sort -nr