Posts

Rocky linux 9 cant login

Rocky/Redhat linux 9 cant login from ssh or console (password/key accepted but suddenly logout) 1. Boot into recovery 2. Mount root to /mnt 3. touch /mnt/.autorelabel reboot 4.  or disable selinux in /etc/selinux/config reboot      

Wireless printing from Android phone

Setup printer to connect to wifi ap, and note the printer's ip address Install Moria print service : https://play.google.com/store/apps/details?id=org.mopria.printplugin Add new printer using ip address Test printing a pdf file, choose moria print service Set printer plugin service app's setting to Battery - Unrestricted (required if having issue, page not printed fully) Dont skip step 3) even if your printer already in list Step 2) you can also install HP Print Service plugin              

Reduce PDF file size

We can use ghostscript or ps2pdf:   gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=outputA.pdf input.pdf ps2pdf -dPDFSETTINGS=/screen input.pdf output.pdf   Ghostscript should produce more compatible output.pdf by running twice: gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output-Final.pdf outputA.pdf > Reference  

Regenerate SSH host keys

How to regenerate SSH host keys , when a server give error "connection closed" on SSH2_MSG_KEXINIT rm -f /etc/ssh/ssh_host* reboot # host key will be generated after reboot For Rocky Linux 8: Edit and comment lines in /etc/systemd/system/sshd-keygen@.service.d/disable-sshd-keygen-if-cloud-init-active.conf Or ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -q -t rsa ssh-keygen -f /etc/ssh/ssh_host_ecdsa_key -N '' -q -t ecdsa ssh-keygen -f /etc/ssh/ssh_host_ed25519_key -N '' -q -t ed25519 systemctl restart sshd  

Civilization VI launch options

Steam launch options for Civilization VI to run under Linux: env __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia __VK_LAYER_NV_optimus=NVIDIA_only LD_PRELOAD=/home/USERNAME/.local/share/Steam/ubuntu12_64/steam-runtime-heavy/usr/lib/x86_64-linux-gnu/libfontconfig.so.1 %command% To run using nvidia gpu, remove if not using nvidia: __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia __VK_LAYER_NV_optimus=NVIDIA_only   Load compatible library: LD_PRELOAD=/home/ USERNAME /.local/share/Steam/ubuntu12_64/steam-runtime-heavy/usr/lib/x86_64-linux-gnu/libfontconfig.so.1

xbox 360 game controller clone

My usb gamepad is detected but no button registered. To fix, install latest module from https://github.com/paroj/xpad sudo su git clone https://github.com/paroj/xpad.git /usr/src/xpad-0.4 dkms install -m xpad -v 0.4 reboot

Simple cctv using webcam

Install motion sudo dnf install motion Edit ~/.motion/motion.conf stream_port 8081 stream_localhost off # comment below to save .mkv movie_output off Run motion: motion Open browser from other device: http://desktop-ip:8081/