AttributeError: ‘module’ object has no attribute ‘DeprecatedIn12’

If you are playing with certbot on CenOS7 and you encounter the thing below, it’s due to a Python library that should be upgraded: AttributeError: ‘module’ object has no attribute ‘DeprecatedIn12’ pip install cryptography –upgrade pip install –upgrade pip then again: pip install cryptography –upgrade After this, you should be able to use certbot without any […]

Amazon EC2 change hostname – OpenSUSE

I am just getting to know OpenSUSE and it’s been driving me insane with the hostname not being persistent even if you change it via “hostnamectl” or entering the new hostname in “/etc/hostname”. In EC2, you have to open up yast and uncheck the “change hostname via DHCP tick box” in the network card settings. Tweet

Self signed SSL – quick and dirty

If you’re in the market for quickly getting a self signed SSL certificate done: openssl genrsa -des3 -passout pass:x -out server.pass.key 2048 openssl rsa -passin pass:x -in server.pass.key -out server.key openssl req -new -key server.key -out server.csr openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt ls -la -rw-r–r–. 1 root root 1387 […]

Changing SSH port in CentOS with SELinux enabled

So, you wanted to change the ssh port, but when you restart sshd : “systemctl restart sshd” – it doesn’t wanna come up due to selinux not allowing it: Apr 26 12:31:21 ip-10-0-0-169 systemd[1]: Starting OpenSSH server daemon… — Subject: Unit sshd.service has begun start-up — Defined-By: systemd — Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel — — Unit sshd.service […]

Fix ESC git diff / FreeBSD

So let’s say you are trying to do a git diff and it looks like crap: ESC[1mdiff –git a/node_modules/namecheap/namecheap.js b/node_modules/namecheap/namecheap.jsESC[m ESC[1mindex df87fc0..dde8ea0 100644ESC[m ESC[1m— a/node_modules/namecheap/namecheap.jsESC[m ESC[1m+++ b/node_modules/namecheap/namecheap.jsESC[m ESC[36m@@ -276,15 +276,15 @@ESC[m ESC[mnamecheap.prototype = {ESC[m fix it by doing : git config –global core.pager “less -r” Enjoy Tweet

git – large file removed but still can’t push

So i have a git repo where a large file got commited by mistake: git push origin master Counting objects: 2480, done. Delta compression using up to 4 threads. Compressing objects: 100% (1922/1922), done. Writing objects: 100% (2480/2480), 484.14 MiB | 15.10 MiB/s, done. Total 2480 (delta 697), reused 0 (delta 0) remote: error: GH001: […]

htaccess redirect https:// to www and vice versa

RewriteEngine On RewriteBase / # Redirect to www RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ RewriteCond %{HTTPS}s ^on(s)| RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] #Redirect to https:// RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ https://%1/$1 [R=301,L] Enjoy Tweet