Site Tools


Hotfix release available: 2024-02-06a "Kaos". upgrade now! [55.1] (what's this?)
New release available: 2024-02-06 "Kaos". upgrade now! [55] (what's this?)
onny:notizen

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
onny:notizen [2022/09/17 13:39] – [postgresql] 10.25.0.100onny:notizen [2024/02/21 09:38] (current) – [cups] 127.0.0.1
Line 1: Line 1:
-===== kernel ===== 
- 
-grep kernel config running system 
-<code bahs> 
-zcat /proc/config.gz | grep VDSO 
-</code> 
- 
-===== fish ===== 
- 
-unset history 
-<code> 
-fish --private 
-</code> 
  
 ===== bash ===== ===== bash =====
Line 101: Line 88:
 chmod +x $FILE chmod +x $FILE
 $FILE "$@" $FILE "$@"
-</code> 
-==== sed ==== 
-Mit sed inplace eine Zeile zu einer Datei hinzufügen: 
-<code bash> 
-sed -i '9i#include <algorithm>' liboffsetfinder64/vmem.cpp 
-</code> 
-add to end of file  
-<code bash> 
-sed -i -e '$aretry $@' retry.sh 
-</bash> 
-Comment out specific line matching a string 
-<code bash> 
-sudo sed -e '/pam_securetty.so/ s/^#*/#/' -i delugecontainer/etc/pam.d/login 
-</code> 
-comment out multiple lines / range 
-<code bash> 
-sed -i "28,33 s/# *//" autogen.sh 
-</code> 
-regex parse value of xml tags 
-<code bash> 
-sed -n 's/.*<id>\(.*\)<\/id>.*/\1/p' myfile.txt 
-</code> 
-delete multiple lines 
-<code bash> 
-sed -i '2,3d;5d;8d' file 
 </code> </code>
  
-insert line after match 
-<code bash> 
-sed  '/\[option\]/a Hello World' input 
-</code> 
 ==== grep ==== ==== grep ====
 regex match group regex match group
Line 163: Line 121:
 fd '[^A-Z a-züö@0-9._-]' remote/200_Archiv/CP_Dont_Touch fd '[^A-Z a-züö@0-9._-]' remote/200_Archiv/CP_Dont_Touch
 </code> </code>
-==== rg ==== 
  
-filter file type 
  
-<code bash> 
-rg GPIO_CFG_2MA -g '*.h' 
-</code> 
- 
-search file containing multiple strings/words 
- 
-<code bash> 
-rg -lU --multiline-dotall 'strictDeps.*onny|onny.*strictDeps' pkgs 
-</code> 
- 
-==== curl ==== 
-post data 
-<code bash> 
-curl --data "UserId=eb8c2ec5352843d3a16ca11c26d3551c&Name=lolorollo&api_key=a5dc4e***9c9e0a***3" "https://turbotux.de/Playlists?UserId=eb8c2ec5352843d3a16ca11c26d3551c&Name=lolorollo&api_key=a5***d***9e0***3" 
-</code> 
-download and extract archive 
-<code bash> 
-curl http://wordpress.org/latest.tar.gz | tar xvz 
-</code> 
-set host header 
-<code bash> 
-torify curl --header "Host: http.pi" blog.project-insanity.org 
-</code> 
-==== tcpdump ==== 
-specific ports 
-<code bash> 
-tcpdump -i eth0 -q '(tcp port 80) or (tcp port 443)' -A 
-</code> 
-exclude specific host 
-<code bash> 
-tcpdump -i eth0 -q '(ip or ip6) and (tcp port 80) or (tcp port 443) and not host ifconfig.co' -A 
-</code> 
 ==== patching ==== ==== patching ====
 === appling === === appling ===
Line 243: Line 167:
 </file> </file>
 ===== networking ===== ===== networking =====
-netcat 
-<code bash> 
-netcat -l 4444 
-</code> 
-<code bash> 
-netcat playground.pi 4444 
-</code> 
 ==== nftables ==== ==== nftables ====
 <code bash> <code bash>
Line 291: Line 208:
 iptables -t nat -A OUTPUT -p tcp --dport 2222 -j DNAT --to 192.168.1.2:22 iptables -t nat -A OUTPUT -p tcp --dport 2222 -j DNAT --to 192.168.1.2:22
 </code> </code>
-</code> 
-==== ip ==== 
-set address 
-<code bash> 
-ip address add dev usb0 172.16.42.1/24 
-ip link set usb0 up 
-</code> 
-route command example 
-<code bash> 
-ip route add 192.168.1.0/24 dev eth0 
-ip route add default via 192.168.1.1 
-</code> 
-flush addresses 
-<code bash> 
-ip addr flush dev enp8s0 
-</code> 
-remove interface 
-<code bash> 
-ip link delete br0 
-</code> 
-delete address 
-<code bash> 
-ip addr del 192.168.178.20/24 dev eth0 
-</code> 
-show only specific interface 
-<code bash> 
-ip a show wg0 
 </code> </code>
  
-change mtu 
-<code bash> 
-ip link set dev eth0 mtu 1400 
-</code> 
 ==== dnsmasq ==== ==== dnsmasq ====
 minimal hostapd and dnsmasq config minimal hostapd and dnsmasq config
Line 486: Line 372:
   * iodine dns tunnel https://code.kryo.se/iodine/   * iodine dns tunnel https://code.kryo.se/iodine/
   * command searchsploit in exploitdb   * command searchsploit in exploitdb
 +  * NixOS for Pentesting Overview https://github.com/NixOS/nixpkgs/issues/81418
  
 ===== chromium / chrome ===== ===== chromium / chrome =====
Line 493: Line 380:
 </code> </code>
 ===== docker ===== ===== docker =====
-Short example+ 
 +Pull
 <code bash> <code bash>
- sudo systemctl start docker +docker pull ubuntu:22.04 
- gpasswd -a onny docker +docker pull rootlogin/nextcloud:develop
- docker run -d -p 80:80 rootlogin/nextcloud +
- docker run -v /home/onny/projects/nextcloud-app-radio:/opt/nextcloud/apps/radio -d --name nextcloud -p 80:80 rootlogin/nextcloud+
 </code> </code>
 +
 +Run
 +<code bash>
 +docker run -td ubuntu:22.04
 +</code>
 +
 +Executing
 +<code bash>
 +docker exec -it ffffdfdfsdfsdfsfsffsdfs /bin/bash
 +</code>
 +
 +Nextcloud
 +<code bash>
 +docker run -d -p 80:80 rootlogin/nextcloud
 +docker run -v /home/onny/projects/nextcloud-app-radio:/opt/nextcloud/apps/radio -d --name nextcloud -p 80:80 rootlogin/nextcloud
 +</code>
 +
 Debugging it Debugging it
 <code bash> <code bash>
Line 505: Line 408:
  docker exec -i -t e326cbb922aa /bin/bash # exec new shell running container   docker exec -i -t e326cbb922aa /bin/bash # exec new shell running container 
 </code> </code>
 +
 Pull from repository Pull from repository
 <code> <code>
Line 515: Line 419:
  docker run -i -t e326cbb922aa /bin/bash  docker run -i -t e326cbb922aa /bin/bash
 </code> </code>
-Pull specific tagged image +
-<code bash> +
-docker pull rootlogin/nextcloud:develop +
-</code>+
 Build from Dockerfile Build from Dockerfile
 <code> <code>
Line 542: Line 443:
 docker system prune -a docker system prune -a
 </code> </code>
-docker stop all container +
-<code bash> +
-docker stop (docker ps -a -q) +
-</code>+
 prevent from auto start prevent from auto start
 +
 <code bash> <code bash>
 docker update --restart=no client-iaro_db_1 docker update --restart=no client-iaro_db_1
Line 722: Line 621:
 git remote set-url origin gitlab@http-new.pi:onny/web-wikidict.git git remote set-url origin gitlab@http-new.pi:onny/web-wikidict.git
 </code> </code>
-tagging +
-<code bash> +
-git tag -a v0.1 -m 'whackspace wordpress theme init' +
-</code>+
 merge commits from a remote repository merge commits from a remote repository
 +
 <code bash> <code bash>
 git fetch https://github.com/rfc2822/davdroid.git master git fetch https://github.com/rfc2822/davdroid.git master
Line 938: Line 835:
 </code> </code>
   * check spamminess of email server: https://www.mail-tester.com/   * check spamminess of email server: https://www.mail-tester.com/
-  * manual imap login +
-openssl imaps login +
-<code> +
-openssl s_client -connect mail.sexypump.de:993 -crlf +
-A login cypherpunk cypherpunk +
-</code> +
-get quota +
-<code> +
-a GETQUOTAROOT INBOX +
-</code> +
-get msg count of folder +
-<code> +
-a LIST INBOX * +
-* LIST (\HasChildren) "." INBOX +
-* LIST (\HasNoChildren \UnMarked) "." "INBOX.Deleted Messages" +
-* LIST (\HasNoChildren \UnMarked) "." "INBOX.Sent Messages" +
-* LIST (\HasNoChildren \UnMarked \Trash) "." INBOX.Trash +
-* LIST (\HasNoChildren \UnMarked \Sent) "." INBOX.Sent +
-* LIST (\HasNoChildren \UnMarked) "." INBOX.Notes +
-* LIST (\HasNoChildren \UnMarked \Junk) "." INBOX.Junk +
-* LIST (\HasNoChildren \UnMarked \Drafts) "." INBOX.Drafts +
-* LIST (\HasNoChildren \UnMarked) "." INBOX.AntiSpam +
-a OK List completed (0.001 + 0.000 secs). +
-a SELECT INBOX +
-</code>+
 send smtp mail send smtp mail
 <code> <code>
Line 1322: Line 1195:
 <code bash> <code bash>
 nix run nixpkgs#electrum -- --help nix run nixpkgs#electrum -- --help
 +nix run github:TheZombie1999/nixpkgs#upscaly
 nix shell nixpkgs#hash-slinger --command tlsa --create example.org nix shell nixpkgs#hash-slinger --command tlsa --create example.org
 </code> </code>
Line 1349: Line 1223:
  
 <code> <code>
-let  +nixpkgs.config.packageOverrides = pkgs: rec { 
- +  unstable = import unstableTarball { }; 
-  # FIXME +  opensnitch = unstable.opensnitch; 
-  unstableTarball = +};
-    fetchTarball +
-      https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz; +
- +
-in +
-+
- +
-  disabledModules = [ "programs/firejail.nix" ]; +
- +
-  imports = [ +
-    "${fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz"}/nixos/modules/services/security/opensnitch.nix" +
-    /home/onny/projects/nixpkgs2/nixos/modules/services/networking/create_ap.nix +
-  ]; +
-  nixpkgs.config.packageOverrides = pkgs: rec { +
-    unstable = import unstableTarball { }; +
-    opensnitch = unstable.opensnitch; +
-  }+
-  #services.opensnitch.enable = true;+
 </code> </code>
  
Line 1401: Line 1258:
     '';     '';
   });   });
-</code> 
- 
-use local src / source 
- 
-<code> 
-  src = "/home/onny/projects/linux-wifi-hotspot"; 
-  dontUnpack = true; 
-   
-  unpackPhase = ''cp -r --no-preserve=mode $src/* .''; 
 </code> </code>
  
Line 1448: Line 1296:
       });       });
     })     })
-  ]; 
-</code> 
- 
-fetchpatch 
- 
-<code> 
-  patches = [ 
-    # Support HBPL1 printers https://www.dechifro.org/hbpl/ 
-    ./hbpl1.patch 
- 
-    # Fix "Unimplemented paper code" error for hbpl1 printers 
-    # https://github.com/mikerr/foo2zjs/pull/2 
-    (fetchpatch { 
-      url = "https://patch-diff.githubusercontent.com/raw/mikerr/foo2zjs/pull/2.patch"; 
-      sha256 = "0lvbryw6ymh0ahwkhqsgmjimg5saa8b1xnxmyyjxrbi3l3a6fbvy"; 
-      stripLen = 1; 
-      name = "fix_papercode_error.patch"; 
-    }) 
- 
   ];   ];
 </code> </code>
Line 1506: Line 1335:
 <code bash> <code bash>
 QEMU_NET_OPTS="hostfwd=tcp::8080-:80" NIX_PATH=nixpkgs=/home/onny/projects/nixpkgs nixos-shell vm-invoiceplane.nix QEMU_NET_OPTS="hostfwd=tcp::8080-:80" NIX_PATH=nixpkgs=/home/onny/projects/nixpkgs nixos-shell vm-invoiceplane.nix
 +sudo -E QEMU_NET_OPTS="hostfwd=tcp::80-:80" NIX_PATH=nixpkgs=/home/onny/projects/nixpkgs nixos-shell vm-invoiceplane.nix
 </code> </code>
  
Line 1818: Line 1648:
   '';   '';
 </code> </code>
 +
 ==== nixops ==== ==== nixops ====
  
Line 1872: Line 1703:
 fatlabel /dev/sdb1 "mystick" fatlabel /dev/sdb1 "mystick"
 </code> </code>
 +
 resize extX partition resize extX partition
 +
 <code bash> <code bash>
 sfdisk -l /dev/sdb sfdisk -l /dev/sdb
Line 1957: Line 1790:
 </code> </code>
  
-===== avahi ===== +
-discover local services +
-<code bash> +
-avahi-browse --all --ignore-local --resolve --terminate +
-</code>+
 ===== curlftpfs ===== ===== curlftpfs =====
 <code bash> <code bash>
Line 2111: Line 1940:
 </code> </code>
  
-===== cups ===== 
  
-list printers +===== qemu ===== 
-<code> + 
-$ lpstat -p -+booting armv7 alpinelinux 
-printer Dell_1250c is idle enabled since Tue 28 Dec 2021 09:44:59 AM UTC +<code bash
-printer Dell_1250c_USB is idle enabled since Tue 28 Dec 2021 09:44:59 AM UTC+# download kernel and stuff from here http://dl-cdn.alpinelinux.org/alpine/edge/releases/armv7/netboot/ 
 +qemu-system-arm -M virt -m 512M -cpu cortex-a15 -kernel vmlinuz-lts -initrd initramfs-lts -append "console=ttyAMA0 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main/" -nographic
 </code> </code>
  
-print file +===== postgresql ===== 
-<code> + 
-lp -d Dell_1250c_USB -o fit-to-page -o media=A4 scared_cat.png+list all databases 
 +<code bash
 +sudo -u postgres psql 
 +# \l
 </code> </code>
  
-list jobs +drop database 
-<code> +<code bash
-$ lpstat +sudo -u postgres psql 
-Dell_1250c_USB-2        root            340992   Tue 28 Dec 2021 09:57:08 AM UTC+# drop database gitlabhq_production; 
 +# drop database gitlabhq_production WITH (FORCE);
 </code> </code>
  
-cancel job+list tables 
 +<code bash> 
 +sudo -u postgres psql 
 +# \c gitlabhq_production 
 +# \dt 
 +</code> 
 + 
 +create and delete user
 <code> <code>
-cancel 1+DROP ROLE gitlab; 
 +CREATE USER gitlab WITH PASSWORD 'test123';
 </code> </code>
  
-===== qemu ===== +grant permissions 
- +<code> 
-booting armv7 alpinelinux +ALTER USER gitlab SUPERUSER; 
-<code bash+CREATE DATABASE gitlabhq_production OWNER gitlab; 
-# download kernel and stuff from here http://dl-cdn.alpinelinux.org/alpine/edge/releases/armv7/netboot/ +ALTER DATABASE gitlabhq_production OWNER TO gitlab;
-qemu-system-arm -M virt -m 512M -cpu cortex-a15 -kernel vmlinuz-lts -initrd initramfs-lts -append "console=ttyAMA0 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main/" -nographic+
 </code> </code>
- 
-===== postgresql ===== 
  
 dump database dump database
Line 2162: Line 2000:
 </code> </code>
  
-===== mysql ===== 
  
-Dump database 
-<code bash> 
-mysqldump -u root -p Tutorials > tut_backup.sql 
-</code> 
- 
-Backup everything 
-<code bash> 
-mysqldump -u root -p --all-databases > alldb.sql 
-</code> 
- 
-Import database 
-<code> 
-mysql> CREATE DATABASE wordpress; 
-sudo mysql -u root wordpress < wordpress.sql 
-</code> 
- 
-Setup 
-<code bash> 
-systemctl stop mysqld 
-mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql 
-systemctl start mysqld 
-mysql_secure_installation 
-</code> 
onny/notizen.1663421992.txt.gz · Last modified: 2022/09/17 13:39 by 10.25.0.100