Last active
January 26, 2023 01:05
-
-
Save kanchudeep/75304d5ad30287a482e3335e2f9c7728 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Allow executable to run sudo w/o password prompt | |
1. Execute: | |
sudo visudo | |
2. Add line: | |
<username> ALL=NOPASSWD:/path/to/executable | |
Apt | |
Auto purge: | |
apt autoremove --purge | |
Download debs to '/var/cache/apt/archives/': | |
sudo apt install --download-only <package-name> | |
Export GPG key from deprecated keyring: | |
1. List existing keys: | |
sudo apt-key list | |
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). | |
/etc/apt/trusted.gpg | |
-------------------- | |
pub rsa4096 2017-05-08 [SCEA] | |
1EDD E2CD FC02 5D17 F6DA 9EC0 ADAE 6AD2 8A8F 901A | |
uid [ unknown] Sublime HQ Pty Ltd <[email protected]> | |
sub rsa4096 2017-05-08 [S] | |
pub rsa2048 2015-10-28 [SC] | |
BC52 8686 B50D 79E3 39D3 721C EB3E 94AD BE12 29CF | |
uid [ unknown] Microsoft (Release signing) <[email protected]> | |
2. Export a key: | |
sudo apt-key export BE1229CF | sudo gpg --dearmour -o /usr/share/keyrings/microsoft.gpg | |
* Note: The BE1229CF value comes from the last 8 characters of the pub code. | |
3. Update corresponding apt source file for the repository, adding a signed-by tag: | |
deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/edge/ stable main | |
4. Update apt to confirm warning is gone | |
sudo apt update | |
5. Remove the original signature | |
sudo apt-key del BE1229CF | |
Fix: 'add-apt-repository: command not found' | |
sudo apt install software-properties-common | |
* Note: Also install dirmngr | |
Hold/Unhold packages: | |
Hold: | |
sudo apt-mark hold <package-name> | |
Unhold: | |
sudo apt-mark unhold <package-name> | |
Show packages on hold | |
apt-mark showhold | |
List installed packages: | |
apt list --installed | |
List installed packages matching a pattern: | |
apt list --installed "pattern*" | |
List upgradeable packages: | |
apt list --upgradable | |
Mark to prevent autoremove: | |
sudo apt-mark manual <package-name> | |
Update offline: | |
1. Copy .deb files from '/var/cache/apt/archives/' after | |
'apt dist-upgrade'/'apt full-upgrade'/'apt upgrade'. | |
2. Copy 'apt update' downloaded repository info from '/var/lib/apt/lists/'. | |
3. Run 'apt dist-upgrade'/'apt full-upgrade'/'apt upgrade'. | |
Backup MBR | |
sudo dd status=progress if=/dev/sda of=/path/to/mbr.raw bs=512 count=1 | |
Base Conversion | |
Binary to Decimal: | |
echo "ibase=2; 101010" | bc | |
Decimal to Binary: | |
echo "ibase=10; obase=2; 42" | bc | |
Decimal to Hexadecimal: | |
echo "obase=16; 42" | bc | |
Hexadecimal to Decimal: | |
echo "ibase=16; 2A" | bc | |
Hexadecimal to Base64: | |
echo <hex-string> | xxd -r -p | base64 | |
Beep: | |
echo -ne "\a" | |
Build; Packages required | |
GQRX-Scanner: | |
• To build/install: | |
cmake . | |
make | |
sudo make install | |
• Dependencies: | |
cmake | |
• To uninstall: | |
sudo make uninstall | |
Gradio: | |
• To build/install: | |
meson build . | |
cd build/ | |
ninja | |
sudo ninja install | |
• Dependencies: | |
libgstreamer1.0-dev | |
libgstreamer-plugins-base1.0-dev | |
libgtk-3-dev | |
libjson-glib-dev | |
libsoup2.4-dev | |
libsqlite3-dev | |
meson | |
ninja-build | |
valac | |
Change Partition Sequence Number | |
1. Get copy of partition table: | |
sudo sfdisk --dump /dev/sdX > sdX.old | |
2. Create copy for new partition table: | |
cp --verbose sdX.old sdX.new | |
3. Edit the file for new partition table, changing only the line order and | |
partition number. | |
4. Write new partition table: | |
sudo sfdisk /dev/sdX < sdX.new | |
* In case the above does not work: | |
sudo sfdisk --no-reread --force /dev/sdX < sdX.new | |
Check script/command execution time | |
time /path/to/script | |
CheckInstall - Build Linux packages from source code | |
1. Install: | |
sudo checkinstall | |
* This is same as: sudo checkinstall make install | |
2. Create package: | |
sudo checkinstall --install=no | |
Chromium - always run in Incognito | |
1. Set Chromium as default in: | |
sudo update-alternatives --config x-www-browser | |
2. Edit file as root: | |
sudo --edit /etc/chromium-browser/default | |
3. Change line reading CHROMIUM_FLAGS="" to CHROMIUM_FLAGS="--incognito". | |
Chroot | |
1. Into device/image: | |
sudo mount /dev/sdXY /mnt/ | |
sudo mount /dev/sdXY /mnt/boot/ # If applicable | |
...or... | |
sudo mount /dev/sdXY /mnt/boot/efi/ # For EFI based systems | |
for i in /dev/ /proc/ /run/ /sys/ /usr/ /var/ ; do sudo mount --bind "$i" "/mnt$i"; done | |
chroot /mnt | |
2. Fix no internet access in chroot environment: | |
Copy host '/etc/resolv.conf' to chroot environment. | |
ClamAV | |
1. Update database: | |
sudo freshclam | |
* You may need to stop clamav service (restart later): | |
sudo service clamav-freshclam stop | |
2. To scan: | |
clamscan --allmatch --bell --infected --recursive <path> & | |
Cleanup $HOME | |
1. ClamTk | |
sudo sed --in-place 's/\/\.clamtk/\/.local\/share\/clamtk/g' \ | |
/usr/share/perl5/ClamTk/App.pm /usr/share/perl5/ClamTk/Schedule.pm | |
2. Eclipse. | |
a. In 'eclipse.ini' add: | |
-Duser.home=.config | |
b. Eclipse will create '.eclipse', '.p2' directories in '$HOME/.config/'. | |
Clear Logs | |
for i in $(sudo find /var/log/ -type f); do sudo \cp -v /dev/null $i; done | |
Clear Recent Files for GTK File Chooser: | |
rm ~/.local/share/recently-used.xbel | |
Connect to a serial device | |
screen /dev/ttyUSB0 <optional baud-rate> | |
* Note: | |
1. To detach: 'Ctrl-D'. | |
2. To kill session: 'Ctrl-A' then 'K'. | |
3. To scroll: 'Ctrl-A' then 'Esc'. Scroll using arrow keys. When done hit | |
'Q'/'Esc'. | |
Convert EFI to BIOS | |
1. Do changes in partition(s). | |
2. Update '/etc/fstab' i.e. remove '/boot/efi' and/or update UUIDs. | |
3. Chroot (with /, /boot/, /boot/efi/, /dev/, /proc/, /run/, /sys/, /usr/, /var/) to the root of device to convert. | |
4. grub-install /dev/sda | |
5. update-grub | |
Copy preserving ownership/permissions | |
cp --archive --verbose /path/to/source /path/to/destination # Note: No trailing '/' | |
...or... | |
rsync --archive --progress --verbose /path/to/source /path/to/destination | |
Copy Entire Filesystem | |
rsync -axHAX --numeric-ids --info=progress2 /media/old-disk /media/new-disk | |
-a all files, with permissions, etc | |
-x stay on one file system | |
-H preserve hard links (not included with -a) | |
-A preserve ACLs/permissions (not included with -a) | |
-X preserve extended attributes (not included with -a) | |
Count total number of lines in set of files | |
find . -type f -name '*.java' | xargs wc -l | |
find -L . -type f -name '*.java' | xargs wc -l # Follow symbolic links | |
Create Loopback device for an image | |
udisksctl loop-setup --file /path/to/image.img | |
udisksctl loop-setup --read-only --file /path/to/image.img | |
udisksctl loop-delete --block-device /dev/loopX | |
...or... | |
1. Enable loopback if not already enabled: | |
sudo modprobe loop | |
2. Request a new (free) loopback device: | |
sudo losetup --find | |
* Note the path to the free loopback device | |
3. Create device of image: | |
sudo losetup --verbose /dev/loopX /path/to/image.img | |
* Where X is the number of loopback device returned earlier | |
4. Ask kernel to load partitions in device: | |
sudo partprobe --summary /dev/loopX | |
5. Unloading the loopback device: | |
sudo losetup --verbose --detach /dev/loopX | |
Dconf/Dconf-editor: | |
1. Increase maximum recent files for text editors: | |
dconf write /org/x/editor/preferences/ui/max-recents "'20'" | |
...or... | |
dconf-editor: | |
Under ' /org/x/editor/preferences/ui/' set 'max-recents' to '20'. | |
2. Set maximum compression for file-roller: | |
dconf write /org/gnome/file-roller/general/compression-level "'maximum'" | |
...or... | |
dconf-editor: Under 'org/gnome/file-roller/general' set 'compression-level' | |
to 'maximum'. | |
Disable GUI | |
1. Edit '/etc/default/grub' with your favourite editor and change: | |
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" | |
to | |
GRUB_CMDLINE_LINUX_DEFAULT="text" | |
2. Update GRUB: | |
sudo update-grub | |
3. Tell systemd to not load the graphical login manager: | |
sudo systemctl enable multi-user.target --force | |
sudo systemctl set-default multi-user.target | |
4. You will still be able to use X by typing 'startx' after you logged in. | |
Disable Hibernation | |
1. Remove/delete the file 'com.ubuntu.enable-hibernate.pkla' from | |
'/etc/polkit-1/localauthority/50-local.d/'. | |
2. Content of the file for Linux Mint Cinnamon 18.3: | |
[Re-enable hibernate by default] | |
Identity=unix-user:* | |
Action=org.freedesktop.upower.hibernate | |
ResultActive=yes | |
[Re-enable hibernate by default in logind] | |
Identity=unix-user:* | |
Action=org.freedesktop.login1.hibernate | |
ResultActive=yes | |
Disk image | |
1. Create (empty): | |
a. Create blank file of required size (here 1GiB): | |
sudo dd if=/dev/zero of=/path/to/image.img iflag=fullblock bs=1M count=1024 status=progress && sync | |
b. Create loopback device for disk image: | |
sudo losetup --verbose /dev/loopX /path/to/image.img | |
c. Run GParted for loopback device: | |
gparted /dev/loopX | |
d. Detach loopback device: | |
sudo losetup --verbose --detach /dev/loopX | |
2. Enlarge: | |
a. Add space to the image: | |
sudo dd if=/dev/zero bs=1M count=1024 status=progress >> /path/to/image.img | |
b. Load image as a loopback and edit with GParted to enlarge partition(s): | |
sudo gparted /dev/loopX | |
c. Unload the loopback: | |
sudo losetup --detach /dev/loopX | |
3. Shrink: | |
a. Load image as a loopback and edit with GParted: | |
sudo gparted /dev/loopX | |
b. Unload the loopback: | |
sudo losetup --detach /dev/loopX | |
c. Find end of partition(s): | |
i. Execute: | |
fdisk --list /path/to/image.img | |
ii. Will give output like: | |
Disk myimage.img: -- MB, -- bytes, -- sectors | |
Units = sectors of 1 * -- = X bytes | |
Sector size (logical/physical): -- bytes / -- bytes | |
I/O size (minimum/optimal): -- bytes / -- bytes | |
Disk identifier: -- | |
Device Boot Start End Blocks Id System | |
/path/to/image.img1 -- Y -- - -- | |
* Note: | |
i. Block-size, here X (and generally 512byts) | |
ii. Ending of partition, here: Y | |
d. Run truncate with above noted values: | |
truncate --size=$[X*(Y+1)] /path/to/image.img # 'Y+1' as block count starts at 0 | |
Disable root account | |
1. Remove the root password: | |
sudo passwd --delete root | |
2. Lock the account: | |
sudo passwd --lock root | |
Dump1090-mutability - Fix service exiting | |
sudo wget --output-documen /etc/udev/rules.d/rtl-sdr.rules "https://raw.githubusercontent.com/osmocom/rtl-sdr/master/rtl-sdr.rules" | |
sudo reboot | |
dpkg | |
1. List packages with size | |
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | |
2. Find package of executable | |
dpkg-query -S <path to executable> | |
Echo To File As root | |
echo 'Hello, world!' | sudo tee /path/to/file.txt > /dev/null | |
...or... | |
echo 'Hello, world!' | sudo tee --append /path/to/file.txt > /dev/null | |
EFI/UEFI | |
Check if system is EFI/UEFI: | |
Check existence of '/sys/firmware/efi/' folder. | |
List entries: | |
efibootmgr --verbose | |
Add entry: | |
sudo efibootmgr --create --verbose -d /dev/sda -p 1 -l \\EFI\\ubuntu\\grubx64.efi -L "Linux" | |
Delete entry: | |
sudo efibootmgr --bootnum --verbose <bootnum> -B | |
Encrypt Home Partition (Post install) | |
1. Install the encryption utilities: | |
sudo apt install ecryptfs-utils cryptsetup | |
2. Login with a different account than the one to be encrypted. | |
3. Encrypt home: | |
sudo ecryptfs-migrate-home -u <username> | |
4. Login to the original account without reboot to complete process! | |
5. Follow the instruction to add a password to the newly encrypted folder. | |
If you don't see it, enter: | |
ecryptfs-add-passphrase | |
3. Note: A copy of original home directory is made. | |
Execute command on list of files/directories | |
for file in <one> <two> <three>; do <command> $file; done | |
exFAT | |
1. Format: | |
sudo mkfs.exfat -n LABEL /dev/sdXn | |
...or... | |
sudo mkexfatfs -n LABEL /dev/sdXn | |
2. Change label: | |
sudo exfatlabel /dev/sdXn NEW_LABEL | |
3. Get filesystem info: | |
sudo dumpexfat /dev/sdXn | |
4. To check the partition: | |
sudo fsck.exfat /dev/sdXn | |
...or... | |
sudo exfatfsck /dev/sdXn | |
Metadata Removal | |
1. EXIF | |
exiftool -all= /path/to/file | |
2. PDF | |
mat2 /path/to/file | |
Extract Eltorito Boot Image from CD-ROM image | |
1. Get info from image: | |
isoinfo -d -i /path/to/bootable-cd.iso | |
2. This will output with something like this: | |
Eltorito defaultboot header: | |
Bootid 88 (bootable) | |
Boot media 2 (1.44MB Floppy) | |
Load segment 0 | |
Sys type 0 | |
Nsect 1 | |
Bootoff 1D 29 | |
3. The last line tells that offset of boot image is 29 (0x1D in decimal). | |
ISO9660 sectors are 2048 bytes. So we would use dd as follows: | |
dd if=/path/to/bootable-cd.iso of=/path/to/bootable-floppy.img bs=2048 skip=29 count=720 | |
* Count as per size of floppy? | |
Extract icon from Windows executable (EXE) | |
sudo apt install icoutils | |
wrestool --extract --type 14 source.exe > output.ico | |
FFMPEG | |
1. Convert M4V to AVI: | |
ffmpeg -i foo.mp4 -q:v 3 bar.avi | |
* Lower Q values will increase quality and file size | |
...or... | |
a. First pass: | |
ffmpeg -i foo.m4v -c:v libxvid -c:a libmp3lame -r 30 -threads 12 -pass 1 -f rawvideo -y /dev/null | |
b. Second pass: | |
ffmpeg -i foo.m4v -c:v libxvid -c:a libmp3lame -r 30 -ar 44100 -b:a 128k -qscale 1 -threads 12 -pass 2 -passlogfile ffmpeg2pass bar.avi | |
2. Change speed of video: | |
ffmpeg -i foo.mp4 -filter:v "setpts=0.5*PTS" foo-double-speed.mp4 | |
3. Extract mp3 cover art: | |
ffmpeg -i file.mp3 file.jpg | |
4. Convert to mp3: | |
ffmpeg -i input-file.ext -c:a libmp3lame -b:a 128k output-file.mp3 | |
5. Clip a video: | |
ffmpeg -ss 00:01:23 -to 00:23:45 -i foo.m4v -o foo.m4v | |
6. Convert m4v to mp4: | |
ffmpeg -i input-file.m4v -c copy output-file.mp4 | |
7. Replace audio: | |
ffmpeg -i input-file.mp4 -i input-file.wav -c:v copy -map 0:v:0 -map 1:a:0 output-file.mp4 | |
Find | |
1. Execute command on directories only in current directory: | |
find . -maxdepth 1 -type d -exec echo {} \; | |
2. Execute command on files only in current directory: | |
find . -maxdepth 1 -type f -exec echo {} \; | |
3. Chmod all directories beginning from the current directory: | |
find . -type d -exec chmod 700 {} \; | |
4. Chmod all files beginning from the current directory: | |
find . -type f -exec chmod 600 {} \; | |
5. Chmod specified file pattern: | |
find . -type f -name "*.sh" -exec chmod --verbose +x {} \; | |
6. Chmod multiple file pattern: | |
find . -type f \( -iname \*.pl -o -iname \*.sh \) -exec chmod --verbose +x {} \; | |
* '-iname' is like '-name' but case insensitive | |
7. Find all files with specified permissions: | |
find . -type f -perm 777 | |
8. Rename to lowercase: | |
find . -exec rename -verbose 's!([^/]*\Z)!lc($1)!e' {} + | |
9. Rename to uppercase: | |
find . -exec rename 's!([^/]*\Z)!uc($1)!e' {} + | |
10. Delete symbolic links: | |
find . -type l -delete | |
11. Find ELF files: | |
find /path/to/search/ -exec file {} \; | grep -i "lsb executable" | |
12. Print filenames: | |
find /path/to/search/ -printf '%p' -exec grep foo {} \; | |
Find duplicate files | |
find . ! -empty -type f -exec md5sum {} + | sort | uniq -w32 -dD | |
find -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate | |
Find duplicate lines in two files | |
sort /path/to/file1 /path/to/file2 | uniq -d | |
Find file with text | |
1. Simple search: | |
grep -rnw /path/to/somewhere/ -e 'pattern' | |
-r or -R Recursive | |
-n Display line number | |
-w Match whole word | |
-l Only give filenames of matching files | |
2. Along with these, --exclude, --include, --exclude-dir flags could be used | |
for efficient searching: | |
a. Only search through those files which have .c or .h extensions: | |
grep --include=\*.{c,h} -rnw '/path/to/somewhere/' -e "pattern" | |
b. Exclude searching all the files ending with .o extension: | |
grep --exclude=*.o -rnw '/path/to/somewhere/' -e "pattern" | |
c. For directories it's possible to exclude a particular directory(ies) | |
through --exclude-dir parameter. For e.g, this will exclude the dirs dir1/, | |
dir2/ and all of them matching *.dst/: | |
grep --exclude-dir={dir1,dir2,*.dst} -rnw '/path/to/somewhere/' -e "pattern" | |
Find MAC addresses: | |
sudo ifconfig -a | |
Find process locking a file | |
sudo lsof /path/to/file | |
Fix Fastboot 'no permissions, verify udev rules' (Android devices) | |
1. Determine vendor id. | |
a. Execute 'lsusb'. | |
b. Output will be of form: | |
Bus XXX Device XXX: ID [vendor_id]:[device_id] [device_name] | |
2. Add an entry for the vendor in file '/etc/udev/rules.d/51-android.rules': | |
# Vendor name | |
SUBSYSTEM=="usb", ATTR{idVendor}=="[vendor_id]", MODE="0666", GROUP="plugdev" | |
3. Execute: | |
sudo udevadm control --reload-rules && sudo udevadm trigger && sudo service udev restart | |
Fix '* failed to open vchiq instance' | |
sudo chmod 777 /dev/vchiq | |
Fix Kazam Not Showing System Speaker | |
sudo sed "s/time.clock()/time.perf_counter()/g" -i /usr/lib/python3/dist-packages/kazam/pulseaudio/pulseaudio.py | |
Fix Public Key Not Available | |
1. To Fix error: | |
Failed to fetch http://foo.org/ubuntu/dists/bionic/InRelease The following | |
signatures couldn't be verified because the public key is not available: | |
NO_PUBKEY 1234ABCD5678EFGH | |
2. Run: | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 1234ABCD5678EFGH | |
Flash Storage (SD Card/USB Drive)/SSD Install) | |
1. Turn off recording of access timestamps by adding noatime mount option in | |
'/etc/fstab'. E.g.: | |
UUID=01234567-89ab-cdef-0123-456789abcdef / ext4 defaults,noatime,errors=remount-ro 0 1 | |
2. Use tmpfs for /tmp, /run, /var/spool, /var/tmp in '/etc/fstab'. E.g.: | |
tmpfs /tmp tmpfs noatime,nodev,nosuid,mode=1777 0 0 | |
tmpfs /run tmpfs noatime,nodev,nosuid,mode=1777 0 0 | |
tmpfs /var/spool tmpfs noatime,nodev,nosuid,mode=1777 0 0 | |
tmpfs /var/tmp tmpfs noatime,nodev,nosuid,mode=1777 0 0 | |
3. Reduce swappiness by adding in '/etc/sysctl.conf': | |
vm.swappiness=10 | |
4. In case of SD Card/USB Drive, avoid swap file/partition if possible. | |
Flatpak | |
1. To install Flatpak: | |
sudo add-apt-repository ppa:alexlarsson/flatpak | |
sudo apt update | |
sudo apt install flatpak | |
# Optional Flatpak plugin for the Ubuntu Software app: | |
sudo apt install gnome-software-plugin-flatpak | |
2. Add Flathub repostory: | |
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo | |
3. To search: | |
flatpak search gimp | |
4. To install: | |
flatpak install flathub org.gimp.GIMP | |
5. To run: | |
flatpak run org.gimp.GIMP | |
6. To uninstall: | |
flatpak uninstall org.gimp.GIMP | |
* Other Flatpaks apart from GIMP: | |
Gradio - de.haeckerfelix.gradio | |
Frog - com.github.tenderowl.frog | |
For with iterator | |
for i in {0..4}; do echo "$i"; done # Outputs: 0, 1, 2, 3, 4 | |
...or... | |
for i in {0..9..2}; do echo "$i"; done # Outputs: 0, 2, 4, 6, 8 | |
...or... | |
for (( i=0; i<5; i++ )); do echo "$i"; done | |
* Note: You can also use break (to break out of loop) and continue (to skip | |
to next iteration. | |
Get CPU temperature | |
cat /sys/class/thermal/thermal_zone*/temp | |
Grep PDF: | |
find /path/to/search/ -iname '*.pdf' -exec pdfgrep foo {} + | |
GRUB | |
1. Change timeout: | |
a. Edit '/etc/default/grub'. | |
b. Change 'GRUB_TIMEOUT'. | |
c. Run 'sudo update-grub'. | |
2. Disable probing for other OSes: | |
a. In the file '/etc/default/grub' add: | |
GRUB_DISABLE_OS_PROBER=true | |
b. Run 'sudo updage-grub'. | |
3. Remove hidden timeout: | |
a. Edit '/etc/default/grub'. | |
b. Change 'GRUB_TIMEOUT_STYLE' to 'menu'. | |
c. Run 'sudo update-grub'. | |
4. Verbose Boot: | |
a. Edit '/etc/default/grub'. Change 'GRUB_CMDLINE_LINUX_DEFAULT', removing | |
'splash quiet' and adding '--verbose nosplash'. | |
b. Edit '/etc/grub.d/10_linux'. Change 'quiet_boot="1"' to | |
'quiet_boot="0"'. | |
c. Run 'sudo update-grub'. | |
Hostname | |
Change: | |
hostnamectl set-hostname new_hostname | |
Ignore lid switch | |
Open file '/etc/UPower/UPower.conf'. | |
Change 'IgnoreLid=false' to 'IgnoreLid=true'. | |
Imagemagick | |
Fix error 'convert-im6.q16: attempt to perform an operation not allowed by the | |
security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408.' when trying | |
to create PDF | |
1. Edit file '/etc/ImageMagick-6/policy.xml'. | |
2. Comment out line: | |
<policy domain="coder" rights="none" pattern="PDF" /> | |
Install Nodejs | |
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - | |
sudo apt install -y nodejs | |
Iterate over file lines | |
1. Simple: | |
while read i; do echo "$i"; done < /path/to/file | |
2. Robust: | |
while IFS='' read -r line || [[ -n "$line" ]]; do echo "$line"; done < /path/to/file | |
Iterate over files | |
for f in *.mp3; do ln -s "/source/$f" "/destination/$f"; done; | |
Infinite loop | |
while true; do echo "Hello, world!"; sleep 1; done | |
Hardware Information | |
dmidecode | |
lshw | |
lspci -vv | |
lsusb | |
Journaling | |
1. Check status. Look for absence/presence of flag 'hash_journal' | |
sudo dumpe2fs /dev/sdXY | grep "Filesystem features" | |
2. Disable journaling: | |
sudo tune2fs -O ^has_journal /dev/sdXY | |
3. Clear journal: | |
sudo tune2fs -o discard /dev/sdXY | |
4. Enable journaling: | |
sudo tune2fs -O has_journal /dev/sdXY | |
Kill a process | |
sudo pkill --echo -15 --exact <pattern> | |
LibreOffice | |
English (India) Support in LibreOffice: | |
1. 'English (India)' (en_IN) is equivalent to 'English (UK)' (en_GB). | |
2. Hunspell (Spell check): | |
for e in aff dic; do sudo ln -sv /usr/share/hunspell/en_GB.$e /usr/share/hunspell/en_IN.$e; done | |
3. Mythes (Thesaurus): | |
cd /usr/share/mythes | |
for e in idx dat; do sudo ln -s th_en_US_v2.$e th_en_GB_v2.$e; sudo ln -s th_en_US_v2.$e th_en_IN_v2.$e; done | |
LightDM | |
1. Enable autologin: | |
a. In file '/etc/lightdm.d/lightdm.conf' uncomment & set: | |
[Seat:*] | |
autologin-user=<username> | |
autologin-user-timeout=0 | |
b. Add the user to the group 'autologin': | |
sudo groupadd --system autologin # Create group | |
sudo usermod -aG autologin <username> # Add user to 'autologin' group | |
2. Show user list: In file '/etc/lightdm.d/lightdm.conf' uncomment & set: | |
[Seat:*] | |
greeter-hide-users=false | |
List installed kernels | |
dpkg -l | grep linux-image | |
List lines in file 'foo.txt' but not in file 'bar.txt' | |
awk 'NR==FNR{a[$0]=1;next}!a[$0]' bar.txt foo.txt | |
...or... | |
comm -23 foo.txt bar.txt # For sorted lines | |
List only directories | |
Current directory: | |
ls -d */ | |
Specified directory: | |
ls -d /path/to/specified/directory/*/ | |
Local/UTC time in BIOS | |
Run 'sudo timedatectl set-local-rtc 1' (0 is default i.e. UTC). | |
Location of application files | |
/usr/share/applications/ | |
~/.local/share/applications/ | |
Location of icons | |
/usr/share/icons | |
~/.local/share/icons | |
Location of mime List (File-Application association) | |
~/.config/mimeapps.list | |
MinGW | |
For x86 Windows: | |
i686-w64-mingw32-gcc | |
* Package: gcc-mingw-w64-x86-64 | |
For x64 Windows: | |
x86_64-w64-mingw32-gcc | |
* Package: gcc-mingw-w64-i686 | |
Mount | |
1. Directory (bind mount): | |
mount --bind /some/where /else/where | |
2. Disk/partition image: | |
mount -o loop file.img /media/dir | |
3. R/W overlay over a R/O mount: | |
a. Create required directories: | |
mkdir -p /tmp/mount/{image,tmpfs,rw} | |
b. Mount readonly mount: | |
mount -o ro -o loop /path/to/image /tmp/mount/image | |
c. Create & mount tmpfs overlay: | |
mount -v -t tmpfs -o size=64M none /tmp/mount/tmpfs/ | |
d. Combine readonly and overlay: | |
mount -v -t aufs -o br:/tmp/mount/tmpfs/:/tmp/mount/image/=ro none /tmp/mount/rw | |
4. Unmount File Manage (Nemo etc) mounted device: | |
udisksctl unmount --block-device=/dev/whatever | |
NPM | |
1. Install module globally | |
sudo npm -g install <module> | |
2. List globally installed modules: | |
npm list -g --depth=0 | |
3. List globally installed outdated modules: | |
npm -g outdated | |
4. Uninstall globally installed module: | |
sudo npm -g uninstall <module> | |
5. Update all globally installed modules: | |
sudo npm -g update | |
Nvidia GPU Temperature | |
LD_PRELOAD=/usr/lib/nvidia-384/libnvidia-ml.so nvidia-smi -q -d temperature | |
Open SSL | |
1. Keys: | |
a. Generate RSA private key in file 'private.pem': | |
i. Without passphrase (encryption): | |
openssl genpkey -out /path/to/private.pem -algorithm rsa -pkeyopt rsa_keygen_bits:2048 | |
openssl genrsa -out /path/to/private.pem 2048 | |
* Note: 2048-bit is minimum recommended | |
ii. With passphrase (encryption): | |
openssl genpkey -out /path/to/private.pem -algorithm rsa -pkeyopt rsa_keygen_bits:2048 -des3 | |
openssl genrsa -des3 -out /path/to/private.pem 2048 | |
* Supported encryption algorithms: aes128, aes192, aes256, camellia128, | |
camellia192, camellia256, des (definitely avoid), des3 or idea | |
b. Generate RSA public key in file 'public.pem' from private key in file | |
'private.pem': | |
openssl rsa -in /path/to/private.pem -outform PEM -pubout -out /path/to/public.pem | |
c. Add passphrase (encryption) to private key: | |
openssl rsa -aes256 -in private-clear.pem -out private-encrypted.pem | |
d. Remove passphrase (encryption) from private key: | |
openssl rsa -in private-encrypted.pem -out private-clear.pem | |
2. Encode file: | |
a. Generate private and public keys. | |
b. Generate random password file: | |
openssl rand -out /path/to/password.bin 64 # 64 is size in bytes | |
Note: Create a unique password for each exchange! | |
c. Encode file with random key: | |
openssl enc -aes-256-cbc -salt -in /path/to/file -out /path/to/file.enc -pass file:/path/to/password.bin | |
d. Encode random key with public key: | |
openssl pkeyutl -encrypt -pubin -inkey /path/to/public.pem -in /path/to/password.bin -out /path/to/password.bin.enc | |
openssl rsautl -encrypt -oaep -inkey /path/to/public.pem -pubin -in /path/to/password.bin -out /path/to/password.bin.enc | |
e. Decode encrypted random key with private key: | |
openssl pkeyutl -decrypt -inkey /path/to/private.pem -in /path/to/password.bin.enc -out /path/to/password.bin | |
openssl rsautl -decrypt -oaep -inkey /path/to/private.pem -in /path/to/password.bin.enc -out /path/to/password.bin | |
f. Decode file with decrypted random key: | |
openssl enc -d -aes-256-cbc -in /path/to/file.enc -out /path/to/file -pass file:/path/to/password.bin | |
3. Digitally signing: | |
a. Create a signature file: | |
openssl dgst -sha256 -sign /path/to/file/private.pem -out /path/to/file/signature.txt /path/to/file | |
b. Verify a signature file: | |
openssl dgst -sha256 -verify /path/to/file/public.pem -signature /path/to/file/signature.txt /path/to/file | |
1. Remove all raster images: | |
gs -o output-no-images.pdf -sDEVICE=pdfwrite -dFILTERIMAGE input.pdf | |
2. Remove all text elements: | |
gs -o output-no-texts.pdf -sDEVICE=pdfwrite -dFILTERTEXT input.pdf | |
3. Remove all vector elements: | |
gs -o output-no-vectors.pdf -sDEVICE=pdfwrite -dFILTERVECTOR input.pdf | |
Process Multiline Text | |
echo "Hello, | |
world!" | while read -r l; do echo $l; done | |
Pkexec - Add application | |
For eg to enable 'xed'... | |
1. Create a policy file: '/usr/share/polkit-1/actions/com.linuxmint.xed.policy': | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE policyconfig PUBLIC | |
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" | |
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd"> | |
<policyconfig> | |
<vendor>xed</vendor> | |
<vendor_url>xed</vendor_url> | |
<icon_name>accessories-text-editor</icon_name> | |
<action id="org.freedesktop.policykit.pkexec.xed"> | |
<description>Run 'xed'</description> | |
<message>Authentication is required to run Text Editor</message> | |
<defaults> | |
<allow_any>no</allow_any> | |
<allow_inactive>no</allow_inactive> | |
<allow_active>auth_admin_keep</allow_active> | |
</defaults> | |
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/xed</annotate> | |
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate> | |
</action> | |
</policyconfig> | |
2. Create a script to call xed with pkexec and use it: | |
#!/bin/bash | |
pkexec /usr/bin/xed "$@" | |
Read | |
1. Text entry prompt: | |
read -p "Enter name: " name; echo $name | |
2. Filename entry prompt: | |
read -p "File: " -i "/" -e file; echo $file | |
3. Pause i.e. prompt Press a key to continue | |
read -n1 -rs -p "Press any key to continue..." | |
Read-only bind mount | |
In '/etc/fstab': | |
/path/to/source/ /path/to/dest/ none bind,ro | |
Reduce Footprint | |
1. Remove unnecessary locale: | |
a. Edit '/etc/default/locale' and remove unnecessary locales. | |
b. Delete unnecessary locale directories under '/usr/share/locale/'. | |
2. Remove foreign manpages: | |
sudo rm -frv /usr/share/man/?? /usr/share/man/??_* | |
3. Remove foreign help: | |
for d in /usr/share/help/*/; do if [[ ! $d =~ '/C/' ]]; then sudo rm -frv $d; fi; done | |
Rename with all '.' except the last one replaced with space | |
rename 's/\.(?=[^.]*\.)/ /g' '{}' | |
Remount Read/Write | |
sudo mount -o remount,rw /partition/identifier /mount/point | |
Remove 'Amazon' launcher on Ubuntu | |
sudo apt purge ubuntu-web-launchers | |
Remove Duplicate lines | |
sort /path/to/input-file.txt | uniq | tee /path/to/output-file.txt | |
...or to eliminate all lines with duplicates... | |
sort /path/to/input-file.txt | uniq -u | tee /path/to/output-file.txt | |
Remove LibreOffice | |
sudo apt purge fonts-opensymbol libreoffice libreoffice-* \ | |
openoffice.org-dtd-officedocument1.0 python*-uno uno-libs3-* ure ure-dbg | |
Repair Grub | |
1. Chroot (with /, /boot/, /boot/efi/, /dev/, /proc/, /run/, /sys/, /usr/, /var/) | |
2. update-grub | |
3. grub-install /dev/sda # To reinstall grub if required | |
Replace text in file | |
sed -i 's/original/new/g' /path/to/file | |
Run Perl/Swift file with Notpadqq's 'Run' option | |
Beautify JS: | |
bash -c "uglifyjs -b beautify %path% | zenity --text-info --title='Beautify JS - %filename%' --font='DejaVu Sans Mono' --height=600 --width=900" | |
CSS Lint: | |
bash -c "csslint --format=compact %path% | sed 's|%path%: ||' | zenity --text-info --title='CSS Lint - %filename%' --font='DejaVu Sans Mono' --height=600 --width=900 --no-wrap" | |
G++: | |
x-terminal-emulator -e "bash -c \"g++ %path% -o %path%.out; %path%.out; read -n1 -s -r -p $'\nPress any key to continue...'\"" | |
HTML Hint: | |
bash -c "htmlhint --format=compact --nocolor %path% | zenity --text-info --title='HTML Hint' --font='DejaVu Sans Mono' --height=600 --width=900 --no-wrap" | |
Perl: | |
x-terminal-emulator -e "bash -c \"perl %path%; read -n1 -s -r -p $'\nPress any key to continue...'\"" | |
Swift: | |
x-terminal-emulator -e "bash -c \"swift %path%; read -n1 -s -r -p $'\nPress any key to continue...'\"" | |
Uglify JS: | |
bash -c "uglifyjs -m eval %path% | zenity --text-info --title='Uglify JS - %filename%' --font='DejaVu Sans Mono' --height=600 --width=900" | |
Samba | |
Allow anonymous/guest access from Windows for directory with parents without | |
global access: | |
1. Edit '/etc/samba/smb.conf' as root. | |
2. Below 'workgroup = WORKGROUP' under '[global' add: | |
force user = <linux-user-name> | |
Snap: | |
sudo snap find | |
To list the available packages | |
sudo snap install <package name> | |
To install a package | |
sudo snap list | |
To view all the installed snap packages | |
sudo snap changes | |
To view a list of logged actions | |
sudo snap refresh <package name> | |
To upgrade a package to its latest available version | |
sudo snap remove | |
To uninstall a package | |
SquashFS: | |
Create a squash FS: | |
mksquashfs squashfs-root/ filesystem.squashfs \ | |
-b 1024k -comp xz -Xbcj x86 -Xdict-size 100% -e boot | |
Extract a squash FS: | |
sudo unsquashfs filesystem.squashfs | |
SSH | |
1. Avoid host verification for IP range: | |
Add/create entry in file '~/.ssh/config': | |
Host 192.168.0.* | |
StrictHostKeyChecking no | |
UserKnownHostsFile=/dev/null | |
2. Password less login | |
a. Create private/public key on the client: | |
ssh-keygen -b 4096 -t rsa | |
Note: It asks you to set a passphrase which will interrupt when | |
setting up automated processes. Therefore, press Enter to skip. | |
b. Copy public key to the remote host: | |
ssh-copy-id -i ~/.ssh/id_rsa.pub remote-user@remote-host-ip | |
Note: '~/.ssh/id_rsa.pub' is the default location of the file with public | |
key. | |
c. Disable password authentication on host: | |
i. Edit '/etc/ssh/sshd_config'. | |
ii. Add/set: | |
PasswordAuthentication no | |
iii. Restart ssh service: | |
sudo service ssh restart | |
Sudo - Display asterisk for passwords | |
In the file '/etc/sudoers', change: | |
Defaults env_reset | |
...to... | |
Defaults env_reset,pwfeedback | |
Suspend System | |
systemctl suspend | |
Swap File | |
1. Add: | |
a. Create empty file: | |
sudo dd status=progress if=/dev/zero of=/swapfile bs=1K count=4M # Size 1K * 4M = 4 GiB | |
sudo chmod 600 /swapfile | |
b. Convert newly created file into a swap space file. | |
sudo mkswap /swapfile | |
c. Enable file for paging and swapping. | |
sudo swapon -v /swapfile | |
d. Verify by: | |
swapon -s | |
...or... | |
top -bn1 | grep -i swap | |
e. Add entry to '/etc/fstab': | |
/swapfile none swap sw 0 0 | |
f. Re-test swap file on startup by: | |
sudo swapoff -v /swapfile | |
sudo swapon -va | |
2. Resize existing: | |
a. Disable swap file. | |
sudo swapoff -v /swapfile | |
b. Increase the size of swap file. | |
sudo dd if=/dev/zero of=/swapfile bs=1M count=1024 oflag=append conv=notrunc status=progress | |
* Above command will append 1GiB of zero bytes at end of swap file. | |
c. Convert newly created file into a swap space file. | |
sudo mkswap /swapfile | |
d. Enable file for paging and swapping. | |
sudo swapon -v /swapfile | |
Swap Partition | |
1. Add | |
a. Create an empty partition, say 'sdXY'. | |
b. Format the partition: | |
sudo mkswap /dev/sdXY | |
c. Find UUID of partition: | |
sudo blkid /dev/sdXY | |
d. Mount partition as swap: | |
sudo swapon -U UUID | |
e. Add the partition entry in '/etc/fstab': | |
UUID=xxx none swap sw 0 0 | |
2. Remove cryptswap: | |
a. Disable swap: | |
sudo swapoff -a | |
b. Remove crypt swap: | |
cryptsetup remove cryptswap1 | |
c. Edit '/etc/crypttab' and remove entry for cryptswap. | |
Symbolic Links | |
1. To create a new symlink (will fail if symlink already exists): | |
ln -s /path/to/file /path/to/symlink | |
2. To create or update a symlink: | |
ln -sf /path/to/file /path/to/symlink | |
3. Find symbolic link(s) to a file: | |
find -L /dir/to/start -samefile /dir/of/original/file | |
4. List symbolic link(s) in current path: | |
find . -type l | |
TeamViewer | |
1. Disable service: | |
sudo teamviewer --daemon stop | |
sudo teamviewer --daemon disable | |
2. Setup headless: | |
a. Get latest deb: | |
wget https://dl.teamviewer.com/download/linux/version_14x/teamviewer-host_14.2.8352_armhf.deb | |
b. Install: | |
sudo apt install teamviewer-host_14.2.8352_armhf.deb | |
c. With account: | |
Configure account: | |
sudo teamviewer setup | |
d. Without account: | |
i. Get ID: | |
cat /etc/teamviewer/global.conf | grep ClientID | |
ii. Set password: | |
teamviewer passwd <password> | |
tune2fs: | |
1. See partition info (including reserved blocks): | |
tune2fs -l /dev/sdXY | |
2. Set partition uuid: | |
tune2fs -U <uuid> /dev/sdXY | |
3. Set reserved space on partition as percentage | |
tune2fs -m X /dev/sdYZ | |
* X is percent of space to reserve | |
4. Set reserved space on partition as block count | |
tune2fs -r X /dev/sdYZ | |
* X is block count of space to reserve | |
Type Arbitrary Unicode Character | |
Use: Shift + Ctrl + U and then Unicode value | |
Ufw | |
1. Add rule to allow local traffic: | |
sudo ufw allow from 192.168.0.0/24 comment 'Allow local traffic' | |
sudo ufw allow from 192.168.1.0/24 comment 'Allow local traffic' | |
2. Add rule to open port: | |
sudo ufw allow <port>/tcp comment 'Comment' | |
3. Remove rule: | |
a. List rules: | |
sudo ufw status numbered | |
b. Remove rule as per number: | |
sudo ufw delete [rule-number] | |
4. Enable firewall | |
sudo ufw enable | |
User/Group | |
1. User: | |
a. Add: | |
sudo adduser <username> | |
...or... | |
sudo adduser <username> <usergroup> | |
b. Add user to group: | |
sudo usermod -aG <group> <username> | |
c. Remove user from group: | |
sudo deluser <username> <usergroup> | |
d. Delete: | |
sudo deluser <username> | |
...or... | |
sudo deluser --remove-all-files <username> | |
e. Change password: | |
sudo passwd <username> | |
f. Change username: | |
sudo usermod -l <newName> <oldName> | |
g. Change full name: | |
sudo usermod -c "Full Name" <username> | |
...or... | |
sudo chfn -f "Full Name" <username> | |
h. Change directory: | |
sudo usermod -d /home/newHomeDir -m <username> | |
j. List all users: | |
cut -d: -f1 /etc/passwd | sort | |
k. Delete user password (no account password): | |
sudo passwd --delete <username> | |
2. Group: | |
a. Rename group: | |
groupmod -n <newName> <oldname> | |
b. List all groups available: | |
cut -d: -f1 /etc/group | sort | |
c. List groups of current user: | |
groups | |
VeraCrypt - Run fsck on a container | |
# Decrypt without mounting: | |
sudo veracrypt --filesystem=none --protect-hidden=no /path/to/container | |
# Get list to find mapper | |
sudo veracrypt -l | |
# Run fsck | |
sudo fsck -fVy /dev/mapper/veracryptX | |
# Unmount | |
sudo veracrypt -d /path/to/container | |
VLC | |
1. Enable running as root: | |
sudo sed -i 's/geteuid/getppid/' /usr/bin/vlc | |
2. Fix interface being too big on other screen: | |
a. Create a file '/etc/profile.d/gnome-qt.sh' with following: | |
export QT_AUTO_SCREEN_SCALE_FACTOR=0 | |
b. Restart system. | |
Wget | |
1. Download a page & all files necessary files to properly display HTML: | |
wget --page-requisites http://example.com/your/page.html | |
2. Download with Cookie file: | |
wget --cookies=on --load-cookies=<cookie-file> --continue <path> | |
WiFi | |
1. Connect to hidden network: | |
nmcli c add type wifi con-name <connect name> ifname wlan0 ssid <ssid> | |
nmcli con modify <connect name> wifi-sec.key-mgmt wpa-psk | |
nmcli con modify <connect name> wifi-sec.psk <password> | |
nmcli con up <connect name> | |
2. Passwords: | |
/etc/NetworkManager/system-connections/ | |
Wine | |
1. Installing Adobe Acrobat Pro XI: | |
a. Use a 64-bit/32-bit prefix. | |
b. Install WineTricks: atmlib, corefonts, vcrun2010 | |
WINEPREFIX=/path/to/prefix/ winetricks atmlib corefonts vcrun2010 | |
c. Copy directories and registry entries from an install on a Windows 7 VM. | |
2. Installing Adobe CS6 (DreamWeaver, Photoshop): | |
a. Use a 64-bit/32-bit prefix. | |
b. Install WineTricks: atmlib, corefonts, msxml6, riched30, vcrun2010 | |
WINEPREFIX=/path/to/prefix/ winetricks atmlib corefonts msxml6 riched30 vcrun2010 | |
c. Copy directories and registry entries from an install on a Windows 7 VM. | |
2. Installing CorelDRAW X3: | |
a. Do an install on a VM/Windows machine, and... | |
i. Copy the directory 'C:\Program Files\Corel\'. | |
ii. Export the registry key 'HKEY_LOCAL_MACHINE\Software\Corel\'. | |
b. Create a 32-bit Wine prefix: | |
WINEARCH=win32 WINEPREFIX=/path/to/prefix/ winecfg | |
c. Install WineTricks: gdiplus, ie8, msxml4, vb6run | |
WINEPREFIX=/path/to/prefix/ winetricks gdiplus ie8 msxml4 vb6run | |
d. Install CorelDraw X3. | |
e. Replace installed files with ones copied in step a. i.. | |
f. In Wine regedit, import the REG file exported in step a. ii.. | |
3. Installing Office 2013 x32: | |
a. Install 'winbind' and 'winetricks' apart from 'wine': | |
sudo apt install winbind winetricks | |
b. Create 32-bit prefix: | |
WINEARCH=win32 WINEPREFIX=/path/to/prefix/ winecfg | |
c. Set the windows version as 'Windows 7' for above. | |
d. Install WineTricks: corefonts, msxml6, riched20: | |
WINEPREFIX=/path/to/prefix/ winetricks corefonts msxml6 riched20 | |
e. In Wine registry under 'HKEY_CURRENT_USER\Software\Wine\Direct3D' set | |
the value of DWORD 'MaxVersionGL' as '30002' (hex). | |
f. KMS activation: | |
i. Open regedit and navigate to 'HKLM\Software\Microsoft\OfficeSoftwareProtectionPlatform\' | |
and add string values 'KeyManagementServiceName' with server address and | |
'KeyManagementServicePort' with 1688. | |
ii. Now open and exit any office application. A new key should have been | |
created under 'HKEY_USERS\S-1-5-20\Software\Microsoft\OfficeSoftwareProtectionPlatform'. | |
iii. Under this new key now add a new binary value 'VLRenewalSchedule' | |
with any value. | |
iv. Create a new VB script 'ospp-act.vbs' and execute: | |
Set objWMI = GetObject("winmgmts:" _ | |
& "{impersonationLevel=impersonate}!\\" & "." & "\root\cimv2") | |
ExecuteQuery "ID, ApplicationId, PartialProductKey, Description, | |
Name","PartialProductKey null","OfficeSoftwareProtectionProduct" | |
Function ExecuteQuery(strSelect,strWhere,strClass) | |
Err.Clear | |
If strWhere = "" Then | |
Set productinstances = objWMI.ExecQuery("SELECT " & strSelect & " FROM " & | |
strClass) | |
Else | |
Set productinstances = objWMI.ExecQuery("SELECT " & strSelect & " FROM " & | |
strClass & " WHERE " & strWhere) | |
End If | |
sppErrHandle "" | |
End Function | |
Set count = productinstances.Count | |
For index = 0 to count | |
set instance = productinstances.Item(index) | |
If (LCase(instance.ApplicationId) = OfficeAppId) Then | |
If instance.PartialProductKey "" Then | |
i = i + 1 | |
End If | |
instance.Activate | |
SppErrHandle(strCommand) | |
End If | |
Next | |
4. Running Microsoft Flight Simulator X: | |
a. Use a 32-bit prefix. | |
b. Install WineTricks: | |
WINEPREFIX=/path/to/prefix/ winetricks corefonts d3dx10_43 d3dx9 dinput8 dxdiag quartz vcrun2005 | |
c. Install 'msxml4_sp2' (manually). | |
d. In Libraries for 'dinput8' set (builtin, native). | |
5. Running uBlock u-Centre: | |
a. Copy files under 'C:\Program Files (x86)\' from installation on Windows | |
machine/VM. | |
b. Ensure username is part of 'dialout' group: | |
sudo adduser $(whoami) dialout | |
c. On connection ublox receiver, it should appear as '/dev/ttyUSB0'. | |
'com33' is a symbolic link created for the same by Wine. | |
d. Connect to the ublox receiver using 'com33'. | |
Zip | |
1. Create Windows compatible password protected ZIP archive: | |
zip -9 --encrypt -r --verbose archive.zip /path/to/zip/ | |
2. Test integrity: | |
unzip -t /path/to/file.zip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Brilliant!