Wednesday, 8 April 2026

Cluster DB notes

Status of ASM and DB: srvctl status asm srvctl status database -d rac Start / Stop Instance: srvctl start instance -d rac -i rac2 srvctl stop instance -d rac -i rac2 Listener: srvctl status listener srvctl status scan_listener Cluster Auto Start: crsctl stat res -t crsctl status res -f | grep AUTO_START e.g. crsctl status res ora.rac.db -f | grep AUTO_START AUTO_START=restore crsctl status res ora.asm -f | grep AUTO_START AUTO_START=always

Tuesday, 31 March 2026

Oracle Clusterware Logs

CRS: /u01/app/grid/diag/crs/[DB_NAME]/crs/trace/ alert.log ASM: /u01/app/grid/diag/asm/+asm/+ASM1/trace/alert_+ASM1.log Force a shutdown of Oracle Clusterware (CRS) : Using root cd /u01/app/19.0.0/grid/bin ./crsctl stop crs -f Check detail of network card e.g. [oracle@srv1 bin]$ nmcli device show enp0s10 GENERAL.DEVICE: enp0s10 GENERAL.TYPE: ethernet GENERAL.HWADDR: 08:00:27:62:8A:33 GENERAL.MTU: 1500 GENERAL.STATE: 100 (connected) GENERAL.CONNECTION: Wired connection 5 GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/3 WIRED-PROPERTIES.CARRIER: on IP4.ADDRESS[1]: 192.168.1.140/24 IP4.GATEWAY: 192.168.1.1 IP4.ROUTE[1]: dst = 0.0.0.0/0, nh = 192.168.1.1, mt = 102 IP4.ROUTE[2]: dst = 192.168.1.0/24, nh = 0.0.0.0, mt = 102 IP4.DNS[1]: 192.168.1.1 IP6.ADDRESS[1]: fe80::5f91:3967:1437:483f/64 IP6.GATEWAY: -- IP6.ROUTE[1]: dst = fe80::/64, nh = ::, mt = 102 IP6.ROUTE[2]: dst = ff00::/8, nh = ::, mt = 256, table=255 [oracle@srv1 bin]$

Monday, 15 May 2023

Make bootable Mac OS usb for 2011 iMac, 2012 MacAir,

 This USB fixed my issue of creating a bootable MAC OS USB

https://www.youtube.com/watch?v=64IOWM8ezyk


1. Download High Sierra 10.13 from https://support.apple.com/en-gb/HT211683 2. Go to Application Admins-MacBook-Air:~ root# /Applications/Install macOS High Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/Usb32 --applicationpath /Applications/Install macOS High Sierra.app Ready to start. To continue we need to erase the volume at /Volumes/Usb32. If you wish to continue type (Y) then press return: y Erasing Disk: 0%... 10%... 20%... 30%...100%... Copying installer files to disk... Copy complete. Making disk bootable... Copying boot files... Copy complete. Done.

Wednesday, 23 November 2022

PHP Tuning / PHP Config

After install, getting lot of Warning / Notice in my application e.g. Notice: Undefined index: isimg in /Library/WebServer/Documents/myproject/products/prodList.php on line 459 Fix was changed following var in php.ini From error_reporting=E_ALL & ~E_DEPRECATED & ~E_STRICT To error_reporting=E_ALL & ~E_NOTICE Don't forget to restart apache for the change to take effect. On my Mac17 files in vi /Applications/XAMPP/etc/php.ini

Saturday, 6 August 2022

MySQL change sroage for all tables

MySQL move from MyISAM to InnoDB Simple dynamic SQL to change stoage type in MySQL SELECT concat('alter table ', table_name, ' engine=innodb;') SQL_strg FROM information_schema.tables WHERE table_schema = 'db_dev_db' and engine='MyISAM';

Thursday, 26 May 2022

Tomcat & JDBC error connecting to 19c

ORA-28040: No matching authentication protocol
This is quite generic error.
This fixed worked for me.
  • 1. Find the JDBC driver that is being used, jdbc.jar can reside in many location e.g.
    1. $CATALINA_HOME/lib/
      webapps/myApp/WEB-INF/lib
  • 2. Updated the correct JDBC in your location
  • 3. Restart tomcat
  • Thursday, 17 February 2022

    Count Actual Rows of Every Tables (MySQL)

    On root database run, 1st change to your_db_name: SELECT CONCAT('SELECT ''',table_name,''', COUNT(*) FROM ', table_name, ' union all') FROM information_schema.tables WHERE table_schema = 'your_db_name'; Then connect to your database and remove the last 'union all' and add ';' then run sql e.g. MariaDB > use db_dev_01; MariaDB [db_dev_01]> SELECT 'APPLICATIONS', COUNT(*) FROM APPLICATIONS union all -> SELECT 'ATTRIBUTE', COUNT(*) FROM ATTRIBUTE union all .... .... .... -> SELECT 'ZBS_LOG', COUNT(*) FROM ZBS_LOG;

    Thursday, 10 February 2022

    Mac Mini MySQL 5.6 start stop

    MySQL 5.6 on Mac Start / Stop # launchctl unload -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist # launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist # mysql -u root -p Update config to tune MySQL cache cd /etc vi my.cnf

    Mac MySQL tuning - basic

    mysql> show variables like 'query_cache_%' ; +------------------------------+---------+ | Variable_name | Value | +------------------------------+---------+ | query_cache_limit | 1048576 | | query_cache_min_res_unit | 4096 | | query_cache_size | 1048576 | | query_cache_type | OFF | | query_cache_wlock_invalidate | OFF | +------------------------------+---------+ 5 rows in set (0.07 sec) Above is 1MB for both _limit and _size My 2022 Tuning setting # cd /usr/local/mysql # vi my.cnf query_cache_limit = 2M query_cache_size = 256M query_cache_type = 1 innodb_buffer_pool_size=1G mysql> show variables like 'query_ca%'; +------------------------------+-----------+ | Variable_name | Value | +------------------------------+-----------+ | query_cache_limit | 2097152 | | query_cache_min_res_unit | 4096 | | query_cache_size | 268435456 | | query_cache_type | ON | | query_cache_wlock_invalidate | OFF | +------------------------------+-----------+ 5 rows in set (0.00 sec) Start Stop MySQL (5.6.22) on Mac mini Catalina # /usr/local/mysql/support-files/mysql.server stop Shutting down MySQL . SUCCESS! # /usr/local/mysql/support-files/mysql.server start Starting MySQL .. SUCCESS! # On my 2022 install, Mac Mini (2012) i5, 8GB

    Saturday, 16 January 2021

    MySQL 8 filling up disk (Linux, Ubuntu, MySQL 8.0.22, binlog)

    Disk was 100% full, noticed following folder was taking up most of the space, with lot of files like 'binlog.000024'. Quick fix was purge those files via MySQL see end of this doc. /var/lib/mysql Show variables like 'binlog%'; mysql> show variables like 'binlog%'; +------------------------------------------------+--------------+ | Variable_name | Value | +------------------------------------------------+--------------+ | binlog_cache_size | 32768 | | binlog_checksum | CRC32 | | binlog_direct_non_transactional_updates | OFF | | binlog_encryption | OFF | | binlog_error_action | ABORT_SERVER | | binlog_expire_logs_seconds | 2592000 | | binlog_format | ROW | | binlog_group_commit_sync_delay | 0 | | binlog_group_commit_sync_no_delay_count | 0 | | binlog_gtid_simple_recovery | ON | | binlog_max_flush_queue_time | 0 | | binlog_order_commits | ON | | binlog_rotate_encryption_master_key_at_startup | OFF | | binlog_row_event_max_size | 8192 | | binlog_row_image | FULL | | binlog_row_metadata | MINIMAL | | binlog_row_value_options | | | binlog_rows_query_log_events | OFF | | binlog_stmt_cache_size | 32768 | | binlog_transaction_compression | OFF | | binlog_transaction_compression_level_zstd | 3 | | binlog_transaction_dependency_history_size | 25000 | | binlog_transaction_dependency_tracking | COMMIT_ORDER | +------------------------------------------------+--------------+ 23 rows in set (0.01 sec) Note : 2592000 (seconds) / 60 / 60 / 24 is 30 days. Now added to config file # vi /etc/mysql/my.cnf [mysqld] binlog_expire_logs_seconds=172800 Restart MySQL # service mysql stop # service mysql start mysql> show variables like 'binlog%'; +------------------------------------------------+--------------+ | Variable_name | Value | +------------------------------------------------+--------------+ | binlog_cache_size | 32768 | | binlog_checksum | CRC32 | | binlog_direct_non_transactional_updates | OFF | | binlog_encryption | OFF | | binlog_error_action | ABORT_SERVER | | binlog_expire_logs_seconds | 172800 | | binlog_format | ROW | | binlog_group_commit_sync_delay | 0 | | binlog_group_commit_sync_no_delay_count | 0 | | binlog_gtid_simple_recovery | ON | | binlog_max_flush_queue_time | 0 | | binlog_order_commits | ON | | binlog_rotate_encryption_master_key_at_startup | OFF | | binlog_row_event_max_size | 8192 | | binlog_row_image | FULL | | binlog_row_metadata | MINIMAL | | binlog_row_value_options | | | binlog_rows_query_log_events | OFF | | binlog_stmt_cache_size | 32768 | | binlog_transaction_compression | OFF | | binlog_transaction_compression_level_zstd | 3 | | binlog_transaction_dependency_history_size | 25000 | | binlog_transaction_dependency_tracking | COMMIT_ORDER | +------------------------------------------------+--------------+ 23 rows in set (0.01 sec) Manullay purge log from MySql, files are deleted from filesystem (worked fine on 16 Jan 2021) PURGE BINARY LOGS BEFORE '2020-12-28 22:46:26';

    Wednesday, 2 December 2020

    Ubuntu Fully remove software | Reinstall is not working correctly, due to last install

    How to completely remove a package?

    How to fully remove a package?

    I have installed software Munin and then removed it and tried to install again, 2nd install did not have the config files, so used below, which fully removed the sofware and new install was fine with all config.
    Removing packages with sudo apt purge ... or sudo apt --purge remove ... will remove them and all their global (i.e., systemwide) configuration files.

    # apt-get --purge remove munin
    I removing using just remove, some folders were there for software, so removed them usin 'rm', then performed an install, it did not install fully with the config fixes. So the --purge did the trick for me. root@linux-u20:~# apt remove munin munin-node Reading package lists... Done Building dependency tree Reading state information... Done Package 'munin' is not installed, so not removed Package 'munin-node' is not installed, so not removed The following packages were automatically installed and are no longer required: jo jq libalgorithm-c3-perl libb-hooks-endofscope-perl libb-hooks-op-check-perl libclass-c3-perl libclass-c3-xs-perl libclass-data-inheritable-perl libclass-method-modifiers-perl libclass-xsaccessor-perl libdata-optlist-perl libdate-manip-perl libdbi1 libdevel-callchecker-perl libdevel-caller-perl libdevel-globaldestruction-perl libdevel-lexalias-perl libdevel-stacktrace-perl libdist-checkconflicts-perl libdynaloader-functions-perl libemail-date-format-perl libeval-closure-perl libexception-class-perl libexporter-tiny-perl libfile-copy-recursive-perl libio-multiplex-perl libipc-shareable-perl libjq1 liblist-moreutils-perl liblog-dispatch-perl liblog-log4perl-perl libmail-sendmail-perl libmime-lite-perl libmime-types-perl libmodule-implementation-perl libmodule-runtime-perl libmro-compat-perl libnamespace-autoclean-perl libnamespace-clean-perl libnet-cidr-perl libnet-server-perl libnet-snmp-perl libonig5 libpackage-stash-perl libpackage-stash-xs-perl libpadwalker-perl libparams-classify-perl libparams-util-perl libparams-validationcompiler-perl libreadonly-perl libref-util-perl libref-util-xs-perl librole-tiny-perl librrd8 librrds-perl libspecio-perl libsub-exporter-perl libsub-exporter-progressive-perl libsub-identify-perl libsub-install-perl libsub-quote-perl libsys-hostname-long-perl libvariable-magic-perl libxstring-perl munin-common munin-doc munin-plugins-core munin-plugins-extra rrdtool Use 'apt autoremove' to remove them. 0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade. root@linux-u20:~# apt-get --purge remove munin Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: jo jq libalgorithm-c3-perl libb-hooks-endofscope-perl libb-hooks-op-check-perl libclass-c3-perl libclass-c3-xs-perl libclass-data-inheritable-perl libclass-method-modifiers-perl libclass-xsaccessor-perl libdata-optlist-perl libdate-manip-perl libdbi1 libdevel-callchecker-perl libdevel-caller-perl libdevel-globaldestruction-perl libdevel-lexalias-perl libdevel-stacktrace-perl libdist-checkconflicts-perl libdynaloader-functions-perl libemail-date-format-perl libeval-closure-perl libexception-class-perl libexporter-tiny-perl libfile-copy-recursive-perl libio-multiplex-perl libipc-shareable-perl libjq1 liblist-moreutils-perl liblog-dispatch-perl liblog-log4perl-perl libmail-sendmail-perl libmime-lite-perl libmime-types-perl libmodule-implementation-perl libmodule-runtime-perl libmro-compat-perl libnamespace-autoclean-perl libnamespace-clean-perl libnet-cidr-perl libnet-server-perl libnet-snmp-perl libonig5 libpackage-stash-perl libpackage-stash-xs-perl libpadwalker-perl libparams-classify-perl libparams-util-perl libparams-validationcompiler-perl libreadonly-perl libref-util-perl libref-util-xs-perl librole-tiny-perl librrd8 librrds-perl libspecio-perl libsub-exporter-perl libsub-exporter-progressive-perl libsub-identify-perl libsub-install-perl libsub-quote-perl libsys-hostname-long-perl libvariable-magic-perl libxstring-perl munin-common munin-doc munin-plugins-core munin-plugins-extra rrdtool Use 'apt autoremove' to remove them. The following packages will be REMOVED munin* 0 to upgrade, 0 to newly install, 1 to remove and 0 not to upgrade. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] y (Reading database ... 175171 files and directories currently installed.) Purging configuration files for munin (2.0.56-1ubuntu1) ... apache2_invoke postrm: Purging configuration munin.conf dpkg: warning: while removing munin, directory '/var/lib/munin' not empty so not removed dpkg: warning: while removing munin, directory '/var/cache/munin/www' not empty so not removed Processing triggers for systemd (245.4-4ubuntu3.3) ... root@linux-u20:~# apt-get --purge remove munin munin-node Reading package lists... Done Building dependency tree Reading state information... Done Package 'munin' is not installed, so not removed The following packages were automatically installed and are no longer required: jo jq libalgorithm-c3-perl libb-hooks-endofscope-perl libb-hooks-op-check-perl libclass-c3-perl libclass-c3-xs-perl libclass-data-inheritable-perl libclass-method-modifiers-perl libclass-xsaccessor-perl libdata-optlist-perl libdate-manip-perl libdbi1 libdevel-callchecker-perl libdevel-caller-perl libdevel-globaldestruction-perl libdevel-lexalias-perl libdevel-stacktrace-perl libdist-checkconflicts-perl libdynaloader-functions-perl libemail-date-format-perl libeval-closure-perl libexception-class-perl libexporter-tiny-perl libfile-copy-recursive-perl libio-multiplex-perl libipc-shareable-perl libjq1 liblist-moreutils-perl liblog-dispatch-perl liblog-log4perl-perl libmail-sendmail-perl libmime-lite-perl libmime-types-perl libmodule-implementation-perl libmodule-runtime-perl libmro-compat-perl libnamespace-autoclean-perl libnamespace-clean-perl libnet-cidr-perl libnet-server-perl libnet-snmp-perl libonig5 libpackage-stash-perl libpackage-stash-xs-perl libpadwalker-perl libparams-classify-perl libparams-util-perl libparams-validationcompiler-perl libreadonly-perl libref-util-perl libref-util-xs-perl librole-tiny-perl librrd8 librrds-perl libspecio-perl libsub-exporter-perl libsub-exporter-progressive-perl libsub-identify-perl libsub-install-perl libsub-quote-perl libsys-hostname-long-perl libvariable-magic-perl libxstring-perl munin-common munin-doc munin-plugins-core munin-plugins-extra rrdtool Use 'apt autoremove' to remove them. The following packages will be REMOVED munin-node* 0 to upgrade, 0 to newly install, 1 to remove and 0 not to upgrade. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] y (Reading database ... 175127 files and directories currently installed.) Purging configuration files for munin-node (2.0.56-1ubuntu1) ... Processing triggers for systemd (245.4-4ubuntu3.3) ...

    Tuesday, 1 December 2020

    Installing Munin on Ubuntu 20

    Useful Links: https://www.howtoforge.com/tutorial/server-monitoring-with-munin-and-monit-on-ubuntu-16-04-lts/
    https://www.digitalocean.com/community/tutorials/how-to-install-the-munin-monitoring-tool-on-ubuntu-14-04
    Following worked for me without any changes. 



    As root or using sudo option, install Munin (of course, do an update 1st) # apt install munin munin-node # systemctl restart munin-node

    Alias /munin /var/cache/munin/www
    <Directory /var/cache/munin/www>
     # Require local
     Require all granted
     Options FollowSymLinks SymLinksIfOwnerMatch
     Options None
    </Directory>

    ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
    <Location /munin-cgi/munin-cgi-graph>
     # Require local
     Require all granted
     Options FollowSymLinks SymLinksIfOwnerMatch
     <IfModule mod_fcgid.c>
     SetHandler fcgid-script
     </IfModule>
     <IfModule !mod_fcgid.c>
     SetHandler cgi-script
     </IfModule>
    </Location> 


    Appendix

    root@linux-u20:~# apt install munin munin-node Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: munin-plugins-java The following NEW packages will be installed munin munin-node 0 to upgrade, 2 to newly install, 0 to remove and 0 not to upgrade. Need to get 71.8 kB/204 kB of archives. After this operation, 919 kB of additional disk space will be used. Get:1 http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 munin-node all 2.0.56-1ubuntu1 [71.8 kB] Fetched 71.8 kB in 0s (843 kB/s) Preconfiguring packages ... Selecting previously unselected package munin. (Reading database ... 175120 files and directories currently installed.) Preparing to unpack .../munin_2.0.56-1ubuntu1_all.deb ... Unpacking munin (2.0.56-1ubuntu1) ... Selecting previously unselected package munin-node. Preparing to unpack .../munin-node_2.0.56-1ubuntu1_all.deb ... Unpacking munin-node (2.0.56-1ubuntu1) ... Setting up munin (2.0.56-1ubuntu1) ... apache2_invoke: Enable configuration munin.conf Setting up munin-node (2.0.56-1ubuntu1) ... Initializing plugins..done. Restarting munin-node..Created symlink /etc/systemd/system/multi-user.target.wants/munin-node.service → /lib/systemd/system/munin-node.service. Processing triggers for man-db (2.9.1-1) ... Processing triggers for systemd (245.4-4ubuntu3.3) ...

    Apache config change

    Faced two error during apache Restart

    Invalid command 'RewriteEngine'

    Invalid command 'ProxyPass'


    To fix, had to enable the apache module, in Ubuntu, used this: sudo a2enmod rewrite sudo a2enmod proxy_http sudo systemctl restart apache2

    Appendix errors faced

    Dec 01 13:01:38 linux-u20 systemd[1]: Starting The Apache HTTP Server... Dec 01 13:01:38 linux-u20 apachectl[6829]: AH00526: Syntax error on line 3 of /etc/apache2/sites-enabled/mysite.conf: Dec 01 13:01:38 linux-u20 apachectl[6829]: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration Dec 01 13:01:38 linux-u20 apachectl[6809]: Action 'start' failed. Dec 01 13:01:38 linux-u20 apachectl[6809]: The Apache error log may have more information. Dec 01 13:01:38 linux-u20 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE Dec 01 13:01:38 linux-u20 systemd[1]: apache2.service: Failed with result 'exit-code'. Dec 01 13:01:38 linux-u20 systemd[1]: Failed to start The Apache HTTP Server. Dec 01 13:03:42 linux-u20 systemd[1]: Starting The Apache HTTP Server... Dec 01 13:03:42 linux-u20 apachectl[6921]: AH00526: Syntax error on line 6 of /etc/apache2/sites-enabled/mysite.conf: Dec 01 13:03:42 linux-u20 apachectl[6921]: Invalid command 'ProxyPass', perhaps misspelled or defined by a module not included in the server configuration Dec 01 13:03:42 linux-u20 apachectl[6906]: Action 'start' failed. Dec 01 13:03:42 linux-u20 apachectl[6906]: The Apache error log may have more information. Dec 01 13:03:42 linux-u20 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE Dec 01 13:03:42 linux-u20 systemd[1]: apache2.service: Failed with result 'exit-code'. Dec 01 13:03:42 linux-u20 systemd[1]: Failed to start The Apache HTTP Server.

    Monday, 30 November 2020

    Grafana

    Did not go for Enterprise, went for open source

    From: https://grafana.com/grafana/download?edition=oss

    Config: https://community.grafana.com/t/grafana-and-apache/5508

    Helpful, basic proxy
    https://www.digitalocean.com/community/tutorials/how-to-use-apache-as-a-reverse-proxy-with-mod_proxy-on-ubuntu-16-04 sudo apt-get install -y adduser libfontconfig1 wget https://dl.grafana.com/oss/release/grafana_7.3.4_amd64.deb sudo dpkg -i grafana_7.3.4_amd64.deb # To start the service and verify that the service has started: sudo systemctl daemon-reload sudo systemctl start grafana-server sudo systemctl status grafana-server # Configure the Grafana server to start at boot: sudo systemctl enable grafana-server.service Install output # sudo apt-get install -y adduser libfontconfig1 Reading package lists... Done Building dependency tree Reading state information... Done adduser is already the newest version (3.118ubuntu2). adduser set to manually installed. libfontconfig1 is already the newest version (2.13.1-2ubuntu3). libfontconfig1 set to manually installed. 0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade. # wget https://dl.grafana.com/oss/release/grafana_7.3.4_amd64.deb --2020-12-01 01:01:22-- https://dl.grafana.com/oss/release/grafana_7.3.4_amd64.deb Resolving dl.grafana.com (dl.grafana.com)... 151.101.18.217, 2a04:4e42:4::729 Connecting to dl.grafana.com (dl.grafana.com)|151.101.18.217|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 54013792 (52M) [application/x-debian-package] Saving to: ‘grafana_7.3.4_amd64.deb’ grafana_7.3.4_amd64.deb 100%[=======================================================================================================>] 51.51M 1.84MB/s in 28s 2020-12-01 01:01:51 (1.84 MB/s) - ‘grafana_7.3.4_amd64.deb’ saved [54013792/54013792] # sudo dpkg -i grafana_7.3.4_amd64.deb Selecting previously unselected package grafana. (Reading database ... 168816 files and directories currently installed.) Preparing to unpack grafana_7.3.4_amd64.deb ... Unpacking grafana (7.3.4) ... Setting up grafana (7.3.4) ... Adding system user `grafana' (UID 128) ... Adding new user `grafana' (UID 128) with group `grafana' ... Not creating home directory `/usr/share/grafana'. ### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd sudo /bin/systemctl daemon-reload sudo /bin/systemctl enable grafana-server ### You can start grafana-server by executing sudo /bin/systemctl start grafana-server Processing triggers for systemd (245.4-4ubuntu3.3) ...

    Hardening ubuntu Server for internet

    Disable Root Logins Over SSH

    $ sudo vi /etc/ssh/sshd_config

    Make sure PermitRootLogin is changed from yes to no

    PermitRootLogin no

    Install fail2ban

    Fail2ban is an intrusion-prevention system that monitors log files and searches for particular patterns that correspond to a failed login attempt. If a certain number of failed logins are detected from a specific IP address (within a specified amount of time), fail2ban blocks access from that IP address.

    sudo apt-get install fail2ban sudo vi /etc/fail2ban/jail.local 

    Add following in the new file

    [sshd] enabled = true port = 22 filter = sshd logpath = /var/log/auth.log maxretry = 3 Run sudo systemctl restart fail2ban

    Sunday, 29 November 2020

    Ubuntu and lamp

    sudo apt install apache2 libapache2-mod-fcgid sudo apt-get install mysql-server sudo apt-get install php libapache2-mod-php php-mysql sudo vi /etc/apache2/mods-enabled/dir.conf

    Make index.php 1st item, from from end. and save exit.


    sudo systemctl restart apache2 sudo apt-get install php-cli sudo systemctl restart apache2

    Allow ssh

    1. First update OS # Fetches the list of available updates sudo apt update # Installs some updates; does not remove packages sudo apt upgrade # Removes any old packages that are no longer needed sudo apt autoremove

    2. Install ssh sudo apt install openssh-server sudo systemctl status ssh 3. Update Firewall sudo ufw allow ssh

    Firewall

    $ sudo ufw status Status: inactive $ sudo ufw enable Firewall is active and enabled on system startup $ sudo ufw status Status: active $ sudo ufw allow 80 $ sudo ufw allow 443 $ sudo ufw disable Firewall stopped and disabled on system startup Restart with above command sudo ufw status verbose Status: active Logging: on (low) Default: deny (incoming), allow (outgoing), disabled (routed) New profiles: skip To Action From -- ------ ---- 22/tcp ALLOW IN Anywhere 80 ALLOW IN Anywhere 443 ALLOW IN Anywhere 22/tcp (v6) ALLOW IN Anywhere (v6) 80 (v6) ALLOW IN Anywhere (v6) 443 (v6) ALLOW IN Anywhere (v6)


    SSH commands


    SSH service by running:

    $ sudo systemctl stop ssh

    To start it again run:

    $ sudo systemctl start ssh

    To disable the SSH service to start during system boot run:

    $ sudo systemctl disable ssh br />
    To enable it again type:

    $ sudo systemctl enable ssh



    Saturday, 28 November 2020

    Shrink Windows 10 disk to install Linux as dual boot

    This note is for you:
    • Not able to Shrink Windows partition that has been 100% used

    • Defrag is not working and not able to shrink C drive

    • Have lots of free disk but shink only offering small amount

    I had 150 GB hard disk. Single C drive and disk was near 100% used up. After clearning freed 80GB, i wante to install Linux on 70GB. So first had to shrink but Windows shrink only allowed my to string 150GB by 2 GB, which is no where near the 70GB i wanted. So did defrag, still only allowed my shrink to 2gb, since system files were scartered all over the disk. So searching, found in asnwers.microsoft.com forume an solution and that worked for me. That is. 

    1. Download 'AOMEI Partition Assistant' Freeware 
      1. I have downloaded from diskpart.com/download.html
      2. I have selected Freeware Version 9.0 (file FAssist_Std.exe)
    2. Install AOMEI Partition Assistant. It goes on installs mini os like software to go in shrink, as you using host 
    3. Use the shrink option, if you try to do split option you have purchase the full version of software. 
    4. Once you have shrunk your disk
    5. Restart your machine and you will see the unalloacted disk and original disk shrunk. 

     

    I have installed Ubunto and new unallocated and and kept my Windows side by side, everything working like a treat.

     

    Thanks You "AOMEI Partition Assistant"

    Thursday, 29 October 2020

    HTML CSS Icon : Simple line icon unicode list

    My Fav Icon, Line icon code.

    Heart icon: \e08a

    Bag: \e04f

    Basket: \e04e

    Search: \e090



    List of icon, found in simple-line-icon-unicode-list.txt (credit to site developers.oxwall.com), searched for icon e04f .icon-user-female:before { content: "\e000"; } .icon-user-follow:before { content: "\e002"; } .icon-user-following:before { content: "\e003"; } .icon-user-unfollow:before { content: "\e004"; } .icon-trophy:before { content: "\e006"; } .icon-screen-smartphone:before { content: "\e010"; } .icon-screen-desktop:before { content: "\e011"; } .icon-plane:before { content: "\e012"; } .icon-notebook:before { content: "\e013"; } .icon-moustache:before { content: "\e014"; } .icon-mouse:before { content: "\e015"; } .icon-magnet:before { content: "\e016"; } .icon-energy:before { content: "\e020"; } .icon-emoticon-smile:before { content: "\e021"; } .icon-disc:before { content: "\e022"; } .icon-cursor-move:before { content: "\e023"; } .icon-crop:before { content: "\e024"; } .icon-credit-card:before { content: "\e025"; } .icon-chemistry:before { content: "\e026"; } .icon-user:before { content: "\e005"; } .icon-speedometer:before { content: "\e007"; } .icon-social-youtube:before { content: "\e008"; } .icon-social-twitter:before { content: "\e009"; } .icon-social-tumblr:before { content: "\e00a"; } .icon-social-facebook:before { content: "\e00b"; } .icon-social-dropbox:before { content: "\e00c"; } .icon-social-dribbble:before { content: "\e00d"; } .icon-shield:before { content: "\e00e"; } .icon-screen-tablet:before { content: "\e00f"; } .icon-magic-wand:before { content: "\e017"; } .icon-hourglass:before { content: "\e018"; } .icon-graduation:before { content: "\e019"; } .icon-ghost:before { content: "\e01a"; } .icon-game-controller:before { content: "\e01b"; } .icon-fire:before { content: "\e01c"; } .icon-eyeglasses:before { content: "\e01d"; } .icon-envelope-open:before { content: "\e01e"; } .icon-envelope-letter:before { content: "\e01f"; } .icon-bell:before { content: "\e027"; } .icon-badge:before { content: "\e028"; } .icon-anchor:before { content: "\e029"; } .icon-wallet:before { content: "\e02a"; } .icon-vector:before { content: "\e02b"; } .icon-speech:before { content: "\e02c"; } .icon-puzzle:before { content: "\e02d"; } .icon-printer:before { content: "\e02e"; } .icon-present:before { content: "\e02f"; } .icon-playlist:before { content: "\e030"; } .icon-pin:before { content: "\e031"; } .icon-picture:before { content: "\e032"; } .icon-map:before { content: "\e033"; } .icon-layers:before { content: "\e034"; } .icon-handbag:before { content: "\e035"; } .icon-globe-alt:before { content: "\e036"; } .icon-globe:before { content: "\e037"; } .icon-frame:before { content: "\e038"; } .icon-folder-alt:before { content: "\e039"; } .icon-film:before { content: "\e03a"; } .icon-feed:before { content: "\e03b"; } .icon-earphones-alt:before { content: "\e03c"; } .icon-earphones:before { content: "\e03d"; } .icon-drop:before { content: "\e03e"; } .icon-drawer:before { content: "\e03f"; } .icon-docs:before { content: "\e040"; } .icon-directions:before { content: "\e041"; } .icon-direction:before { content: "\e042"; } .icon-diamond:before { content: "\e043"; } .icon-cup:before { content: "\e044"; } .icon-compass:before { content: "\e045"; } .icon-call-out:before { content: "\e046"; } .icon-call-in:before { content: "\e047"; } .icon-call-end:before { content: "\e048"; } .icon-calculator:before { content: "\e049"; } .icon-bubbles:before { content: "\e04a"; } .icon-briefcase:before { content: "\e04b"; } .icon-book-open:before { content: "\e04c"; } .icon-basket-loaded:before { content: "\e04d"; } .icon-basket:before { content: "\e04e"; } .icon-bag:before { content: "\e04f"; } .icon-action-undo:before { content: "\e050"; } .icon-action-redo:before { content: "\e051"; } .icon-wrench:before { content: "\e052"; } .icon-umbrella:before { content: "\e053"; } .icon-trash:before { content: "\e054"; } .icon-tag:before { content: "\e055"; } .icon-support:before { content: "\e056"; } .icon-size-fullscreen:before { content: "\e057"; } .icon-size-actual:before { content: "\e058"; } .icon-shuffle:before { content: "\e059"; } .icon-share-alt:before { content: "\e05a"; } .icon-share:before { content: "\e05b"; } .icon-rocket:before { content: "\e05c"; } .icon-question:before { content: "\e05d"; } .icon-pie-chart:before { content: "\e05e"; } .icon-pencil:before { content: "\e05f"; } .icon-note:before { content: "\e060"; } .icon-music-tone-alt:before { content: "\e061"; } .icon-music-tone:before { content: "\e062"; } .icon-microphone:before { content: "\e063"; } .icon-loop:before { content: "\e064"; } .icon-logout:before { content: "\e065"; } .icon-login:before { content: "\e066"; } .icon-list:before { content: "\e067"; } .icon-like:before { content: "\e068"; } .icon-home:before { content: "\e069"; } .icon-grid:before { content: "\e06a"; } .icon-graph:before { content: "\e06b"; } .icon-equalizer:before { content: "\e06c"; } .icon-dislike:before { content: "\e06d"; } .icon-cursor:before { content: "\e06e"; } .icon-control-start:before { content: "\e06f"; } .icon-control-rewind:before { content: "\e070"; } .icon-control-play:before { content: "\e071"; } .icon-control-pause:before { content: "\e072"; } .icon-control-forward:before { content: "\e073"; } .icon-control-end:before { content: "\e074"; } .icon-calendar:before { content: "\e075"; } .icon-bulb:before { content: "\e076"; } .icon-bar-chart:before { content: "\e077"; } .icon-arrow-up:before { content: "\e078"; } .icon-arrow-right:before { content: "\e079"; } .icon-arrow-left:before { content: "\e07a"; } .icon-arrow-down:before { content: "\e07b"; } .icon-ban:before { content: "\e07c"; } .icon-bubble:before { content: "\e07d"; } .icon-camcorder:before { content: "\e07e"; } .icon-camera:before { content: "\e07f"; } .icon-check:before { content: "\e080"; } .icon-clock:before { content: "\e081"; } .icon-close:before { content: "\e082"; } .icon-cloud-download:before { content: "\e083"; } .icon-cloud-upload:before { content: "\e084"; } .icon-doc:before { content: "\e085"; } .icon-envelope:before { content: "\e086"; } .icon-eye:before { content: "\e087"; } .icon-flag:before { content: "\e088"; } .icon-folder:before { content: "\e089"; } .icon-heart:before { content: "\e08a"; } .icon-info:before { content: "\e08b"; } .icon-key:before { content: "\e08c"; } .icon-link:before { content: "\e08d"; } .icon-lock:before { content: "\e08e"; } .icon-lock-open:before { content: "\e08f"; } .icon-magnifier:before { content: "\e090"; } .icon-magnifier-add:before { content: "\e091"; } .icon-magnifier-remove:before { content: "\e092"; } .icon-paper-clip:before { content: "\e093"; } .icon-paper-plane:before { content: "\e094"; } .icon-plus:before { content: "\e095"; } .icon-pointer:before { content: "\e096"; } .icon-power:before { content: "\e097"; } .icon-refresh:before { content: "\e098"; } .icon-reload:before { content: "\e099"; } .icon-settings:before { content: "\e09a"; } .icon-star:before { content: "\e09b"; } .icon-symbol-female:before { content: "\e09c"; } .icon-symbol-male:before { content: "\e09d"; } .icon-target:before { content: "\e09e"; } .icon-volume-1:before { content: "\e09f"; } .icon-volume-2:before { content: "\e0a0"; } .icon-volume-off:before { content: "\e0a1"; } .icon-users:before { content: "\e001"; }

    Checking Status of Oracle Materialized View


    Checking status of an Oracle Materialized View
    Few basic SQL to checking status of Oracle Materialized View.
    Common Error ORA-12034: materialized view log on"DEV_USER"."NFS_MOUNT" younger than last refresh
    Checks -- Change OWNER SQL> SELECT owner, object_name, object_type, status from dba_objects WHERE owner='DEV_USER' and object_type='MATERIALIZED VIEW'; OWNER OBJECT_NAME OBJECT_TYPE STATUS --------------- ----------------- ------------------- ------- DEV_USER NFS_MOUNT MATERIALIZED VIEW VALID SQL> SELECT owner, mview_name, last_refresh_date, staleness FROM dba_mviews WHERE owner ='DEV_USER'; OWNER MVIEW_NAME LAST_REFRESH_DATE STALENESS --------------- ----------------- -------------------- -------------- DEV_USER NFS_MOUNT 29-OCT-20 UNDEFINED

    Monday, 16 March 2020

    Tuning MySQL on windows


    My MySQL import of 1.2GB files was taking 1hr 30min, after 1st tunring it took 50min and finally after 30hr searching, got the import to run in 10min....phew
    innodb_buffer_pool_size=1024M # Changed from 5M to 256M 1/4 of pool size innodb_log_file_size=256M # Kept the default 8M innodb_log_buffer_size=8M