Ufw (uncomplicated firewall)

documentation https://help.ubuntu.com/lts/serverguide/firewall.html http://manpages.ubuntu.com/manpages/xenial/en/man8/ufw.8.html http://manpages.ubuntu.com/manpages/xenial/en/man8/ufw-framework.8.html important files /etc/ufw/user.rules Uncomplicated Firewall # https://help.ubuntu.com/community/UFW sudo ufw show added sudo ufw status verbose sudo ufw show listening sudo ufw limit ssh sudo ufw allow 80 sudo ufw allow 443 sudo ufw allow 32400 sudo […]

APT (Advanced Package Tool)

checking that python3-pip package is installed dpkg –get-selections python3-pip search packages by name using REGEX see http://newbiedoc.sourceforge.net/tutorials/apt-get-intro/info.html apt-cache search libapr apt-cache search ‘php.*sql’ apt-cache search apache.\*perl apt-cache search elvis\|vim list the contents of a (not-installed) package see https://unix.stackexchange.com/questions/6311/how-to-find-out-which-not-installed-package-a-file-belongs-to apt-file list […]

ssh, http and https multiplexing

This is about how to have the ssh and http(s) server share the same port (e.g. 80 or 443 port). This is really cool :). # Used sources: # http://yalis.fr/cms/index.php/post/2014/02/22/Multiplex-SSH-and-HTTPS-on-a-single-port # http://blog.cppse.nl/apache-proxytunnel-ssh-tunnel # http://serverfault.com/questions/355271/ssh-over-https-with-proxytunnel-and-nginx # http://tyy.host-ed.me/pluxml/article4/port-443-for-https-ssh-and-ssh-over-ssl-and-more # http://ipset.netfilter.org/iptables.man.html # http://ipset.netfilter.org/iptables-extensions.man.html […]

gitweb on nginx

nginx configuration # Let Nginx handle static files # location ~ ^.*\.git/objects/([0-9a-f]+/[0-9a-f]+|pack/pack-[0-9a-f]+.(pack|idx)) { location ~ ^/[^/]*\.git/objects/([0-9a-f]+/[0-9a-f]+|pack/pack-[0-9a-f]+.(pack|idx)) { auth_basic “strong authentication”; auth_basic_user_file /********/apps/etc/basic.auth.strong.passwords.txt; root /********/GITRepoUbuntu/; } # Pass Git Smart HTTP requests to git-http-backend. Require Auth for everything. # see man […]

Spring security

HTML translated to java config see also Java Configuration see also http://www.springframework.org/schema/security/spring-security.xsd <http security=”none” pattern=”/resources/**”/> <http pattern=”/api1/**” create-session=”stateless”> <intercept-url pattern=”/**” access=”authenticated”/> <http-basic /> </http> <http pattern=”/api2/**” create-session=”never”> <intercept-url pattern=”/api2/api21/**” access=”hasRole(‘ROLE_ADMIN’)”/> <intercept-url pattern=”/api2/**” access=”hasRole(‘ROLE_USER’)”/> <http-basic /> </http> <http pattern=”/api3/**”> <intercept-url pattern=”/api3/api31/**” […]

Ubuntu and Oracle

# see also https://wiki.centos.org/HowTos/Oracle12onCentos7 # see also https://adrhc.go.ro/wordpress/centos-and-oracle/ # Follow this (works with Ubuntu 16.04 too): # http://www.techienote.com/install-oracle-12c-on-ubuntu/ # systemd oracle.service (working when only one db is automatically started with /etc/oratab) [Unit] Description=Oracle 12c After=local-fs.target Wants=local-fs.target [Service] Type=forking User=oracle Group=oinstall […]

CentOS

CentOS https://www.centos.org/docs/5/html/ https://wiki.centos.org/ https://wiki.centos.org/HowTos/Oracle12onCentos7 https://docs.oracle.com/database/121/index.html CentOS version cat /etc/centos-release hostnamectl rpm –query centos-release CentOS setup # pciutils (for running lspci) # xorg-x11-server-utils (for running xrandr) yum install -y nano mlocate wget zip unzip xorg-x11-drv-vesa pciutils xorg-x11-server-utils wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm # –nogpgcheck […]

RedHat

Red Hat http://developers.redhat.com/blog/2016/03/31/no-cost-rhel-developer-subscription-now-available/ http://developers.redhat.com/products/rhel/get-started/#tab-vmware https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/ show OS version lsb_release -a Red Hat setup https://linuxconfig.org/rhel-7-solution-to-there-are-no-enabled-repos-message mkdir /media/rhel7-repo-iso # VMware: make sure Device Status checkbox named Connected is checked! mount /dev/cdrom /media/rhel7-repo-iso/ # or mount the iso file: mount -o loop /root/rhel-server-7.1-x86_64-dvd.iso […]

Oracle and systemd

# http://docs.oracle.com/database/121/index.htm # https://172.16.148.137:5500/em/login # start db: [oracle@redhat7 ~]$ sqlplus / AS SYSDBA STARTUP # start TNS listener [oracle@redhat7 ~]$ lsnrctl start # TNS listener status [oracle@redhat7 ~]$ lsnrctl status cat /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora # stop TNS listener [oracle@redhat7 ~]$ lsnrctl stop […]

CentOS and Oracle

# https://wiki.centos.org/HowTos/Oracle12onCentos7 # rsync -cEhikLmrtz –progress –delete-after KIT/Oracle/linuxamd64_12102_database_se2_* root@172.16.148.136:/root/KIT # scp KIT/Oracle/linuxamd64_12102_database_se2_* root@172.16.148.137:/root/KIT # run as root … groupadd oinstall groupadd dba useradd -g oinstall -G dba oracle passwd oracle # For Intel N3150 CPU I changed the original “kernel.shmmax […]

RedHat & CentOS

Change hostname hostnamectl set-hostname redhat7.localdomain hostnamectl status Change in /etc/sysconfig/network HOSTNAME=redhat7.localdomain Change in /etc/hosts (otherwise Oracle won’t start -> when using Oracle …) 127.0.0.1 redhat7 redhat7.localdomain reboot Static ip setup [root@localhost ~]# cat /etc/sysconfig/network NETWORKING=yes GATEWAY=172.16.148.2 HOSTNAME=redhat7.localdomain [root@localhost ~]# cat […]