Posts

Convert existing ext4 filesystem to btrfs

Image
What I want to achieve is getting btrfs features like snapshots, compression and deduplication The problem is, my system already running and containing data, filesystem is ext4 under linux lvm. So I will convert existing ext4 filesystem to btrfs, keeping lvm partition, and only /home will be converted   Converting to btrfs in-place LVM partition: NAME                      MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT sda                         8:0    0 465.8G  0 disk   ├─sda1                      8:1    0   123M  0 part /boot/efi ├─sda2           ...

Fix Wi-Fi disconnected randomly

Your Wi-Fi signal strength is good, but sometimes disconnects randomly, why? Found this on Ms Windows forum, to fix the issue you just need to use higher Wi-Fi channel >6 . The reason is the low channel is having interference with the Bluetooth signal, for example when I use TWS earphones Update: also set channel width to 40MHz if your router supports it

Headless print using chrome

To print to PDF using chrome cli: google-chrome --headless --disable-gpu --print-to-pdf-no-header --print-to-pdf=output.pdf source.html Ref: https://developers.google.com/web/updates/2017/04/headless-chrome Ref: https://stackoverflow.com/questions/55418415/disable-chromes-default-headers-footers-in-headless-print-to-pdf

Remote your linux gui using Android

Image
Linux Install these packages on Fedora 32: $ dnf install xrdp tigervnc-server-minimal $ systemctl start xrdp To enable on start up: $ systemctl enable xrdp Then log out current user (necessary if you will remote using same user) Android Install Microsoft Remote Desktop Add PC, PC name: enter IP address User name: add user account, with invalid password Try to connect, click OK to show login screen then login as with correct password Note: If necessary open port 3389/tcp

How to get all hosts from DNS

dig AXFR your-domain.com @your.dns.server.com Example output: a.your-domain.com.    38400    IN    A    128.123.123.123 b.your-domain.com.    38400    IN    A    128.123.123.123 c.your-domain.com.    38400    IN    A    167.128.123.123  Your IP Address must be included in Allow transfers from..  

Checkout github pull requests locally

Edit .git/config and add bold text below: [remote "origin"]         url = https://github.com/you/your_project.git         fetch = +refs/heads/*:refs/remotes/origin/*         fetch = +refs/pull/*/head:refs/remotes/origin/pr/*   [branch "master"]         remote = origin         merge = refs/heads/master  [remote "master"]         url = https://github.com/friend /friend_project.git         fetch = +refs/heads/*:refs/remotes/master/*         fetch = +refs/pull/*/head:refs/remotes/master/pr/* Then do: git fetch --all And merge example: git merge remotes/origin/pr/2

Using semi automatic espresso machine

Image
How to pull better espresso shot using semi automatic machine? Use burr grinder, really make difference Grind fine but not like powder Preheat portafilter first, wait temp reached and pump water only Fill portafilter with ground and tamp it Wait until temperature reached  Put portafilter into machine You'll need small one shot glass for measuring, put another cup in second spout Press pump button, and stop until 1 ounce or 1 1/2 ounce Result: 😎 Next learn how to froth milk.. 🍼

Manually clean up zimbra zmcat/zmcpustat exploit

Symptoms: server load high, cpu usage 300% To clean up manually follow this steps: STOP the process but dont kill it, use kill -STOP [PID] Hide from search engine (su zimbra): zmprov mcf zimbraMailKeepOutWebCrawlers TRUE +zimbraResponseHeader "X-Robots-Tag: noindex" chmod 755 /opt/zimbra/data/tmp/ chmod 755 /opt/zimbra/data/tmp/upload Delete malicious JSP, find using this command: grep -R '(request.getParameter.' /opt/zimbra/mailboxd /opt/zimbra/jetty For example: /opt/zimbra/mailboxd/webapps/zimbraAdmin/public/jsp/Alert.jsp and /opt/zimbra/jetty/webapps/zimbra/js/zimbra/csfe/XZimbra.jsp > /opt/zimbra/mailboxd/webapps/zimbraAdmin/public/jsp/Alert.jsp > /opt/zimbra/jetty/webapps/zimbra/js/zimbra/csfe/XZimbra.jsp chattr +i /opt/zimbra/mailboxd/webapps/zimbraAdmin/public/jsp/Alert.jsp /opt/zimbra/jetty/webapps/zimbra/js/zimbra/csfe/XZimbra.jsp Fix modified jsp files, find using: rpm -qa zimbra* | xargs rpm -qV - | egrep -E '^.{2}5' | grep .jsp For...

Always use TLS when sending email

Image
Email filtering by ISP today is very bad, returning 250 2.0.0 OK but actually no email was sent, your email is lost. Also someone can read your email when sent How do you know if your email has been filtered or not? try telnet to the external smtp server port 25, the normal response should be like this: And when filtered, response like this: See, there are no STARTTLS in the filtered network, so the e-mail client is forced to send in plain text, unencrypted. Not only email clients, but also applications that send notifications via email Tips: Use other SMTP port like 587, 465 Always use TLS in your mail client SMTP setting: STARTTLS or SSL/TLS

Toolbox for development environment

Image
Fedora 31 have a new feature called Toolbox. Toolbox is great for installing development environment without cluttering base system Ref: https://docs.fedoraproject.org/en-US/fedora-silverblue/toolbox/ Check out my terminal recording, installing PHP 5.6:

Optimize SSD on Linux

After installing the SSD on your laptop, there are some adjustments that need to be done so that it is optimal . I'm using Fedora 30 File system My Partition is: Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors Disk model: Samsung SSD 860 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: DF4E716F-F00A-40F3-8176-C97A52F36998 Device      Start       End   Sectors   Size Type /dev/sda1    2048    253951    251904   123M EFI System /dev/sda2  253952 976773119 976519168 465.7G Linux LVM And logical volume are: Root, Home, Archive, VM, Games Format as ext4 with default block size (4096 best for SSD), and set reserved block to 1% # mkfs.ext4 -L Home -m 1 /dev/VG/YourHome Copying I did not reinstall lin...