Skip to content

Instantly share code, notes, and snippets.

View controlzone's full-sized avatar

Greg controlzone

  • Canberra, Australia
View GitHub Profile
@controlzone
controlzone / sshkeys
Created January 11, 2024 22:28
Set up ssh keys
## Check for existing keys
ls -al ~/.ssh/id_*.pub
## If none, generate new key pair
ssh-keygen -t rsa -b 4096 -C "some comment, email etc"
>enter filename
>enter optional passphrase
## Copy public key to server
ssh-copy-id remoteuser@remotehost
@controlzone
controlzone / replace linux password
Created January 11, 2024 22:06
Replace unknown linux password
Mount the unknown password disk
$ openssl password -5 newpassword
copy result
$ sudo nano /media/user/rootfs/etc/shadow
Replace the unknown hash with the generated one from above
Save, exit, eject
Mount disk in original host, ssh with known user/pass combo
Enable SSH keys
# add aliases to .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias ll='ls -alF'
alias ls='ls --color'
alias grep='grep --color=auto'
@controlzone
controlzone / DIYmore Soil Temp Sensor Pin Out
Last active October 12, 2022 10:34
DIY More Soil Temp Sensor Pin Out
https://www.diymore.cc/products/esp32-wifi-bluetooth-cp2104-dht11-soil-temperature-humidity-sensor-18650-battery-base?_pos=6&_sid=91018e42a&_ss=r
Similar (original?) module
https://github.com/Xinyuan-LilyGO/LilyGo-HiGrow/blob/master/src/configuration.h
GPIO Function
0 Boot
1 U0.Tx (USB)
2 IO2
3 U0.Rx (USB)
cmdkey /generic:TERMSRV/server01 /user:Test /pass:PW
mstsc /v:server01
/delete:TERMSRV/server01
::Use /generic when not part of a domain
:: Create Ad Hoc Wireless Network
:: ==============================
:: netsh wlan set hostednetwork mode=allow ssid=myssid key=mypasskey
:: netsh wlan start hostednetwork
:: change ssid= and key=
netsh wlan set hostednetwork mode=allow ssid=myssid key=mypasskey
netsh wlan start hostednetwork
pause
:: end
@controlzone
controlzone / Get wlan psk
Created August 1, 2019 05:20
Show psk of saved wifi
netsh wlan show profile name="MySSID" key=clear | findstr /I "key name"
@controlzone
controlzone / Excel-Pwd-Remover.vba
Last active July 10, 2018 11:18
Removes passwords from protected excel sheets.
'https://www.ablebits.com/office-addins-blog/2016/02/10/protect-unprotect-excel-sheet-password/
'save as module in excel vba
Sub PasswordBreaker()
'Breaks worksheet password protection.
Dim i As Integer, j As Integer, k As Integer
Dim l As Integer, m As Integer, n As Integer
Dim i1 As Integer, i2 As Integer, i3 As Integer
Dim i4 As Integer, i5 As Integer, i6 As Integer
@controlzone
controlzone / DALI Status
Created April 20, 2018 12:28
DALI commands and statuses
Standard ECGs
Bit 0: status of ballast; 0 = OK
Bit 1: lamp failure; 0 = OK
Bit 2: lamp arc power on; 0 = OFF
Bit 3: limit error; 0 = "last requested power was OFF or was between MIN..MAX LEVEL"
Bit 4: fade ready; 0 = ready, 1 = running
Bit 5: reset state? 0 = NO
Bit 6: missing short address? 0 = NO
Bit 7: power failure? 0 = "RESET" or an arc power control command has been received since the last power-on
::/C/ProgramData/Microsoft/Windows/Start Menu/Programs/Startup
::nslookup myip.opendns.com resolver1.opendns.com > "C:\Documents and Settings\All Users\Documents\IP.txt"
nslookup myip.opendns.com resolver1.opendns.com > "C:\Users\Public\IP.txt"