Updated on: 2023-10-07

Connecting to X server over ssh a.k.a "Linux Remote Desktop"

  1. Install cygwin with X11 server
  2. Use putty to ssh to your Linux server. Make sure you enable X11 forwarding in putty
  3. In case you want to run X11 applications as another user, use sux instead of su.

Compiling swftools-0.9.1 on Debian 6.0 (AMD64) - 30.03.2011

  1. wget http://www.swftools.org/swftools-0.9.1.tar.gz
  2. tar -xvzf swftools-0.9.1.tar.gz
  3. cd swftools-0.9.1
  4. aptitude install zlib1g-dev libgif-dev libjpeg8-dev libfreetype6-dev libfftw3-dev libzzip-dev
  5. make
  6. make install

Some of the books I've read

Windows XP - ipconfig /registerdns not working

DHCP client service is responsible for registering the computer in the dns. If that service is not running usually a RPC error will occur.

Ocsng windows agent not detecting printers?

Well, too bad. Agent runs under LocalSystem user.

How to set e-mail headers almost correctly in python (no utf)

Here's a sample

You have bought a Western Digital MyBook Live edition, enabled SSH but somekind of mysterious ACL seems to be pulling the strings?

Check here: Trustees ACL
and check out /etc/trustees.conf

Thinking about integrating those pesky AHCI drivers to your Microsoft Windows XP ISO image?

Unfortunately this cannot be done in a reasonable manner. Reason is here but there are two workarounds:

Skype picking up an unused proxy from Firefox?

Skype crawls every profile in Mozilla directory and tries to use every defined proxy it can find. If You have ever enabled a proxy and then disabled it, but have not cleared proxy fields, Skype will try to use it. Sad as it is.

Microsoft Windows stuff

fix_w7.reg
fix_w7.cmd
fix_xp.reg

Ordinal 459 not found

Solution

cmd.exe crashing when running dir as a Microsoft Windows Active Directory domain user but not when running as a local admin on Microsoft Windows Server 2008

Your Regional settings are somehow damaged. Choose a different regional setting, click apply and then choose the correct regional setting. Found the solution from here.

Clean PDF from metadata

exiftool -all:all= input.file.pdf
qpdf --linearize input.file.pdf output.file.pdf

Microsoft Windows Network Location Awareness - 2015-09-13

The idea looks solid in the case of Network Location Awareness but that's about it. Making use of it boils down to programming in C++. Have "fun":

Using curl for uploading to nextcloud - 2017-07-23

curl -u $USERNAME -T $SOURCEFILE "https://mehmehmeh/nextcloud/remote.php/webdav/$DESTINATIONFILENAME"

Can't login using ssh (disconnected ca 2 minutes after entering username and password) and logging in from ttyX hangs - 2017-08-15

Quickfix: restart syslog-ng
Longterm fix: fix Your syslog-ng config.

Listen to ERR - 2017-12-30

ERR icecast server

Wayback machine crawler TLS cipher suites - 2018-07-29

Useful stuff - 2018-09-09

SMTP DANE - 2018-09-11

Postfix, DANE and letsencrypt - 2018-09-11

TLSA record generator - 2018-09-11

DKIM and SPF - 2018-09-11

Make sure your postfix respects DANE - 2018-09-11

main.cf

How certbot's renewal works? - 2018-09-27

Using Debian Stretch on armhf and wanting to use Gitlab-CE but cannot figure out the repositories? - 2018-09-28

Edit /etc/apt/sources.list.d/gitlab-ce.list and add the following lines:
deb https://packages.gitlab.com/gitlab/raspberry-pi2/raspbian/ stretch main
deb-src https://packages.gitlab.com/gitlab/raspberry-pi2/raspbian/ stretch main

Using GitLabCE with Apache in front - 2018-10-09

Apache must proxy requests to Gitlab. It's a bit tricky to get it right.Here's a nice reference how to get it working.

Want to run gitlab-runner on the Gitlab server? - 2018-10-10

Read this first.

Running an intranet wiki/website with links to outside resources? You are probably leaking via referer headers used by helpful browsers. - 2018-10-18

Remedy is here.

Want to version control /etc but salt/puppet/ansible/blah looks like overkill? - 2018-10-23

etckeeper to the rescue!

Should I use www or not in my domain? - 2018-11-11

You probably should use www.

Using Gnome Keyring and Seahorse looks empty? - 2018-12-22

"View" -> "Show Any". Reference

Fix up Ubuntu, install zoom and run it on startup. Useful for a permanent VTC computer - 2019-01-27

fix_ubuntu_sh

Installing Windows 10 unattended on an UEFI system - 2020-03-08

  1. Obtain the OS ISO you want to automate. For example use Firefox with extension "User Agent Switcher", specify Linux as your User Agent and download the iso from here. Please note that firefox with extension is needed because otherwise you cannot directly download ISO. Make sure that ISO will be mounted after reboot too.
  2. Install Windows 10 to a Virtual Machine and use that from now on
  3. Download and install Windows 10 ADK
  4. Make a "Windows 10 Vanilla" directory in c:\
  5. Copy all the contents from the ISO (which will show up as a DVD drive in Windows) to the "Windows 10 Vanilla directory"
  6. Fire up "Windows System Image Manager"
  7. Choose "Tools" -> "Create Distribution Share" and choose/create "c:\ADK Distribution Share" as target
  8. Choose "File" -> "Select Distribution Share" and chhose the distribution share made in the previous step
  9. Choose "File" -> "Select Windows Image" and choose "c:\Windows 10 Vanilla\sources\install.wim"
  10. Right Click on "Windows Image" -> Components -> amd64_Microsoft-Windows-International-Core-WinPE_*" and choose "Add Setting to Pass 1 WindowsPE"
  11. Choose "Answer File"-> Components -> 1 windowsPE -> amd64_Microsoft-Windows-International-Core-WinPE_neutral
  12. Fill in the settings on the right: InputLocale,SystemLocale,UILanguage,UserLocale. You can find the valid settings from here. For example: InputLocale: et-EE, SystemLocale: et-EE, UILanguage: en-GB, UserLocale: et-EE
  13. Set UILanguage to en-GB in "Answer File"-> Components -> 1 windowsPE -> amd64_Microsoft-Windows-International-Core-WinPE_neutral -> SetupUILanguage -> UILanguage
  14. Right click on "Windows Image" -> "amd64_Microsoft-Windows-Setup_*" -> "Disk Configuration" -> "Disk" and choose "Add setting to Pass 1 WindowsPE"
  15. Choose "Answer File" -> Untitled -> amd64_Microsoft-Windows_Setup_neutral -> "DiskConfiguration". Set WillShowUI to OnError.
  16. Select "Disk" beneath the DiskConfiguration. Set "Disk ID" to 0, "WillWipeDisk" to true
  17. Right click on "Create Partitions" and choose "Insert New CreatePartition". Do this 4 times in total.
  18. Modify the first "Create Partition": Extend: false, Order: 1, Size: 500, Type: Primary
  19. Modify the second "Create Partition": Extend: false, Order: 2, Size: 100, Type: EFI
  20. Modify the third "Create Partition": Extend: false, Order: 3, Size: 16, Type: MSR
  21. Modify the fourth "Create Partition": Extend: true, Order: 4, Type: Primary
  22. Right click on "Modify Partitions" and choose "Insert new ModifyPartition" four times
  23. Modify the first "ModifyPartition": Format: NTFS, Label: WinRE, Order: 1, PartitionID: 1, TypeID: DE94BBA4-06D1-4D40-A16A-BFD50179D6AC
  24. Modify the second "ModifyPartition": Format: FAT32, Label: System, Order: 2, PartitionID: 2
  25. Modify the third "ModifyPartition": Order: 3, PartitionID: 3
  26. Modify the fourth "ModifyPartition": Format: NTFS, Label: Windows, Letter: C, Order: 4, PartitionID: 4
  27. Right Click on "Windows Image" -> Components -> amd64_Microsoft-Windows_Setup_* -> ImageInstall -> OSImage -> InstallTo and choose "Add Setting to Pass 1 WindowsPE"
  28. Set DiskID: 0, PartitionID: 4 at "Answer File" -> Untitled -> amd64_Microsoft-Windows_Setup_neutral -> "ImageInstall" -> OSImage -> InstallTo.
  29. Right Click on "Windows Image" -> Components -> amd64_Microsoft-Windows_Setup_* -> UserData -> ProductKey and choose "Add Setting to Pass 1 WindowsPE"
  30. Set AcceptEula: true, Organisation: "Your Company name" at "Answer File" -> Untitled -> amd64_Microsoft-Windows_Setup_neutral -> UserData
  31. Set Key to the version you need at "Answer File" -> Untitled -> amd64_Microsoft-Windows_Setup_neutral -> UserData -> ProductKey. Check out the correct key from here.
  32. Right click on the "Windows Image" -> amd64_Microsoft-Windows-Shell-Setup_* and choose "Add setting to Pass 4 specialise"
  33. Set timezone at "answer files" -> Untitled -> 4 specialize -> amd64_Microsoft-Windows-Shell-Setup_neutral. List of timezones are available from here.
  34. Right click on "Windows Image" -> Components -> amd64_Microsoft-Windows-International-Core_*" and choose "Add Setting to Pass 7 oobeSystem"
  35. Fill in the settings on the right: InputLocale,SystemLocale,UILanguage,UserLocale. You can find the valid settings from here. For example: InputLocale: et-EE, SystemLocale: et-EE, UILanguage: en-GB, UserLocale: et-EE
  36. Right click on the "Windows Image" -> amd64_Microsoft-Windows-Shell-Setup_* -> OOBE and choose "Add setting to Pass 7 oobeSystem"
  37. Fill in the added options as necessary. Details about ProtectYourPC can be found from here. Choose 3 for the value
  38. Remove all unused settings be deleting the light purple boxes
  39. Click on Tools -> Validate. Fix any errors.
  40. Click File -> "Save Answer files as". Specify autounattend.xml as the filename
  41. Copy the file created to a usb stick. Have the usb plugged in when Windows setup boots. Setup will automatically look for autounattend.xml on the remove media and uses it when found
  42. Pat yourself on the back. Although this method is a good way to install Windows, it's a good way to install Windows only, without any specifc drivers or other software. For that, please check ou the next topic.

Installing Windows 10 unattended on an UEFI system and boot to audit mode to install other necessary stuff too - 2020-03-09

  1. Obtain the OS ISO you want to automate. For example use Firefox with extension "User Agent Switcher", specify Linux as your User Agent and download the iso from here. Please note that firefox with extension is needed because otherwise you cannot directly download ISO. Make sure that ISO will be mounted after reboot too.
  2. Install Windows 10 to a Virtual Machine and use that from now on
  3. Download and install Windows 10 ADK
  4. Make a "Windows 10 Vanilla" directory in c:\
  5. Copy all the contents from the ISO (which will show up as a DVD drive in Windows) to the "Windows 10 Vanilla directory"
  6. Fire up "Windows System Image Manager"
  7. Choose "Tools" -> "Create Distribution Share" and choose/create "c:\ADK Distribution Share" as target
  8. Choose "File" -> "Select Distribution Share" and chhose the distribution share made in the previous step
  9. Choose "File" -> "Select Windows Image" and choose "c:\Windows 10 Vanilla\sources\install.wim"
  10. Right Click on "Windows Image" -> Components -> amd64_Microsoft-Windows-International-Core-WinPE_*" and choose "Add Setting to Pass 1 WindowsPE"
  11. Choose "Answer File"-> Components -> 1 windowsPE -> amd64_Microsoft-Windows-International-Core-WinPE_neutral
  12. Fill in the settings on the right: InputLocale,SystemLocale,UILanguage,UserLocale. You can find the valid settings from here. For example: InputLocale: et-EE, SystemLocale: et-EE, UILanguage: en-GB, UserLocale: et-EE
  13. Set UILanguage to en-GB in "Answer File"-> Components -> 1 windowsPE -> amd64_Microsoft-Windows-International-Core-WinPE_neutral -> SetupUILanguage -> UILanguage
  14. Right click on "Windows Image" -> "amd64_Microsoft-Windows-Setup_*" -> "Disk Configuration" -> "Disk" and choose "Add setting to Pass 1 WindowsPE"
  15. Choose "Answer File" -> Untitled -> amd64_Microsoft-Windows_Setup_neutral -> "DiskConfiguration". Set WillShowUI to OnError.
  16. Select "Disk" beneath the DiskConfiguration. Set "Disk ID" to 0, "WillWipeDisk" to true
  17. Right click on "Create Partitions" and choose "Insert New CreatePartition". Do this 4 times in total.
  18. Modify the first "Create Partition": Extend: false, Order: 1, Size: 500, Type: Primary
  19. Modify the second "Create Partition": Extend: false, Order: 2, Size: 100, Type: EFI
  20. Modify the third "Create Partition": Extend: false, Order: 3, Size: 16, Type: MSR
  21. Modify the fourth "Create Partition": Extend: true, Order: 4, Type: Primary
  22. Right click on "Modify Partitions" and choose "Insert new ModifyPartition" four times
  23. Modify the first "ModifyPartition": Format: NTFS, Label: WinRE, Order: 1, PartitionID: 1, TypeID: DE94BBA4-06D1-4D40-A16A-BFD50179D6AC
  24. Modify the second "ModifyPartition": Format: FAT32, Label: System, Order: 2, PartitionID: 2
  25. Modify the third "ModifyPartition": Order: 3, PartitionID: 3
  26. Modify the fourth "ModifyPartition": Format: NTFS, Label: Windows, Letter: C, Order: 4, PartitionID: 4
  27. Right Click on "Windows Image" -> Components -> amd64_Microsoft-Windows_Setup_* -> ImageInstall -> OSImage -> InstallTo and choose "Add Setting to Pass 1 WindowsPE"
  28. Set DiskID: 0, PartitionID: 4 at "Answer File" -> Untitled -> amd64_Microsoft-Windows_Setup_neutral -> "ImageInstall" -> OSImage -> InstallTo.
  29. Right Click on "Windows Image" -> Components -> amd64_Microsoft-Windows_Setup_* -> UserData -> ProductKey and choose "Add Setting to Pass 1 WindowsPE"
  30. Set Key to the version you need at "Answer File" -> Untitled -> amd64_Microsoft-Windows_Setup_neutral -> UserData -> ProductKey. Check out the correct key from here.
  31. Right Click on "Windows Image" -> Components -> amd64_Microsoft-Windows-Deploymnet_* -> Reseal and choose "Add Setting to pass 5 auditSystem"
  32. Set Mode: Audit at "Answer File" -> Components -> 5 auditSystem -> amd64_Microsoft-Windows-Deployment_neutral -> Reseal
  33. Remove all unused settings be deleting the light purple boxes
  34. Click on Tools -> Validate. Fix any errors.
  35. Click File -> "Save Answer files as". Specify autounattend.xml as the filename
  36. Copy the file created to a usb stick. Have the usb plugged in when Windows setup boots. Setup will automatically look for autounattend.xml on the remove media and uses it when found

Updating OP to latest LineageOS - 2023-10-07

  1. apt install adb fastboot
  2. connect phone to computer
  3. adb reboot bootloader
  4. fastboot devices
  5. download images from here.
  6. download ARM64 gapps from here.
  7. fastboot flash recovery recovery.img
  8. reboot phone, check if you can boot to recovery
  9. reboot phone
  10. adb reboot sideload
  11. adb sideload /path/to/image and don't reboot. Apply update, apply from adb
  12. adb sideload /path/to/gapps
  13. Reboot system now