Posts

Showing posts from July, 2016

Test your server SSL using OpenSSL cli

HTTPS
   openssl s_client -connect mail.yourserver.com:443

IMAPS
   openssl s_client -connect mail.yourserver.com:993

POP3S
   openssl s_client -connect mail.yourserver.com:995

POP3 TLS
   openssl s_client -connect mail.yourserver.com:110 -starttls pop3

IMAP TLS
   openssl s_client -connect mail.yourserver.com:143 -starttls imap

SMTPS
   openssl s_client -connect mail.yourserver.com:465

SMTP TLS
   openssl s_client -connect mail.yourserver.com:587 -starttls smtp




LVM: Move extents on same disk

I want to move LVM physical extents on the same disk to avoid gap between logical volumes. To visualize physical allocation I use system-config-lvm. Found unused space which size equal to an LV

Find out the LV location:

lvdisplay -m

Show something like this:
 --- Segments ---
  Logical extents 0 to 20479:
    Type                linear
    Physical volume     /dev/sda2
    Physical extents    116224 to 136703

Or use:

pvdisplay -m

  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               Vol01
  PV Size               931.26 GiB / not usable 4.00 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              238402
  Free PE               96578
  Allocated PE          141824

  --- Physical Segments ---
  Physical extent 0 to 38399:
    FREE
  Physical extent 38400 to 39423:
    Logical volume    /dev/Vol01/Swap
    Logical extents    0 to 1023
  Physical extent 39424 to 52223:
    Logical volume    /dev/Vol01/Fedora-root
    Logical extents    0 to 1279…

Create messaging app like whatsie and rambox using chrome

UPDATE:
It is even easier now LOL :
1. Open google-chrome
2. open web app in tab : https://web.whatsapp.com/
3. Menu -> More tools -> Add to desktop
4. Next time you can open the web app using launcher

---

You can create messaging app like whatsie and rambox easily using chrome:
You'll need google-chromeCreate desktop launcher with command:
/usr/bin/google-chrome --user-data-dir=/home/USERNAME/.config/google-chrome-msgLaunch the app Install dark themeOpen and login in multiple tab:
https://web.whatsapp.com/
https://web.telegram.org
add your ownSet chrome to Open specific page or set of pages, Use current
Use alacarte to create desktop launcher, if you got buggy alacarte: cant enter command with parameter, use this:

dnf copr enable biji/misc
dnf install alacarte --best

You can create multiple app launcher with different user-data-dir, for example for multiple whatsapp number





SELinux with Apache / PHP

You have symlink your webapp to /var/www/ but still permission denied. Because file context is still not acceptable by selinux


To list context of folder or file (add -Z):

ls -Z ~khad/workspace/webapp/


To set file or folder read only, but apache can access:

chcon -R -t httpd_sys_content_t ~khad/workspace/webapp/


To set file or folder read and write, but apache can access:

chcon -R -t httpd_sys_rw_content_t ~khad/workspace/webapp/temp/


To allow connect network and database:

#setsebool -P httpd_can_network_connect 1
setsebool -P httpd_can_network_connect_db 1