- Install Doom Emacs
- Test Go in org mode
- Test sudo with bash
- Test sudo with bash and tramp
- How to prepare bootable pendrive on linux(Option 1)
- How to prepare bootable pendrive on linux(Option 2)
- Linux namespace networking
- ZjebanOS
- Network configuration
- Environment
- Terraform
sudo pacman -S gitsudo pacman -S emacssudo pacman -S rgShould be already installed.
sudo pacman -S fdNeed to install by: M-x -> package install -> ob-go And restart doom by: M-x -> doom/reload
fmt.Println("Hello World!")echo $pw | sudo -S echo "hello"sudo echo "hello"df -hsudo umount /dev/sda1sudo dd bs=4M if=/home/wojtek/ISO/arcolinuxb-leftwm-v22.01.10-x86_64.iso of=/dev/sda status=progress oflag=synclsblk | grep -v loopumount /dev/sda1wipels --all /dev/sdacat /path/to/iso > /dev/sdaNetwork namespaces are use by containers to separete networking. Process on container will have pid 1, but the same process in host will have another pid.
ps aux | grep nginxHost has own interface to communicate to LAN - eth0. Host also has own arp and route table to store network information. When container is created, there is created namespece. Then container also have own arp and route table.
To create network ns:
sudo ip netns add red
sudo ip netns add blueCheck ip netns
ip netnsTo list interfaces in host:
ip -br linkTo list interfaces in namespace:
ip netns exec red ip -br linkOr simpler:
ip -br -n red linkIn namespaces there is visible only loopback interface. There is no other interface from host. The same is for arp and route table.
Arp table for host:
arpArp for namespece
ip netns exec red arpRoute for host:
routeRoute for namespece:
ip netns exec red routeTo connect to namespaces there is neccecery to create pipe or “virtual cabel” between them:
ip link add veth-red type veth peer name veth-blueip link set veth-blue up
ip link set veth-red upCheck links:
ip -br linkAttach red cabel to red namespace:
ip link set veth-red netns redAttach blue cabel to blue namespace:
ip link set veth-blue netns blueip -br -n red link
ip -br -n blue linkAdd address ip for both cabels:
ip -n red addr add 192.168.15.1 dev veth-red
ip -n blue addr add 192.168.15.2 dev veth-blueip -br -n red a | grep -v lo
ip -br -n blue a | grep -v loSwitch on both devices:
ip -n red link set veth-red up
ip -n blue link set veth-blue upip -br -n red a | grep -v lo
ip -br -n blue a | grep -v loCheck connection between namespaces
ip netns exec red ping -c 3 192.168.15.2ip netns exec blue arpwhereis ls /bin/ls type ls ls is aliased to `echo segmentation fault;#` alias alias ls=’echo segmentation fault;#’ unalias ls
nginx: [emerg] unknown directive “listen 80” in /etc/nginx/conf.d/default.conf:5 nginx: configuration file /etc/nginx/nginx.conf test failed
wyglada wszystko ok
0000000 \t l i s t e n 302 240 8 0 d e f a 0000010 u l t _ s e r v e r ; \n
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 241/nginx.conf
<html> <head><title>301 Moved Permanently</title></head> <body> <center><h1>301 Moved Permanently</h1></center> <hr><center>openresty</center> </body> </html>
HTTP/1.1 301 Moved Permanently server: openresty date: Tue, 08 Feb 2022 16:23:52 GMT content-type: text/html content-length: 166 location: http://www.pornhub.com/ x-request-id: 62029918-42FE72290050552A-477BB49 strict-transport-security: max-age=63072000; includeSubDomains; preload
66.254.114.41 localhost
127.0.0.1 localhost
<html> <head><title>502 Bad Gateway</title></head> <body bgcolor=”white”> <center><h1>502 Bad Gateway</h1></center> <hr><center>nginx</center> </body> </html>
server { listen 80 default_server;
location / { proxy_pass http://127.0.0.1:8080; }
access_log /var/log/nginx/serwisy/obliczenia.log main;
location = /404.html { internal; } }
Nginx przekierowuje wszytko na port 8080
Dziala tylko nginx na porcie 80
Can’t load /lib/ld-musl-x86_64.so.2 (0x7f57f1c15000)
istnieje tylko /lib/ld-musl-x86_64.so.1
Can’t load /lib/ld-musl-x86_64.so.2 (0x7f57f1c15000) Can’t load /lib/ld-musl-x86_64.so.2 (0x7f57f1c15000)
apache od razu rzuca bledem zaraz po otwarciu pliku
nie moze pisac do etc/sshd ale po co? ale wyzej jest: AH00526: Syntax error on line 1 of /etc/apache2/conf.d/security.conf:
znowu openresty. Cos nadpisalo. jakis cron
PID USER TIME COMMAND 1 root 0:00 /sbin/init 94 root 0:00 /bin/bash 108 root 0:00 ash 203 root 0:00 vim /etc/nginx/conf.d/default.conf 241 root 0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf 242 nginx 0:00 nginx: worker process 243 nginx 0:00 nginx: worker process 244 nginx 0:00 nginx: worker process 245 nginx 0:00 nginx: worker process 271 root 0:00 agetty apache2 binfmt bootmisc consolefont devfs dmesg fsck functions.sh hostnam 502 root 0:00 /usr/sbin/httpd -d /var/www -f /etc/apache2/httpd.conf -k start 506 apache 0:00 /usr/sbin/httpd -d /var/www -f /etc/apache2/httpd.conf -k start 507 apache 0:00 /usr/sbin/httpd -d /var/www -f /etc/apache2/httpd.conf -k start 508 apache 0:00 /usr/sbin/httpd -d /var/www -f /etc/apache2/httpd.conf -k start 509 apache 0:00 /usr/sbin/httpd -d /var/www -f /etc/apache2/httpd.conf -k start 510 apache 0:00 /usr/sbin/httpd -d /var/www -f /etc/apache2/httpd.conf -k start 516 root 0:00 ps auxf
*/15 * * * * run-parts /etc/periodic/15min -> cos zmienia sie co 15 minut 0 * * * * run-parts /etc/periodic/hourly 0 2 * * * run-parts /etc/periodic/daily 0 3 * * 6 run-parts /etc/periodic/weekly 0 5 1 * * run-parts /etc/periodic/monthly
403 z apacha-> logi -> /etc/strona
-> dziala, ale nie pokazuje wyniku -> spawdzenie index.php -> zapisuje do /cache/obliczenia -> cache ma prawa 777 -> obliczenia ma 770 dla usera i grupy nginx -> chmod 777 obliczenia
Used in older systems In below directory should be files starting with ifcfg- (ifcfg-eth0)
ls /etc/sysconfig/network-scriptsifcofng-eth0 file
DEVICE=eth0
HWADDR=08:00:27::1C:7C:F4 -> optional
TYPE=Ethernet
UUID=
ONBOOT=on -> optional
NM_CONTROLLED=yes -> Manage by Network Manager
BOOTPROTO=dhcp/none -> if none, below entries neccecery
IPADDR=10.0.1.40
NETMASK=255.255.255.0
GATEWAY=10.0.1.1
DNS1=10.0.1.1
Switch off connection
ifdown ethoSwitch on connection
ifup eth0Name CloudName SubscriptionId State IsDefault ---------------------------------- ----------- ------------------------------------ ------- ----------- MSI-SWE-PARTNER-STAGE-AZURECLOUD-0 AzureCloud 74545c1b-2b6d-4324-acda-bd921793e015 Enabled True MSI-SWE-CIE-STAGE-AZURECLOUD AzureCloud d521004d-004e-4013-bb23-fe359ac90321 Enabled False MSI-SWE-CIE-QA AzureCloud 29630a06-fdc5-486d-99c3-8ea14aa8cd2e Enabled False
Potrzebne, zeby dzialalo w pipeline.
terraform {
backend "azurerm" {
resource_group_name = "aware-backend-event-hubs"
storage_account_name = "saasawarebackendev321"
container_name = "terraform_dev"
key = "eventhub.tfstate"
}
}provider "azurerm" {
features {}
skip_provider_registration = true
}
resource "azurerm_eventhub_namespace" "main" {
name = "aware-backend-event-hubs"
location = "eastus"
resource_group_name = "saas-aware-backend-eastus"
sku = "Standard"
capacity = 1
}