Operating systems

On Windows

Linux or Windows images

Rufus - Rufus usually has no problem working with Linux and Windows ISOs and is easy to work with. The only negative thing is that I didn't figure out how to make ISOs that boot both under BIOS and UEFI, only one or the other, which is selected under the “Partition scheme” label.

You want to use “GPT for UEFI” partition scheme unless your hardware is years and years old.

unetbootin - Sometimes certain Linux distributions fail to be used by Rufus

On Linux and macOS

macOS has some command name differences not mentioned here, but the general idea works still.

Linux images

Unebootin or dd can be used for this purpose, I chose to use dd because it's preinstalled and straightforward.

Make sure to run lsblk to know what device you should be dealing with.

umount /dev/sde1 - Unmount the device in case it's mounted

sudo dd if=/path/to/file.iso of=/dev/sde bs=4M status=progress && sync

You should now be able to boot the distribution in both BIOS and UEFI, if the distribution supports it.


Windows images

Below is a description of the manual process, however you can use WoeUSB for an automated one.


1 2

Format the flash drive with Gparted - Device > Create partition table - Set partition table to msdos. Afterwards create a FAT32 partition, remember to label it, you will need that label later to enable BIOS booting.

Right click the partition you created > Manage flags > tick the 'boot' flag. Exit gparted.

Mount the ISO you want to use to some already existing folder

sudo mount -o loop ~/Downloads/Win8.1Englishx64.iso /mnt/iso

and copy all files from it to the mounted flash drive, you can cd into the mounted ISO and run this command to copy all over.

cp -r ./* /run/media/c0rn3j/WIN10EN/

At this point the flash drive should be UEFI bootable. The rest is needed to also enable BIOS booting.

Also you should create a file ei.cfg in the sources folder with following content(it makes sure you can actually select the edition):

[Channel]
Retail

sudo grub-install –target=i386-pc –boot-directory=/run/media/c0rn3j/WIN10EN/boot /dev/sdd - This command will install GRUB bootloader on the flash drive.

Last thing you'll need to do is create a config file for GRUB.

gedit /run/media/c0rn3j/WIN10EN/boot/grub/grub.cfg - This command will run gedit, paste the following text block in it and save it.

 default=1  
 timeout=15
 color_normal=light-cyan/dark-gray
 menu_color_normal=black/light-cyan
 menu_color_highlight=white/black
 
 menuentry "Start Windows Installation" {
     insmod ntfs
     insmod search_label
     search --no-floppy --set=root --label **_WIN10EN_** --hint hd0,msdos1
     ntldr /bootmgr
     boot
 }

The flash drive should now be bootable by both UEFI and BIOS.

KON-BOOT images

Format the flash drive with Gparted - Device > Create partition table - Set partition table to msdos. Afterwards create a FAT32 partition, remember to label it.

Copy the EFI folder onto the new partition.(you may need to rename it to lowercase efi?) Copy the files in USBFILES folder onto the new partition.

sudo grub-install –target=i386-pc –boot-directory=/run/media/c0rn3j/KONBOOT/boot /dev/sdd - This command will install GRUB bootloader on the flash drive.

sudo cp /usr/lib/syslinux/bios/memdisk /run/media/c0rn3j/KONBOOT/boot/grub/ - copies memdisk onto the flashdrive - needed for BIOS booting.

gedit /run/media/c0rn3j/KONBOOT/boot/grub/grub.cfg - create the following grub entry

 menuentry "Konboot" {
 linux16 /boot/grub/memdisk
 initrd16 /konboot.img
 }

Note: Konboot v2.5 does not seem to work on anything past the first W10 RTM build.

ESET SysRescue live images

Format the flash drive with Gparted - Device > Create partition table - Set partition table to msdos. Afterwards create a FAT32 partition, remember to label it.

Mount the ESET .ISO and copy all files to the new partition.(ubuntu symlink should throw an error, you can ignore it)

sudo grub-install –target=i386-pc –boot-directory=/run/media/c0rn3j/ESETRESCUE/boot /dev/sdd - This command will install GRUB bootloader on the flash drive.

gedit /run/media/c0rn3j/ESETRESCUE/boot/grub/grub.cfg - create the following grub entry

 menuentry "Load ESET sysrescue live" {
     linux /casper/vmlinuz boot=casper quiet splash --
     initrd /casper/initrd.lz
 }

That's it. ESET doesn't provide any EFI files so the flash drive is only bootable by (legacy)BIOS.

Using Android phone as fake USB

You need root to be able to do any of this.

DriveDroid - Use your Android as a fake flash drive

I used my Xperia Z(C6603) with CM13 experimental and DriveDroid beta. You might need to delete app data if you had DriveDroid installed before. Your phone might not be supported in either beta or stable.

Your kernel might support emulating USB, emulating DVD drive or both. If it supports emulating a DVD drive you should be golden in most cases.

USB support only

Works out of the box with Arch linux.

Current implementation of isohybrid is not perfect in DriveDroid so SystemRescueCD will not work unless prepped beforehand(isohybrid –uefi image.iso).

Windows is special and needs the following if your kernel doesn't have DVD drive emulation support:[ Windows needs(afaik, Win10.1607 ISO is 4.1GB) support for files larger than 4GB, so FAT32 SD card in DriveDroid is off the table. I've formatted my SD card with gparted to ext4. Internal storage doesn't seem to play well with DriveDroid. (If you have Android 6, make sure your SD card is set as portable and not internal under Storage settings)

In DriveDroid click the + icon and select Create a Blank image. Create a 4500MB(a bit less would probably suffice) image with a filename of your choosing. Untick the Partition table(MBR) Checkbox, and create the image.

After that tap on new image in DriveDroid to fake a writable USB, and connect your phone to your PC.

Start gparted, you should see your device there. If you do, you won. Follow the section above this one(creating a bootable flash drive under linux(Windows should work too)) to create the install media.

Windows: Disk Management, EASEUS Partition Master(paid)

Linux: parted, gparted, fdisk, cfdisk, sfdisk

You can also manage partitions from within the install media of both Windows and Arch Linux without having a working OS installed.

 #W10 Pro KMS key
 slmgr /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX
 slmgr /skms 192.168.1.2:1688
 slmgr /ato
 reg add HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager /v SilentInstalledAppsEnabled /t REG_DWORD /d 0 /f
 reg add HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager /v SystemPaneSuggestionsEnabled /t REG_DWORD /d 0 /f
 reg add HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager /v SoftLandingEnabled /t REG_DWORD /d 0 /f
 reg add HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager /v SubscribedContent-310093Enabled /t REG_DWORD /d 0 /f
 reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v HideFileExt /t REG_DWORD /d 0 /f
 reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v LaunchTo /t REG_DWORD /d 1 /f
 reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer /v EnableAutoTray /t REG_DWORD /d 0 /f
 reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Search /v SearchboxTaskbarMode /t REG_DWORD /d 0 /f
 reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v ShowTaskViewButton /t REG_DWORD /d 0 /f
 reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People /v PeopleBand /t REG_DWORD /d 0 /f
 reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v Hidden /t REG_DWORD /d 1 /f
 reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v ShowSuperHidden /t REG_DWORD /d 1 /f
 reg add HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f
 reg delete HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband /v Favorites /f
 taskkill /f /im explorer.exe
 explorer.exe
 Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
 Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
 choco install -y mumble googlechrome notepadplusplus 7zip crystaldiskmark crystaldiskinfo keepassxc sharex openssh telegram windirstat jre8 everything teamviewer smplayer nextcloud-client hwinfo qbittorrent

Download

You can download latest .ISO of Win 10, 8.1 and 7 directly from Microsoft's servers. The W10 ISO contains both Home and Pro edition which you get to choose during installation. If you want to install a W8.1/7 version that is not available directly from MS, you could possibly (ab)use the …/sources/ei.cfg file to change installed version that is going to be installed.

You can download older versions of windows and different versions of W10 through this method

If you want something like Enterprise versions and such you'll have to resort to torrenting them and THEN CHECKING THE HASHES provided by Microsoft.

Windows 10 Installation

If you want to dual-boot with Arch already installed, just install it on an unallocated “partition”. Windows install alone usually takes some 20~GB.

Boot from the flash drive. Remember to always select “Custom” where applicable and “skip” when you get a prompt for creating Microsoft account.

Windows usually gets all the drivers itself, but if something doesn't work as it should you might need to visit your motherboard or device manufacturer's website and download drivers.

Windows usually downloads outdated GPU driver so head over to AMD's or Nvidia's website depending on what GPU you have and download according driver.

If you already have or had a W10 license, then your hardware ID combination(should be motherboard+CPU) is stored at Microsoft's servers and your license will be obtained automatically when you connect to the internet, provided you installed the same W10 version.

If you don't have a W10 license you can either:

1) Buy a license key from official source. Buying from unofficial sources/grey markets is exactly as illegal as cracking it. You'd be literally giving your money away to thieves. The keys are from hacked MSDN accounts, credit card frauds etc.

2) If you're in college or some sort of academic institute, they might have MSDN licenses, see if you can find a copy from their IT department.

3) Not activate W10 - you will not be able to use Personalization features and it'll nag you

4) Upgrade from W7/8.1 pro to W10 pro which gives you a W10 pro license tied to your motherboard+CPU. (even cracked Windows upgrades to legit license) Yes it still works.

5) Crack W10 with KMSpico. Defender will bitch about it, allow it manually in Defender after installing it. Alternatively you can use vlmcsd if you want an open source, more hardcore solution.

Download

Since I'm using Arch Linux this page will be focused on Arch.

You can download Arch here

Basic commands and usage

Before going through the install guide you really should know these.

Lower/upper case is important in linux.

You can use arrow keys to navigate through your previous commands.

CTRL+ALT+F1-F12 - key combination for switching between terminals

cd DIRECTORY - for example cd /home/baf/Downloads - chooses directory

nano FILE - edit a text file

CTRL + C - break from a command, for example a ping

lsblk - lists all your drives and their partitions.

elinks - tool you can use to view webpages from the CLI

irssi - IRC in the CLI in case you get lost, #archlinux on freenode should help you out if you ask nicely.

Installing GPU proprietary drivers

Nvidia

sudo nano /etc/pacman.conf - uncomment [multilib] and the line below it. This is required for 32bit applications.

sudo pacman -Syu - synchronize the repository databases and update the system's packages

sudo pacman -S nvidia nvidia-libgl lib32-nvidia-libgl nvidia-settings

reboot

AMD

https://wiki.archlinux.org/index.php/AMD_Catalyst

Since the GPU I'm using this with is R5750, I'll use the newest Catalyst (supports R5XXX and up).

Add unofficial user repository ABOVE ALL OTHER REPOSITORIES

sudo nano /etc/pacman.conf

 [catalyst]
 Server = http://catalyst.wirephire.com/repo/catalyst/$arch
 ## Mirrors, if the primary server does not work or is too slow:
 #Server = http://mirror.hactar.bz/Vi0L0/catalyst/$arch
 #SigLevel = Never # THIS THROWS SECURITY OUT OF THE WINDOW, I had a PGP signature error and this was my stupid workaround.

sudo pacman -Syu - update all repositories and packages, agree to add PGP key to database.

Since Catalyst updates so slowly it often is the case that xorg-server needs to be downgraded. This is made easy by using an unofficial user repository. Just remember to run sudo pacman -Syuu to downgrade packages according to the repositories

Now you can use pacman to install the required packages with sudo pacman -S packagename

 catalyst-hook
 catalyst-utils
 catalyst-libgl
 opencl-catalyst - optional, needed for OpenCL support
 lib32-catalyst-utils - optional, needed for 32-bit OpenGL support on 64-bit systems
 lib32-catalyst-libgl - optional, needed for 32-bit OpenGL support on 64-bit systems
 lib32-opencl-catalyst - optional, needed for 32-bit OpenCL support on 64-bit systems

 (command to install all of these if you're lazy to rewrite them)
 sudo pacman -Syu catalyst-hook catalyst-utils catalyst-libgl opencl-catalyst lib32-catalyst-utils lib32-catalyst-libgl lib32-opencl-catalyst

If you have one monitor:

 sudo aticonfig --initial

If you have two monitors and want to use both of them, you can run the command stated below. Note that this will generate a dual head configuration with the second screen located above the first screen.

 sudo aticonfig --initial=dual-head --screen-layout=above

Blacklist radeon module:

 sudo nano /etc/modprobe.d/modprobe.conf - add "blacklist radeon" on a new line because we want to block radeon from loading and load fglrx instead

Disable kernel mode setting by adding _nomodeset_ as a boot parameter otherwise your system will freeze. (Do not do this if you are using powerXpress technology (or hybrid AMD-Intel graphics) because Intel driver needs it)

Reboot and hopefully everything will work.

Installing packages from AUR

You can download user created PKGBUILDs from AUR.

Example:

Downloading and installing Chrome - go to the AUR page of google-chrome.

Click the “Download snapshot” button, unpack the archive, then execute makepkg -sri in the folder.

Package managers

Pacman

Usage:

pacman -S packagename - Download and install a package

pacman -Ss packagename - Search for a package

pacman -Syu - Update all repositories and all packages

pacman -Syuu - Update all repositories and all packages forcefully, ignoring newer packages and overwriting them with the ones in your current repositories -S has a useful –ignore packagename flag, which lets you ignore a broken package when doing a full update for example. Use multiple times when you want to avoid installing more packages. There's also a –noconfirm flag, which ignores confirmation of the action. pacman -R - Remove a package

pacman -Rs - Remove a package and its dependencies

pacman -Rsc - Remove a package and its dependencies, recursively. This will possibly tear huge chunks out of your systems, use with caution -R has useful -d and -dd flags, which ignore dependants and forcefully remove the package. pacman -Sc - Since pacman doesn't remove the downloaded package after installing it, this command removes all packages but the newest version ones

pacman -Scc - Remove all downloaded package files

pacman -Qm - List packages installed locally.(that includes AUR)

You can get to the package cache via this command cd /var/cache/pacman/pkg/ and then use pacman -U packagename to downgrade/reinstall a package.

Portage

https://wiki.gentoo.org/wiki/Handbook:X86/Working/Portage

emerge –sync - update repositories via rsync protocol

emerge-webrsync - update repositories via HTTP protocol. Daily snapshot.

emerge –update –deep –with-bdeps=y –newuse @world - completely update all packages

emerge -c - remove a package if there are no other packages depending on it

emerge -C - forcefully remove a package ignoring dependencies

Useful tools and commands

tmux

Full(?) cheatsheet: http://hyperpolyglot.org/multiplexers

tmux running a session but list-sessions doesn't show it? This might help killall -s SIGUSR1 tmux

If you're running nested tmux sessions, http://stackoverflow.com/a/8530024 explanation and tips how to do it efficiently. (CTRL+B twice to get into the second level session etc)

Command to detach all other sessions(in case the window is small and other session is blocking resizing): attach -d

Basic usage:

tmux - start new tmux session

tmux ls - list active sessions

tmux a -t sessionName - attach to specific session

tmux kill-session -t sessionName - kill specific session

Inside of tmux:

CTRL+B $ - rename session

CTRL+B d - detach session

CTRL+B % - split current pane vertically

CTRL+B “ - split current pane horizontally

CTRL+B ARROW_KEY - move between panes

CTRL+B+ARROW_KEY - resize current pane

CTRL+B z - toggle current pane fullscreen state

CTRL+B x - kill current pane

CTRL+B c - create a new window

CTRL+B n - next window

CTRL+B p - previous window

CTRL+B , - rename current window