Monday, 30 September 2019
Sunday, 29 September 2019
Linux Ubuntu Firewall UFW - $ sudo ufw app list $ sudo ufw app info "Nginx HTTP"
-
To view which applications have installed a profile, enter the following in a terminal:
sudo ufw app list
-
Similar to allowing traffic to a port, using an application profile is accomplished by entering:
sudo ufw allow Samba
Seen above is text from URL =
https://help.ubuntu.com/lts/serverguide/firewall.html#firewall-ufw
The example needs to be corrected to include the APPLICATION name within Double Quotes
dhankar@dhankar-VPCEB44EN:~/Desktop$ sudo ufw app list [sudo] password for dhankar: Available applications: CUPS Nginx Full Nginx HTTP Nginx HTTPS OpenSSH Samba dhankar@dhankar-VPCEB44EN:~/Desktop$ sudo ufw app info NginxHTTP ERROR: Could not find profile 'NginxHTTP' dhankar@dhankar-VPCEB44EN:~/Desktop$ sudo ufw app info Nginx HTTP ERROR: Could not find profile 'Nginx' dhankar@dhankar-VPCEB44EN:~/Desktop$ sudo ufw app info "Nginx HTTP" Profile: Nginx HTTP Title: Web Server (Nginx, HTTP) Description: Small, but very powerful and efficient web server Port: 80/tcp dhankar@dhankar-VPCEB44EN:~/Desktop$
Author - ROHIT DHANKAR
Saturday, 28 September 2019
Ubuntu UFW logs SRC=192.168.0.1 DST=224.0.0.1 DST=224.0.0.251
Ubuntu UFW logs SRC=192.168.0.1 DST=224.0.0.1 DST=224.0.0.251 , seeing a lot of repeated entries in the UFW - firewall Logs .
My reason for snooping around my Firewall Logs .
Created a CERTBOT certificate and launched a local Django server behind Nginx and uWsgi . Everything was good till i called my ISP cable guy to come and have a look - help me with connecting 2 macBooks that i have installed Ubuntu on with ETHERNET cables - in place of the usual Wifi.
I want to connect the ETHERNEt cables directly into my STATIC IP modem , and not the DLINK DIR 816 Router.
The cable guy from ISP says thats not possible as all but one Ports are blocked on the ALCATEL modem . fair enough - he then upgrades my DLINK DIR 816 Router with another DLINK DIR 816 Router , with an upgraded version of Firmware ==1.09.
I check the ETHERNET n presume im good to go - next few days coding , not testing my access to Nginx >> uWsgi >> Django dev server.
Today no access -
$ curl https://digitalcognition.co.incurl: (60) server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
More details here: http://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
$ curl http://digitalcognition.co.in
<script>
<!--
window.location.href = "/cgi-bin/webproc";
-->
</script>
$
havent changed much on the UFW side --- but surely the Logs have changed - for the better or worse still figuring that out ...
My reason for snooping around my Firewall Logs .
Created a CERTBOT certificate and launched a local Django server behind Nginx and uWsgi . Everything was good till i called my ISP cable guy to come and have a look - help me with connecting 2 macBooks that i have installed Ubuntu on with ETHERNET cables - in place of the usual Wifi.
I want to connect the ETHERNEt cables directly into my STATIC IP modem , and not the DLINK DIR 816 Router.
The cable guy from ISP says thats not possible as all but one Ports are blocked on the ALCATEL modem . fair enough - he then upgrades my DLINK DIR 816 Router with another DLINK DIR 816 Router , with an upgraded version of Firmware ==1.09.
I check the ETHERNET n presume im good to go - next few days coding , not testing my access to Nginx >> uWsgi >> Django dev server.
Today no access -
$ curl https://digitalcognition.co.incurl: (60) server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
More details here: http://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
$ curl http://digitalcognition.co.in
<script>
<!--
window.location.href = "/cgi-bin/webproc";
-->
</script>
$
havent changed much on the UFW side --- but surely the Logs have changed - for the better or worse still figuring that out ...
Wednesday, 25 September 2019
[SOLVED ] -- Linux Ubuntu Xenial - kernel panic - not syncing : VFS : Unable to mount root fs
#Seen below , ID for recent Kernel = 4.4.0-164-generic , which is the Kernel which was being auto-updated by the GUI , its labeled as NOT TAINTED , this i need to check further - whats with the NOT TAINTED ?
#
kernel panic - not syncing : VFS : Unable to mount root fs on unknown-block(0,0)
CPU: 1 PID : 1 Comm: swapper/0 not tainted 4.4.0-164-generic #192-Ubuntu
Hardware name : Apple Inc. MacbookPro5.5/Mac-F2268ACB , BIOS MBP55.88Z.00AC.B03.0906151708 06/15/09
Call Trace :
dump_stack*0x63/0x82
panic+0xd3/
Solved by hard shutdown , again started and got into the GNU GRUB menu - the screen with the prompt == grub>
This was the wrong place to be - thus == grub> normal ... and yes now back to the GRUB MENU.
#
Here 2 Kernels listed - 1/ 4.4.0-164-generic , with (upstart) and (recovery mode), 2/ 4.4.0-31-generic , with (upstart) and (recovery mode)
Went ahead and chose -
4.4.0-31-generic , did not use a live disc or usb to boot back in , as of now all systems - Go !! lets see what else is required ...
#Further reading ....
SPECIAL CASE --- User Created OWN CUSTOM KERNEL --- https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1653636
#
kernel panic - not syncing : VFS : Unable to mount root fs on unknown-block(0,0)
CPU: 1 PID : 1 Comm: swapper/0 not tainted 4.4.0-164-generic #192-Ubuntu
Hardware name : Apple Inc. MacbookPro5.5/Mac-F2268ACB , BIOS MBP55.88Z.00AC.B03.0906151708 06/15/09
Call Trace :
dump_stack*0x63/0x82
panic+0xd3/
Solved by hard shutdown , again started and got into the GNU GRUB menu - the screen with the prompt == grub>
This was the wrong place to be - thus == grub> normal ... and yes now back to the GRUB MENU.
#
Here 2 Kernels listed - 1/ 4.4.0-164-generic , with (upstart) and (recovery mode), 2/ 4.4.0-31-generic , with (upstart) and (recovery mode)
Went ahead and chose -
4.4.0-31-generic , did not use a live disc or usb to boot back in , as of now all systems - Go !! lets see what else is required ...
#Further reading ....
SPECIAL CASE --- User Created OWN CUSTOM KERNEL --- https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1653636
Monday, 23 September 2019
[SOLVED] -- UBUNTU Xenial on a MacBook Pro - E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
# New Ubuntu Xenial , installed on a Macbook - need to get VSCode n Git etc ..
# Ubuntu installer/updater has Locked the LOCK ....details as below
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
#
$ ps aux | grep -i apt
root 2340 0.0 0.0 4508 1780 ? Ss 11:13 0:00 /bin/sh /usr/lib/apt/apt.systemd.daily
root 4060 0.1 0.9 227196 34564 ? SNl 11:15 0:00 /usr/bin/python3 /usr/sbin/aptd
dhankar 4729 0.0 0.0 21292 944 pts/2 S+ 11:21 0:00 grep --color=auto -i apt
#
$ sudo kill -9 2340
$ ps aux | grep -i apt
root 4060 0.2 2.8 298996 106788 ? SNl 11:15 0:02 /usr/bin/python3 /usr/sbin/aptd
dhankar 5223 0.0 0.0 21292 980 pts/2 S+ 11:32 0:00 grep --color=auto -i apt
$ sudo kill -9 4060
$ ps aux | grep -i apt
dhankar 5233 0.0 0.0 21292 1060 pts/2 S+ 11:33 0:00 grep --color=auto -i apt
$ sudo kill -9 5233
$ ps aux | grep -i apt
dhankar 5254 0.0 0.0 21292 924 pts/2 S+ 11:33 0:00 grep --color=auto -i apt
### Seen above ---ps aux ---- will also pick my own GREP of APT and display ... which is ok
#
#
$ sudo apt install git
Reading package lists... Done
Building dependency tree
# Ubuntu installer/updater has Locked the LOCK ....details as below
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
#
$ ps aux | grep -i apt
root 2340 0.0 0.0 4508 1780 ? Ss 11:13 0:00 /bin/sh /usr/lib/apt/apt.systemd.daily
root 4060 0.1 0.9 227196 34564 ? SNl 11:15 0:00 /usr/bin/python3 /usr/sbin/aptd
dhankar 4729 0.0 0.0 21292 944 pts/2 S+ 11:21 0:00 grep --color=auto -i apt
#
$ sudo kill -9 2340
$ ps aux | grep -i apt
root 4060 0.2 2.8 298996 106788 ? SNl 11:15 0:02 /usr/bin/python3 /usr/sbin/aptd
dhankar 5223 0.0 0.0 21292 980 pts/2 S+ 11:32 0:00 grep --color=auto -i apt
$ sudo kill -9 4060
$ ps aux | grep -i apt
dhankar 5233 0.0 0.0 21292 1060 pts/2 S+ 11:33 0:00 grep --color=auto -i apt
$ sudo kill -9 5233
$ ps aux | grep -i apt
dhankar 5254 0.0 0.0 21292 924 pts/2 S+ 11:33 0:00 grep --color=auto -i apt
### Seen above ---ps aux ---- will also pick my own GREP of APT and display ... which is ok
#
#
$ sudo apt install git
Reading package lists... Done
Building dependency tree
Monday, 16 September 2019
MySQL Dump to be taken before i Upgrade mySQL and / or CreateDb's/ tables for a New Django project
#Own mySQL Version
$ mysql –version mysql Ver 14.14 Distrib 5.7.27
$ sudo mkdir -p /var/run/mysqld
$ sudo chown mysql:mysql /var/run/mysqld
$ cd /var/run/mysqld
:/var/run/mysqld$ ls -ltr
# Seen below result of $ ls -ltr
# We can notice the last line of the command $ ls -ltr , or we can make life easier and do a grep
:/var/run$ ls -ltr | grep mysqld
drwxr-xr-x 2 mysql mysql 40 Sep 16 18:50 mysqld
# Thus , it shows that within the directory - /var/run/ , there has been created a directory named - mysqld - which is owned by - mysql
# Also the /var/run$ ls -ltr --human-readable | grep mysqld
drwxr-xr-x 2 mysql mysql 40 Sep 16 18:50 mysqld
# Output will be same ...
$ mysql –version mysql Ver 14.14 Distrib 5.7.27
$ sudo mkdir -p /var/run/mysqld
$ sudo chown mysql:mysql /var/run/mysqld
$ cd /var/run/mysqld
:/var/run/mysqld$ ls -ltr
# Seen below result of $ ls -ltr
# We can notice the last line of the command $ ls -ltr , or we can make life easier and do a grep
:/var/run$ ls -ltr | grep mysqld
drwxr-xr-x 2 mysql mysql 40 Sep 16 18:50 mysqld
# Thus , it shows that within the directory - /var/run/ , there has been created a directory named - mysqld - which is owned by - mysql
# Also the /var/run$ ls -ltr --human-readable | grep mysqld
drwxr-xr-x 2 mysql mysql 40 Sep 16 18:50 mysqld
# Output will be same ...
Subscribe to:
Posts (Atom)