Skip to content

Instantly share code, notes, and snippets.

Avatar
🤕
è

Valorad the Oneiroseeker valorad

🤕
è
View GitHub Profile
@valorad
valorad / config.txt
Last active Nov 6, 2022
SSH Config Examples
View config.txt
# Linux: /home/me/.ssh/config
# macOS: /Users/me/.ssh/config
# Windows: C:\Users\me\.ssh\config
# macOS - localhost - fish shell
HOST localhost
Hostname localhost
User me
Port 22
IdentityFile /Users/me/.ssh/id_ed25519
@valorad
valorad / getRandomNumberBetween.apex
Created Jul 21, 2022
Salesforce Apex get a random Integer number ∈ [minValue, maxValue)
View getRandomNumberBetween.apex
/**
* get a random Integer number ∈ [minValue, maxValue)
*/
public Integer getRandomNumberBetween(Integer minValue, Integer maxValue) {
if (minValue > maxValue) {
// swap position
Integer tmp = minValue;
minValue = maxValue;
maxValue = tmp;
@valorad
valorad / proxmox-replace-disk.md
Created Jun 5, 2022
Proxmox use existing disk image
View proxmox-replace-disk.md

use existing disk image

  • create a vm
  • note down the vm id, disk location and disk size.
  • enter directory and make sure size is correct
  • replace the disk.raw file
  • enter command: qm rescan
@valorad
valorad / Powershell-set-alias.md
Last active Jun 5, 2022
Powershell set alias
View Powershell-set-alias.md

destroyVBox

e.g. Destroy VirtualBox (With Chocolatey already installed)

set-alias -name destroy -value "cuninst"
destroy virtualbox

@valorad
valorad / mount-cifs-smb.md
Last active Jun 5, 2022
linux mount cifs (smb share)
View mount-cifs-smb.md

Create credentials

=> /etc/samba/credentials

username=myuser123
password=xxxxxxxx
View openSSH-instructions.md

Linux

ssh-keygen -t ed25519

cat ~/.ssh/id_ed25519.pub > ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 400 ~/.ssh/authorized_keys
@valorad
valorad / changeDriveLetter.ps1
Created Jun 5, 2022
Change the drive letter in PowerShell
View changeDriveLetter.ps1
Get-Disk
Get-Partition
Remove-PartitionAccessPath -DiskNumber YOUR_DISK_NUMBER -PartitionNumber YOUR_PARTITION_NUMBER -Accesspath CURRENT_DRIVE_LETTER:
View dism-repair-image.md

online (meaning repairing current running system):

Admin powershell:

Repair-WindowsImage -Online -ScanHealth
Repair-WindowsImage -Online -RestoreHealth

offline:

View GRUBBootLoader.md

Ubuntu set grub timeout

/etc/default/grub should contain: GRUB_RECORDFAIL_TIMEOUT=10

View InstallingXRDP.md

Ubuntu:

sudo apt install xrdp 
sudo adduser xrdp ssl-cert 
sudo systemctl restart xrdp

Fedora: