Linux

so Linux-Zeugs, das ich immer wieder vergesse, weil ich es doch nicht jeden Tag brauche, aber immer wieder…

Linux Kleinzeugs

reset the screens (Trick Robert):

ctrl-alt-F7 ... ctrl-alt-F1 

rpm on ubuntu:

alien -i bla.rpm

distribution:

cat /etc/*release*
lsb_release -a

Kleinzeugs Netzwerk:

nmap -p 5000 172.30.1.1
[luna:~] rschumm% sudo nmap -PR 192.168.1.0/24 -sn

ugo Zeugs:

r=4
w=2
x=1

quickshell:

bash -c 'for i in {1..110}; do mkdir "$i"; done' 

users und so

sudo useradd --create-home --groups sudo cloud-user
sudo passwd cloud-user

Bem: useradd nur für simple user, adduser sollte alles machen, inkl. home-dir. cf Cheat

sudo usermod -aG sudo cloud-user
userdel -r cloud-user

für .ssh Zeugs:

chmod 700 ~/.ssh
chmod 644 ~/.ssh/authorized_keys

regex, sed etc.

echo 'hallo welt' | sed 's/welt/winterthur/'

firewall

RHEL etc.

firewall-cmd --list-all
firewall-cmd --zone=public --add-port=8080/tcp
firewall-cmd --zone=public --remove-port=8080/tcp
firewall-cmd --zone=public --list-ports

alternatives

update-alternatives --list java
sudo update-alternatives --config java
update-alternatives --install ... 

update-alternatives --query mvn
to install:  --install <Link> <Name> <Pfad> <Priorität>
sudo update-alternatives --install /usr/bin/mvn mvn /home/rschumm/Software/apache-maven-3.6.0-bin/apache-maven-3.6.0/bin/mvn 100

quick and dirty manual install of JDK 11 on Ubuntu 18.04

n.b.: finally, in ubuntus jdk11 is also jdk11 inside like it’s «written on the box». So no need anymore for this.

update-java-alternatives -l | -s 
% sudo sh -c 'for bin in /usr/lib/jvm/jdk-11.0.2+9/bin/*; do update-alternatives --install /usr/bin/$(basename $bin) $(basename $bin) $bin 100; done'

% sudo sh -c 'for bin in /usr/lib/jvm/jdk-11.0.2+9/bin/*; do update-alternatives --set $(basename $bin) $bin; done'

then choose the installation with update-alternatives --config java

tcsh

set path = ($path $HOME/.gem/ruby/2.3.0/bin/ .)
setenv  M2_HOME /Applications/maven/apache-maven-3.x.x
alias mvn $M2_HOME/bin/mvn

bash

export PATH="/home/rschumm/minis/minishift-1.18.0-linux-amd64/:$PATH"
alias schummsync='rsync -vrtz _site/* xxx@xxx.xxx.hostpoint.ch:~/www/public_html/schumm/'
echo $PATH

to set JAVA_HOME: find out where Java is with: update-alternatives --config java, then, in .bashrc:

export JAVA_HOME="/usr/lib/jvm/jdk-11.0.2+9"

note: do that dynamically?

#!/bin/bash

java Generator.java
#(needs JDK 11)

for file in $(find . -iname '*.yml'); do 
     echo "$file"
     #ls -l "$file"
     oc create -f "$file"
done

Partition resize in RHEL

Partition sda2 füllt nicht die ganze Disk, ich will sie auf das Maximumm vergrössern:

sudo su - 
fdisk /dev/sda

p

d

n

p

..dann auch alles default... 

w

reboot

xfs_growfs /dev/sda2

Docker Kleinzeugs

garbage collect docker:

docker images 
sudo docker system prune -a

quick interact docker:

docker run -it --rm --entrypoint /bin/bash quay.io/quarkus/centos-quarkus-maven:graalvm-1.0.0-rc14

zurück zum Seitenanfang