https://wiki.malinux.no/api.php?action=feedcontributions&user=Wiki.malinux.no&feedformat=atomMalinWiKi - User contributions [en]2024-03-28T19:18:16ZUser contributionsMediaWiki 1.39.3https://wiki.malinux.no/index.php?title=Malin%27s_notes&diff=426Malin's notes2024-01-16T08:57:23Z<p>Wiki.malinux.no: /* Boot Linux from GRUB shell */</p>
<hr />
<div>==gnu/linux==<br />
<br />
To change ownership of everything that's not already owned by a user<br />
<br />
find /home/rtorrent/ ! -user rtorrent -exec chown rtorrent:rtorrent {} \; &<br />
<br />
==rtl8812AU==<br />
https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git<br />
<br />
remove led-disco<br />
<br />
/etc/modprobe.d/8188eu-blacklist.conf<br />
<br />
options 8812au rtw_led_enable=0<br />
<br />
==LVM==<br />
===[https://blog.raveland.tech/post/rename_vg/ rename Volume Group (VG)]===<br />
<br />
==mdadm==<br />
for dev in $( lsblk | awk '/sd[a-z].*1,8T/ { print }' ); do echo =============================== $dev ============================ ; smartctl -a /dev/$dev ; done | pastebinit<br />
<br />
<br />
<br />
mdadm --remove /dev/md0 failed # all failed devices<br />
<br />
mdadm --remove /dev/md0 detached # failed ones that aren't in /dev anymore<br />
<br />
ip addr add 192.168.0.101/24 dev eth0 ; ip route add default via 192.168.0.1 dev eth0<br />
<br />
<br />
<br />
Mulig rekkefølge med forbehold om at et ikke stemmer, for å endre vg navn på vg med root-partisjon<br />
vgchange gammel-vg ny-vg<br />
vgchange -ay<br />
<br />
endre i /etc/fstab<br />
<br />
grub-install /dev/XxX<br />
<br />
update-initramfs -k all -u<br />
<br />
reboot<br />
<br />
=Crossflash Dell PERC H200 from ir to it-mode=<br />
<br />
==The short answer== <br />
I slightly followed this guide:<br />
<br />
https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/<br />
<br />
The longer answer is. I followed the guide, this way, but did it a little different<br />
<br />
==The longer answer==<br />
<br />
Prepare a usb memory stick formatted as fat32 with two folders called P07 and P20<br />
<br />
===Step 1 download old firmware===<br />
<br />
1. Download this zip archive from dell and unzip it: https://downloads.dell.com/FOLDER02950081M/1/Y2R1T_9211_FW.zip?uid=f06bb69a-8c88-4a54-ac7b-ee8826244140&fn=Y2R1T_9211_FW.zip<br />
<br />
2. Extract 6GBPSAS.FW from Y2R1T_9211_FW/Firmware/6GbpsSASHBA_07.03.06.00_A10<br />
<br />
3. Extract 2118it.bin from FY2R1T_9211_FW/Firmware/9211-8i_P7/<br />
<br />
4. Extract sas2flash.efi from Y2R1T_9211_FW/sas2flash/p05/efi/<br />
<br />
5. Place the three extracted files in the P07 folder<br />
<br />
===Step 2 download current firmware===<br />
<br />
1. Extract 2118it.bin from Y2R1T_9211_FW/Firmware/9211-8i/P20/<br />
<br />
2. Download this zip https://docs.broadcom.com/docs-and-downloads/host-bus-adapters/host-bus-adapters-common-files/sas_sata_6g_p20/Installer_P20_for_UEFI.zip<br />
<br />
3. Extract sas2flash.efi from Installer_P20_for_UEFI/sas2flash_efi_ebc_rel/<br />
<br />
4. Place this to extracted files in the P20 folder<br />
<br />
===Step 3 download uefi shell===<br />
1. Download an uefi shell: [https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Obtaining_UEFI_Shell x86_64 UEFI SHELL] I choosed version 1 as it worked for the person in the guide [https://github.com/tianocore/edk2/raw/UDK2018/EdkShellBinPkg/FullShell/X64/Shell_Full.efi Direct download link]<br />
<br />
2. Extract Shell_Full.efi to the root of the memory stick. I had to rename it to Shellx64.efi to use it with my motherboard, asus P8H67_M_EVO. Check with you motherboard vendor to determine how to use efi-shell<br />
<br />
===Step 4 flashing===<br />
<br />
1. boot computer to efi shell<br />
<br />
2. If not present with a list with devices, type <pre>map -b</pre><br />
<br />
2. On my computer the memory stick is called fs0 so I typed fs0: to change prompt to the memory stick<br />
<br />
3. <pre>cd P07</pre><br />
<br />
4. <pre>sas2flash -listall</pre>will show the controller. If not, check if it is installed to a pci-e port<br />
<br />
5. <pre>sas2flash.efi -c 0 -list</pre> will show controller details and take a note of the sas address number<br />
<br />
6. <pre>sas2flash.efi -o -e 6</pre> will erase the old firmware and boot rom<br />
<br />
7. <pre>sas2flash.efi -o -f 6GBPSAS.FW</pre> writes the dell 6gbs firmware<br />
<br />
8. <pre>sas2flash.efi -o -f 2118it.bin</pre> writes the P07 firmware<br />
<br />
9. Then I rebooted<br />
<br />
10. boot into efi again<br />
<br />
11. <pre>cd P20</pre><br />
<br />
12. <pre>sas2flash.efi -o -f 2118it.bin writes the P20 firmware</pre><br />
<br />
===Notes===<br />
Directly copied from the source, step number changed to fit my tutorial:<br />
<br />
1. Step 6 showed “Erasing Flash Region” and then after a while “ERROR: Erase Flash Operation Failed!”. I simply proceeded and the error did not appear to affect anything.<br />
<br />
2. Visit [https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/ source] to get screenshots vit the error messages<br />
<br />
=Compile rtorrent libtorrent and xmlrpc-c=<br />
==libtorrent==<br />
==rtorrent==<br />
./configure --prefix=/usr --with-xmlrpc-c |tee /tmp/conf.log<br />
<br />
=vim=<br />
<br />
# Merk Noe Og Trykk U For Å Få Det I Lowercase, U For Uppercase ;)<br />
# stor v for visual line eller liten for visual der du må merke noe manuelt<br />
# ok. jeg glemte å markere først :p<br />
# oki :)<br />
<br />
# iT'S cAPS lOCK DAY!<br />
<br />
# trykk ~ for å endre fra stor til liten bokstav ;)<br />
<br />
# legg i toppen av dokumentet for å endre inrykk, etc<br />
vim:ts=4:sw=4:sts=4:et:ai<br />
<br />
=grub=<br />
<br />
==Repair GRUB from Windows==<br />
<br />
To repair efi bootloader/grub from windows<br />
<br />
Open powershell as admin and execute the following command<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\{distro}\grubx64.efi</pre><br />
<br />
if you are running debian, it will look like this:<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\debian\grubx64.efi</pre><br />
<br />
==Repair/install GRUB on EFI from live-usb==<br />
<br />
source=https://askubuntu.com/questions/831216/how-can-i-reinstall-grub-to-the-efi-partition/831241#831241<br />
<br />
<pre>mount /dev/sdXY /mnt</pre><br />
<br />
If you have seperatate boot-partition:<br />
<br />
<pre>mount /dev/sdXX /mnt/boot</pre><br />
<br />
and finally mount the efi-partition under boot:<br />
<br />
<pre>mount /dev/sdXZ /mnt/boot/efi/</pre><br />
<br />
Bind-mount some system partitions from the live-system:<br />
<br />
<pre>for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done </pre><br />
<br />
<pre>chroot /mnt</pre><br />
<br />
grub-install --target=x86_64-efi --efi-root=/dev/sdXZ<br />
grub-mkconfig -o /boot/grub/grub.cfg</pre><br />
<br />
NOTE: Note : sdX = disk | sdXX = boot partition | sdXY = system partition | sdXZ = efi partition<br />
<br />
<br />
===Troubleshooting===<br />
<br />
EFI variables are not supported on this system.<br />
<br />
source:https://bbs.archlinux.org/viewtopic.php?pid=1349414#p1349414<br />
<br />
From outside chroot:<br />
<br />
<pre>modprobe efivarfs</pre><br />
<br />
From inside chroot:<br />
<br />
<pre> mount -t efivarfs efivarfs /sys/firmware/efi/efivars</pre><br />
<br />
==Boot Linux from GRUB shell==<br />
<br />
Something went down the alley and you're now stuck in the grub shell, or that's what you think :)<br />
<br />
First we need to figure out what partition our linux root-partition is on<br />
<br />
the command ls will list all disks and partitions<br />
<br />
to find what partition it is on, do:<br />
<br />
<pre>cat (hd0,gpt1)/etc/issue</pre><br />
<br />
do this with the different disksk and partitions until you find one that outputs a line that says something about what Linux flavlour you are running.<br />
On Arch it will look like this:<br />
<br />
<pre>Arch Linux \r (\l)</pre><br />
<br />
So if we say the root partition on Arch Linux was on (hd0,gpt2) you will need to run<br />
<br />
<pre>root=(hd0,gpt2)</pre><br />
<br />
This must be adjusted to fit your system.<br />
<br />
Next we need to tell what kernel we will run and what device (dev) the root-partition ison:<br />
<br />
<pre>linux /boot/vmlinuz root=/dev/nvme0n1p2</pre><br />
<br />
If the root-partion is on a m2-card and is on the second partition on device nvme0n1, do as above.<br />
<br />
Use autocomplete (tab-complete) if you want a more specific kernel-version<br />
<br />
Next we need to choose the initramfs image<br />
<br />
<pre>initrd /boot/initramfs.img</pre><br />
<br />
Use tab-complete to find a more specifici version to match a more specicific kernel in the previous step<br />
<br />
Now it's time to boot:<br />
<br />
<pre>boot</pre><br />
<br />
=libvirt=<br />
<br />
==setup new vm from a template==<br />
<br />
If you have a qcow2 vm template, clone it.:<br />
<br />
If you clone a qcow2 in use, stop the vm first:<br />
<br />
<pre>virsh stop {domain-vm-name}</pre><br />
<br />
Then clone the qcow2<br />
<br />
<pre>virt-clone --original {Domain-Vm-Name-Here} --name {New-Domain-Vm-Name-Here} --auto-clone</pre><br />
<br />
Configure your VM to your likings either by virt-manager (gui) or by cli<br />
<br />
Start the new vm and log in, either by ssh, or via virt-manager<br />
<br />
Change hostname to match the new name of the VM<br />
<br />
<pre>sudo -i<br />
vi /etc/hostname</pre><br />
<br />
<br />
<pre>vi /etc/hosts</pre> to match the name of the new VM<br />
<br />
Example. change:<br />
<br />
<pre>127.0.1.1 debian-stretch-mal.debian-stretch-mal.local debian-stretch-mal</pre><br />
<br />
to<br />
<pre>127.0.1.1 new-name-vm.new-name-vm.local new-name-vm</pre><br />
<br />
Also add a line for the ip to the server who runs the VM and for the backup server if you have one, like this<br />
<br />
<pre>192.168.X.X hostname.domain.xx hostname</pre><br />
<br />
<br />
change local ip to a free address<br />
<br />
<pre> vi /etc/network/interfaces</pre><br />
<br />
and add the new ip in on the host <br />
<pre>/etc/hosts</pre><br />
<br />
Make ssh keys:<br />
<br />
<pre>ssh-keygen</pre><br />
go with the defaults by hit enter, when prompted for questions<br />
<br />
copy the the public key from <pre>.ssh/id_rsa.pub</pre><br />
<br />
If bareos is setup on the qcow2 vm template you also need to change the following line in bareos filedaemon config to match your new vm<br />
<br />
<pre>vi /etc/bareos/bareos-fd.conf<br />
<br />
FileDaemon {<br />
Name = new-name-vm.domain.xx-fd </pre><br />
<br />
*sources<br />
https://www.cyberciti.biz/faq/how-to-clone-existing-kvm-virtual-machine-images-on-linux/<br />
<br />
== Batch operations on VMs ==<br />
<br />
<br />
To shut down all running virtual machines, do:<br />
<br />
<pre>for vm in $( virsh list | awk '/running/ { print $2 }' ) ; do virsh shutdown $vm ; done</pre><br />
<br />
To start up all virtual machines from a folder with xml-files representing an individual virtual machine, do:<br />
<br />
<pre>for f in *.xml ; do vm=$( basename $f .xml ) ; virsh start $vm ; done</pre><br />
<br />
=add bareos client=<br />
<br />
If you already have a bareos backup server<br />
<br />
on the new vm or computer you want to backup to bareos<br />
<br />
Install bareos-filedaemon on the client if it's not already installed<br />
<pre> apt install bareos-filedaemon<br />
systemctl enable bareos-filedaemon.service</pre><br />
<br />
<br />
Then log into the bareos server and run bconsole<br />
<br />
<pre>configure add client name=new-name-vm address=192.168.X.X password=SOME_PASSWORD</pre><br />
<br />
Then the config is saved to<br />
<pre>/etc/bareos/bareos-dir-export/client/svennd/bareos-fd.d/director/bareos-dir.conf</pre><br />
<br />
Copy it to the client in:<br />
<pre>/etc/bareos/bareos-fd.d/directory/bareos-dir.conf</pre><br />
<br />
<br />
*sources<br />
https://www.svennd.be/adding-a-linux-client-to-bareos/<br />
<br />
<br />
=IRC=<br />
==Renew ssl cert==<br />
source= https://github.com/ubergeek42/weechat-android/wiki/Using-SSL-with-WeeChat#generating-a-self-signed-certificate=<br />
To create a certificate with a domain:<br />
<br />
<pre>export HOSTNAME=example.org</pre><br />
<br />
From within ~/.weechat/ssl do:<br />
<pre>openssl req -x509 -nodes -newkey rsa:2048 -keyout relay.pem -extensions san_env \<br />
-subj "/O=WeeChat/CN=$HOSTNAME" \<br />
-config <(cat /etc/ssl/openssl.cnf <(printf "\n[ san_env ]\nsubjectAltName=DNS:\${ENV::HOSTNAME}")) \<br />
-days 365 -out relay.pem</pre><br />
<br />
Then within weechat, reload to the new certificate<br />
<br />
<pre>/relay sslcertkey</pre><br />
<br />
=DNS with rndc=<br />
<br />
==Manipulating dns with rndc==<br />
<br />
login to the computer/vm that takes care of DNS<br />
<br />
ZONE=<domain>.<countrycode> ; rndc freeze $ZONE && vi /etc/bind/$ZONE.zone ; rndc thaw $ZONE ; tail -f /var/log/daemon.log<br />
<br />
Do it like this:<br />
<br />
<pre>rndc freeze domain.no</pre><br />
<br />
Edit stuff in open and you can add stuff:<br />
<br />
<pre><text-editor> /etc/bind/domain.no.zone</pre><br />
<br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Example</strong><br />
|-<br />
| If you use the text editor nano it will look like this: <br />
<pre>nano /etc/bind/domain.no.zone</pre><br />
|}<br />
<br />
Edit the file according to this:<br />
<br />
<pre><vm-domain-name-vm> AAAA ipv6-adr<br />
<vm-domain-name-vm> A ipv4-adr<br />
<br />
<vm-domain-name> CNAME <vm-domain-name></pre><br />
<br />
example:<br />
<br />
<pre>test-vm AAAA ipv6-adr<br />
test-vm A ipv4-adr<br />
<br />
test CNAME test-vm</pre><br />
<br />
Don't have same domain on both A/AAAA and CNAME<br />
<br />
Before you save and exit, add serial number to zone-file format: YYYYMMDDxx<br />
<br />
Oneliner to run. change domain.no to your domain<br />
<br />
<pre>rndc freeze domain.no && vi /etc/bind/karlsbakk.net.zone ; rndc thaw domain.no ; tail -f /var/log/daemon.log</pre><br />
<br />
==Local script to run==<br />
<br />
Open the local [https://github.com/rkarlsba/ymse/blob/master/ddns/ddns-update.sh ddns-update.sh] script and add test-vm to VM= variabel if not already present<br />
<br />
If you don't want to wait for the script to run automatically from cron, run it with the force flag<br />
<br />
<pre>ddns-update.sh --force</pre><br />
<br />
==Troubleshooting==<br />
<br />
Ipv4 not updated when address changes<br />
<br />
check if you remembered to thaw the zone<br />
<br />
=SSH=<br />
<br />
==TAB-complete==<br />
<br />
<pre>vi .ssh/config</pre><br />
<br />
Then add lines like this:<br />
<br />
<pre><br />
Host <name> # space between multiple names<br />
user admin # optional if you want to add username to log in with<br />
Hostname <ipaddress>/<domain/hostname><br />
Port 2022 # optional add if port is other than default 22<br />
</pre><br />
<br />
Example <br />
<pre><br />
Host test-vm test<br />
Hostname test-vm.test.no<br />
<br />
</pre><br />
<br />
== postgres ==<br />
https://stackoverflow.com/questions/32439167/psql-could-not-connect-to-server-connection-refused-error-when-connecting-to<br />
<br />
=== backup with restic and file quotes ===<br />
<br />
in debian you will need the package: quota<br />
<br />
make a lv or something with a filesystem on it<br />
<br />
in fstab block - mountpoint filesystem defaults,usrquota 0 0</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Markdown&diff=425Markdown2023-11-12T01:43:19Z<p>Wiki.malinux.no: </p>
<hr />
<div><markdown><br />
<br />
## Test<br />
<br />
- list<br />
- list 2<br />
<br />
<br />
My favorite search engine is [Duck Duck Go](https://duckduckgo.com).<br />
<br />
> DEtte er rart<br />
>> eller er det nå egentlig det?<br />
>> jeg er ikke så sikker faktisk<br />
<br />
| Liste | beskrivelse|<br />
|-------|------------|<br />
<br />
<br />
</markdown></div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Markdown&diff=424Markdown2023-11-12T01:40:03Z<p>Wiki.malinux.no: </p>
<hr />
<div><markdown><br />
<br />
## Test<br />
<br />
- list<br />
- list 2<br />
<br />
url : [navnet på min url eller hva nå enn jeg vil at linken skal vises som] (www.minurl.no)<br />
<br />
> DEtte er rart<br />
>> eller er det nå egentlig det?<br />
>> jeg er ikke så sikker faktisk<br />
<br />
<br />
</markdown></div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Markdown&diff=423Markdown2023-11-12T01:34:17Z<p>Wiki.malinux.no: </p>
<hr />
<div><markdown><br />
<br />
## Test<br />
<br />
- list<br />
- list 2<br />
<br />
url : [navnet på min url eller hva nå enn jeg vil at linken skal vises som] (www.minurl.no)<br />
<br />
<br />
</markdown></div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Markdown&diff=422Markdown2023-11-12T01:32:50Z<p>Wiki.malinux.no: </p>
<hr />
<div><markdown><br />
<br />
## Test<br />
<br />
- list<br />
- list 2<br />
<br />
</markdown></div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Markdown&diff=421Markdown2023-11-12T01:03:47Z<p>Wiki.malinux.no: Created page with "<markdown> ## Test </markdown>"</p>
<hr />
<div><markdown><br />
<br />
## Test<br />
<br />
</markdown></div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Nintendo_Switch&diff=420Nintendo Switch2023-09-30T11:04:22Z<p>Wiki.malinux.no: /* Add keys */</p>
<hr />
<div>=Yuzu-emulator=<br />
<br />
==Install Yumu Emulator==<br />
<br />
===Windows:===<br />
<br />
Visit this url and download the windows installer<br />
https://yuzu-emu.org/downloads/<br />
<br />
===Arch Linux:===<br />
yay -S yuzu<br />
<br />
===Flatpak:===<br />
flatpak install yuzu<br />
<br />
==Add keys==<br />
<br />
Download latest keys from:<br />
https://raw.githubusercontent.com/HiDe-Techno-Tips/Nintendo-Switch-Files/main/prod.keys<br />
<br />
Add them to a file called prod.keys like this:<br />
<br />
===In windows:===<br />
<pre>Appdata\Roaming\yuzu\keys\prod.keys</pre><br />
<br />
===In Arch Linux:===<br />
<br />
<pre> cd /home/$USER/.local/share/yuzu/keys</pre><br />
Download https://web.archive.org/web/20221109110407/https://raw.githubusercontent.com/HiDe-Techno-Tips/Nintendo-Switch-Files/main/prod.keys<br />
<br />
===Flatpak I don't know atm:===<br />
<br />
<pre> in some folder :p </pre><br />
<br />
==Add firmware===<br />
<br />
Visit https://archive.org/download/yuzu-emulator-firmware-dumps<br />
And download the firmware you like to use. Example the latest<br />
<br />
unzip the zip and extract all the content to the correct folder<br />
<br />
===In Windows:===<br />
<br />
<pre>Appdata\Roaming\yuzu\nand\system\Contents\registered\</pre><br />
<br />
===In Arch:===<br />
<pre>/home/$USER/.local/share/yuzu/nand/system/Contents/registered/<br />
<br />
===With Flatpak I don't know atm===<br />
<br />
<pre>/some/folder/</pre></div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Nintendo_Switch&diff=419Nintendo Switch2023-09-30T11:02:59Z<p>Wiki.malinux.no: /* Add keys */</p>
<hr />
<div>=Yuzu-emulator=<br />
<br />
==Install Yumu Emulator==<br />
<br />
===Windows:===<br />
<br />
Visit this url and download the windows installer<br />
https://yuzu-emu.org/downloads/<br />
<br />
===Arch Linux:===<br />
yay -S yuzu<br />
<br />
===Flatpak:===<br />
flatpak install yuzu<br />
<br />
==Add keys==<br />
<br />
Download latest keys from:<br />
https://raw.githubusercontent.com/HiDe-Techno-Tips/Nintendo-Switch-Files/main/prod.keys<br />
<br />
Add them to a file called prod.keys like this:<br />
<br />
===In windows:===<br />
<pre>Appdata\Roaming\yuzu\keys\prod.keys</pre><br />
<br />
===In Arch Linux:===<br />
<br />
<pre> cd /home/$USER/.local/share/yuzu/keys<br />
https://web.archive.org/web/20221109110407/https://raw.githubusercontent.com/HiDe-Techno-Tips/Nintendo-Switch-Files/main/prod.keys<br />
</pre><br />
<br />
===Flatpak I don't know atm:===<br />
<br />
<pre> in some folder :p </pre><br />
<br />
==Add firmware===<br />
<br />
Visit https://archive.org/download/yuzu-emulator-firmware-dumps<br />
And download the firmware you like to use. Example the latest<br />
<br />
unzip the zip and extract all the content to the correct folder<br />
<br />
===In Windows:===<br />
<br />
<pre>Appdata\Roaming\yuzu\nand\system\Contents\registered\</pre><br />
<br />
===In Arch:===<br />
<pre>/home/$USER/.local/share/yuzu/nand/system/Contents/registered/<br />
<br />
===With Flatpak I don't know atm===<br />
<br />
<pre>/some/folder/</pre></div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Malin%27s_notes&diff=418Malin's notes2023-09-26T20:13:24Z<p>Wiki.malinux.no: </p>
<hr />
<div>==gnu/linux==<br />
<br />
To change ownership of everything that's not already owned by a user<br />
<br />
find /home/rtorrent/ ! -user rtorrent -exec chown rtorrent:rtorrent {} \; &<br />
<br />
==rtl8812AU==<br />
https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git<br />
<br />
remove led-disco<br />
<br />
/etc/modprobe.d/8188eu-blacklist.conf<br />
<br />
options 8812au rtw_led_enable=0<br />
<br />
==LVM==<br />
===[https://blog.raveland.tech/post/rename_vg/ rename Volume Group (VG)]===<br />
<br />
==mdadm==<br />
for dev in $( lsblk | awk '/sd[a-z].*1,8T/ { print }' ); do echo =============================== $dev ============================ ; smartctl -a /dev/$dev ; done | pastebinit<br />
<br />
<br />
<br />
mdadm --remove /dev/md0 failed # all failed devices<br />
<br />
mdadm --remove /dev/md0 detached # failed ones that aren't in /dev anymore<br />
<br />
ip addr add 192.168.0.101/24 dev eth0 ; ip route add default via 192.168.0.1 dev eth0<br />
<br />
<br />
<br />
Mulig rekkefølge med forbehold om at et ikke stemmer, for å endre vg navn på vg med root-partisjon<br />
vgchange gammel-vg ny-vg<br />
vgchange -ay<br />
<br />
endre i /etc/fstab<br />
<br />
grub-install /dev/XxX<br />
<br />
update-initramfs -k all -u<br />
<br />
reboot<br />
<br />
=Crossflash Dell PERC H200 from ir to it-mode=<br />
<br />
==The short answer== <br />
I slightly followed this guide:<br />
<br />
https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/<br />
<br />
The longer answer is. I followed the guide, this way, but did it a little different<br />
<br />
==The longer answer==<br />
<br />
Prepare a usb memory stick formatted as fat32 with two folders called P07 and P20<br />
<br />
===Step 1 download old firmware===<br />
<br />
1. Download this zip archive from dell and unzip it: https://downloads.dell.com/FOLDER02950081M/1/Y2R1T_9211_FW.zip?uid=f06bb69a-8c88-4a54-ac7b-ee8826244140&fn=Y2R1T_9211_FW.zip<br />
<br />
2. Extract 6GBPSAS.FW from Y2R1T_9211_FW/Firmware/6GbpsSASHBA_07.03.06.00_A10<br />
<br />
3. Extract 2118it.bin from FY2R1T_9211_FW/Firmware/9211-8i_P7/<br />
<br />
4. Extract sas2flash.efi from Y2R1T_9211_FW/sas2flash/p05/efi/<br />
<br />
5. Place the three extracted files in the P07 folder<br />
<br />
===Step 2 download current firmware===<br />
<br />
1. Extract 2118it.bin from Y2R1T_9211_FW/Firmware/9211-8i/P20/<br />
<br />
2. Download this zip https://docs.broadcom.com/docs-and-downloads/host-bus-adapters/host-bus-adapters-common-files/sas_sata_6g_p20/Installer_P20_for_UEFI.zip<br />
<br />
3. Extract sas2flash.efi from Installer_P20_for_UEFI/sas2flash_efi_ebc_rel/<br />
<br />
4. Place this to extracted files in the P20 folder<br />
<br />
===Step 3 download uefi shell===<br />
1. Download an uefi shell: [https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Obtaining_UEFI_Shell x86_64 UEFI SHELL] I choosed version 1 as it worked for the person in the guide [https://github.com/tianocore/edk2/raw/UDK2018/EdkShellBinPkg/FullShell/X64/Shell_Full.efi Direct download link]<br />
<br />
2. Extract Shell_Full.efi to the root of the memory stick. I had to rename it to Shellx64.efi to use it with my motherboard, asus P8H67_M_EVO. Check with you motherboard vendor to determine how to use efi-shell<br />
<br />
===Step 4 flashing===<br />
<br />
1. boot computer to efi shell<br />
<br />
2. If not present with a list with devices, type <pre>map -b</pre><br />
<br />
2. On my computer the memory stick is called fs0 so I typed fs0: to change prompt to the memory stick<br />
<br />
3. <pre>cd P07</pre><br />
<br />
4. <pre>sas2flash -listall</pre>will show the controller. If not, check if it is installed to a pci-e port<br />
<br />
5. <pre>sas2flash.efi -c 0 -list</pre> will show controller details and take a note of the sas address number<br />
<br />
6. <pre>sas2flash.efi -o -e 6</pre> will erase the old firmware and boot rom<br />
<br />
7. <pre>sas2flash.efi -o -f 6GBPSAS.FW</pre> writes the dell 6gbs firmware<br />
<br />
8. <pre>sas2flash.efi -o -f 2118it.bin</pre> writes the P07 firmware<br />
<br />
9. Then I rebooted<br />
<br />
10. boot into efi again<br />
<br />
11. <pre>cd P20</pre><br />
<br />
12. <pre>sas2flash.efi -o -f 2118it.bin writes the P20 firmware</pre><br />
<br />
===Notes===<br />
Directly copied from the source, step number changed to fit my tutorial:<br />
<br />
1. Step 6 showed “Erasing Flash Region” and then after a while “ERROR: Erase Flash Operation Failed!”. I simply proceeded and the error did not appear to affect anything.<br />
<br />
2. Visit [https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/ source] to get screenshots vit the error messages<br />
<br />
=Compile rtorrent libtorrent and xmlrpc-c=<br />
==libtorrent==<br />
==rtorrent==<br />
./configure --prefix=/usr --with-xmlrpc-c |tee /tmp/conf.log<br />
<br />
=vim=<br />
<br />
# Merk Noe Og Trykk U For Å Få Det I Lowercase, U For Uppercase ;)<br />
# stor v for visual line eller liten for visual der du må merke noe manuelt<br />
# ok. jeg glemte å markere først :p<br />
# oki :)<br />
<br />
# iT'S cAPS lOCK DAY!<br />
<br />
# trykk ~ for å endre fra stor til liten bokstav ;)<br />
<br />
# legg i toppen av dokumentet for å endre inrykk, etc<br />
vim:ts=4:sw=4:sts=4:et:ai<br />
<br />
=grub=<br />
<br />
==Repair GRUB from Windows==<br />
<br />
To repair efi bootloader/grub from windows<br />
<br />
Open powershell as admin and execute the following command<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\{distro}\grubx64.efi</pre><br />
<br />
if you are running debian, it will look like this:<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\debian\grubx64.efi</pre><br />
<br />
==Repair/install GRUB on EFI from live-usb==<br />
<br />
source=https://askubuntu.com/questions/831216/how-can-i-reinstall-grub-to-the-efi-partition/831241#831241<br />
<br />
<pre>mount /dev/sdXY /mnt</pre><br />
<br />
If you have seperatate boot-partition:<br />
<br />
<pre>mount /dev/sdXX /mnt/boot</pre><br />
<br />
and finally mount the efi-partition under boot:<br />
<br />
<pre>mount /dev/sdXZ /mnt/boot/efi/</pre><br />
<br />
Bind-mount some system partitions from the live-system:<br />
<br />
<pre>for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done </pre><br />
<br />
<pre>chroot /mnt</pre><br />
<br />
grub-install --target=x86_64-efi --efi-root=/dev/sdXZ<br />
grub-mkconfig -o /boot/grub/grub.cfg</pre><br />
<br />
NOTE: Note : sdX = disk | sdXX = boot partition | sdXY = system partition | sdXZ = efi partition<br />
<br />
<br />
===Troubleshooting===<br />
<br />
EFI variables are not supported on this system.<br />
<br />
source:https://bbs.archlinux.org/viewtopic.php?pid=1349414#p1349414<br />
<br />
From outside chroot:<br />
<br />
<pre>modprobe efivarfs</pre><br />
<br />
From inside chroot:<br />
<br />
<pre> mount -t efivarfs efivarfs /sys/firmware/efi/efivars</pre><br />
<br />
==Boot Linux from GRUB shell==<br />
<br />
Something went down the alley and you're now stuck in the grub shell, or that's what you think :)<br />
<br />
First we need to figure out what partition our linux root-partition is on<br />
<br />
the command ls will list all disks and partitions<br />
<br />
to find what partition it is on, do:<br />
<br />
<pre>cat (hd0,gpt1)/etc/issue</pre><br />
<br />
do this with the different disksk and partitions until you find one that outputs a line that says something about what Linux flavlour you are running.<br />
On Arch it will look like this:<br />
<br />
<pre>Arch Linux \r (\l)</pre><br />
<br />
So if we say the root partition on Arch Linux was on (hd0,gpt2) you will need to run<br />
<br />
<pre>root=(hd0,gpt2)</pre><br />
<br />
This must be adjusted to fit your system.<br />
<br />
Next we need to tell what kernel we will run and what device (dev) the root-partition ison:<br />
<br />
<pre>linux /boot/vmlinuz root=/dev/nvme0n1p2</pre><br />
<br />
If the root-partion is on a m2-card and is on the second partition on device nvme0n1, do as above.<br />
<br />
Use autocomplete (tab-complete) if you want a more specific kernel-version<br />
<br />
Next we need to choose the initramfs image<br />
<br />
<pre>inird /boot/initramfs.img</pre><br />
<br />
Use tab-complete to find a more specifici version to match a more specicific kernel in the previous step<br />
<br />
Now it's time to boot:<br />
<br />
<pre>boot</pre><br />
<br />
=libvirt=<br />
<br />
==setup new vm from a template==<br />
<br />
If you have a qcow2 vm template, clone it.:<br />
<br />
If you clone a qcow2 in use, stop the vm first:<br />
<br />
<pre>virsh stop {domain-vm-name}</pre><br />
<br />
Then clone the qcow2<br />
<br />
<pre>virt-clone --original {Domain-Vm-Name-Here} --name {New-Domain-Vm-Name-Here} --auto-clone</pre><br />
<br />
Configure your VM to your likings either by virt-manager (gui) or by cli<br />
<br />
Start the new vm and log in, either by ssh, or via virt-manager<br />
<br />
Change hostname to match the new name of the VM<br />
<br />
<pre>sudo -i<br />
vi /etc/hostname</pre><br />
<br />
<br />
<pre>vi /etc/hosts</pre> to match the name of the new VM<br />
<br />
Example. change:<br />
<br />
<pre>127.0.1.1 debian-stretch-mal.debian-stretch-mal.local debian-stretch-mal</pre><br />
<br />
to<br />
<pre>127.0.1.1 new-name-vm.new-name-vm.local new-name-vm</pre><br />
<br />
Also add a line for the ip to the server who runs the VM and for the backup server if you have one, like this<br />
<br />
<pre>192.168.X.X hostname.domain.xx hostname</pre><br />
<br />
<br />
change local ip to a free address<br />
<br />
<pre> vi /etc/network/interfaces</pre><br />
<br />
and add the new ip in on the host <br />
<pre>/etc/hosts</pre><br />
<br />
Make ssh keys:<br />
<br />
<pre>ssh-keygen</pre><br />
go with the defaults by hit enter, when prompted for questions<br />
<br />
copy the the public key from <pre>.ssh/id_rsa.pub</pre><br />
<br />
If bareos is setup on the qcow2 vm template you also need to change the following line in bareos filedaemon config to match your new vm<br />
<br />
<pre>vi /etc/bareos/bareos-fd.conf<br />
<br />
FileDaemon {<br />
Name = new-name-vm.domain.xx-fd </pre><br />
<br />
*sources<br />
https://www.cyberciti.biz/faq/how-to-clone-existing-kvm-virtual-machine-images-on-linux/<br />
<br />
== Batch operations on VMs ==<br />
<br />
<br />
To shut down all running virtual machines, do:<br />
<br />
<pre>for vm in $( virsh list | awk '/running/ { print $2 }' ) ; do virsh shutdown $vm ; done</pre><br />
<br />
To start up all virtual machines from a folder with xml-files representing an individual virtual machine, do:<br />
<br />
<pre>for f in *.xml ; do vm=$( basename $f .xml ) ; virsh start $vm ; done</pre><br />
<br />
=add bareos client=<br />
<br />
If you already have a bareos backup server<br />
<br />
on the new vm or computer you want to backup to bareos<br />
<br />
Install bareos-filedaemon on the client if it's not already installed<br />
<pre> apt install bareos-filedaemon<br />
systemctl enable bareos-filedaemon.service</pre><br />
<br />
<br />
Then log into the bareos server and run bconsole<br />
<br />
<pre>configure add client name=new-name-vm address=192.168.X.X password=SOME_PASSWORD</pre><br />
<br />
Then the config is saved to<br />
<pre>/etc/bareos/bareos-dir-export/client/svennd/bareos-fd.d/director/bareos-dir.conf</pre><br />
<br />
Copy it to the client in:<br />
<pre>/etc/bareos/bareos-fd.d/directory/bareos-dir.conf</pre><br />
<br />
<br />
*sources<br />
https://www.svennd.be/adding-a-linux-client-to-bareos/<br />
<br />
<br />
=IRC=<br />
==Renew ssl cert==<br />
source= https://github.com/ubergeek42/weechat-android/wiki/Using-SSL-with-WeeChat#generating-a-self-signed-certificate=<br />
To create a certificate with a domain:<br />
<br />
<pre>export HOSTNAME=example.org</pre><br />
<br />
From within ~/.weechat/ssl do:<br />
<pre>openssl req -x509 -nodes -newkey rsa:2048 -keyout relay.pem -extensions san_env \<br />
-subj "/O=WeeChat/CN=$HOSTNAME" \<br />
-config <(cat /etc/ssl/openssl.cnf <(printf "\n[ san_env ]\nsubjectAltName=DNS:\${ENV::HOSTNAME}")) \<br />
-days 365 -out relay.pem</pre><br />
<br />
Then within weechat, reload to the new certificate<br />
<br />
<pre>/relay sslcertkey</pre><br />
<br />
=DNS with rndc=<br />
<br />
==Manipulating dns with rndc==<br />
<br />
login to the computer/vm that takes care of DNS<br />
<br />
ZONE=<domain>.<countrycode> ; rndc freeze $ZONE && vi /etc/bind/$ZONE.zone ; rndc thaw $ZONE ; tail -f /var/log/daemon.log<br />
<br />
Do it like this:<br />
<br />
<pre>rndc freeze domain.no</pre><br />
<br />
Edit stuff in open and you can add stuff:<br />
<br />
<pre><text-editor> /etc/bind/domain.no.zone</pre><br />
<br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Example</strong><br />
|-<br />
| If you use the text editor nano it will look like this: <br />
<pre>nano /etc/bind/domain.no.zone</pre><br />
|}<br />
<br />
Edit the file according to this:<br />
<br />
<pre><vm-domain-name-vm> AAAA ipv6-adr<br />
<vm-domain-name-vm> A ipv4-adr<br />
<br />
<vm-domain-name> CNAME <vm-domain-name></pre><br />
<br />
example:<br />
<br />
<pre>test-vm AAAA ipv6-adr<br />
test-vm A ipv4-adr<br />
<br />
test CNAME test-vm</pre><br />
<br />
Don't have same domain on both A/AAAA and CNAME<br />
<br />
Before you save and exit, add serial number to zone-file format: YYYYMMDDxx<br />
<br />
Oneliner to run. change domain.no to your domain<br />
<br />
<pre>rndc freeze domain.no && vi /etc/bind/karlsbakk.net.zone ; rndc thaw domain.no ; tail -f /var/log/daemon.log</pre><br />
<br />
==Local script to run==<br />
<br />
Open the local [https://github.com/rkarlsba/ymse/blob/master/ddns/ddns-update.sh ddns-update.sh] script and add test-vm to VM= variabel if not already present<br />
<br />
If you don't want to wait for the script to run automatically from cron, run it with the force flag<br />
<br />
<pre>ddns-update.sh --force</pre><br />
<br />
==Troubleshooting==<br />
<br />
Ipv4 not updated when address changes<br />
<br />
check if you remembered to thaw the zone<br />
<br />
=SSH=<br />
<br />
==TAB-complete==<br />
<br />
<pre>vi .ssh/config</pre><br />
<br />
Then add lines like this:<br />
<br />
<pre><br />
Host <name> # space between multiple names<br />
user admin # optional if you want to add username to log in with<br />
Hostname <ipaddress>/<domain/hostname><br />
Port 2022 # optional add if port is other than default 22<br />
</pre><br />
<br />
Example <br />
<pre><br />
Host test-vm test<br />
Hostname test-vm.test.no<br />
<br />
</pre><br />
<br />
== postgres ==<br />
https://stackoverflow.com/questions/32439167/psql-could-not-connect-to-server-connection-refused-error-when-connecting-to<br />
<br />
=== backup with restic and file quotes ===<br />
<br />
in debian you will need the package: quota<br />
<br />
make a lv or something with a filesystem on it<br />
<br />
in fstab block - mountpoint filesystem defaults,usrquota 0 0</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Malin%27s_notes&diff=417Malin's notes2023-09-26T20:06:12Z<p>Wiki.malinux.no: </p>
<hr />
<div>==gnu/linux==<br />
<br />
To change ownership of everything that's not already owned by a user<br />
<br />
find /home/rtorrent/ ! -user rtorrent -exec chown rtorrent:rtorrent {} \; &<br />
<br />
==rtl8812AU==<br />
https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git<br />
<br />
remove led-disco<br />
<br />
/etc/modprobe.d/8188eu-blacklist.conf<br />
<br />
options 8812au rtw_led_enable=0<br />
<br />
==LVM==<br />
===[https://blog.raveland.tech/post/rename_vg/ rename Volume Group (VG)]===<br />
<br />
==mdadm==<br />
for dev in $( lsblk | awk '/sd[a-z].*1,8T/ { print }' ); do echo =============================== $dev ============================ ; smartctl -a /dev/$dev ; done | pastebinit<br />
<br />
<br />
<br />
mdadm --remove /dev/md0 failed # all failed devices<br />
<br />
mdadm --remove /dev/md0 detached # failed ones that aren't in /dev anymore<br />
<br />
ip addr add 192.168.0.101/24 dev eth0 ; ip route add default via 192.168.0.1 dev eth0<br />
<br />
<br />
<br />
Mulig rekkefølge med forbehold om at et ikke stemmer, for å endre vg navn på vg med root-partisjon<br />
vgchange gammel-vg ny-vg<br />
vgchange -ay<br />
<br />
endre i /etc/fstab<br />
<br />
grub-install /dev/XxX<br />
<br />
update-initramfs -k all -u<br />
<br />
reboot<br />
<br />
=Crossflash Dell PERC H200 from ir to it-mode=<br />
<br />
==The short answer== <br />
I slightly followed this guide:<br />
<br />
https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/<br />
<br />
The longer answer is. I followed the guide, this way, but did it a little different<br />
<br />
==The longer answer==<br />
<br />
Prepare a usb memory stick formatted as fat32 with two folders called P07 and P20<br />
<br />
===Step 1 download old firmware===<br />
<br />
1. Download this zip archive from dell and unzip it: https://downloads.dell.com/FOLDER02950081M/1/Y2R1T_9211_FW.zip?uid=f06bb69a-8c88-4a54-ac7b-ee8826244140&fn=Y2R1T_9211_FW.zip<br />
<br />
2. Extract 6GBPSAS.FW from Y2R1T_9211_FW/Firmware/6GbpsSASHBA_07.03.06.00_A10<br />
<br />
3. Extract 2118it.bin from FY2R1T_9211_FW/Firmware/9211-8i_P7/<br />
<br />
4. Extract sas2flash.efi from Y2R1T_9211_FW/sas2flash/p05/efi/<br />
<br />
5. Place the three extracted files in the P07 folder<br />
<br />
===Step 2 download current firmware===<br />
<br />
1. Extract 2118it.bin from Y2R1T_9211_FW/Firmware/9211-8i/P20/<br />
<br />
2. Download this zip https://docs.broadcom.com/docs-and-downloads/host-bus-adapters/host-bus-adapters-common-files/sas_sata_6g_p20/Installer_P20_for_UEFI.zip<br />
<br />
3. Extract sas2flash.efi from Installer_P20_for_UEFI/sas2flash_efi_ebc_rel/<br />
<br />
4. Place this to extracted files in the P20 folder<br />
<br />
===Step 3 download uefi shell===<br />
1. Download an uefi shell: [https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Obtaining_UEFI_Shell x86_64 UEFI SHELL] I choosed version 1 as it worked for the person in the guide [https://github.com/tianocore/edk2/raw/UDK2018/EdkShellBinPkg/FullShell/X64/Shell_Full.efi Direct download link]<br />
<br />
2. Extract Shell_Full.efi to the root of the memory stick. I had to rename it to Shellx64.efi to use it with my motherboard, asus P8H67_M_EVO. Check with you motherboard vendor to determine how to use efi-shell<br />
<br />
===Step 4 flashing===<br />
<br />
1. boot computer to efi shell<br />
<br />
2. If not present with a list with devices, type <pre>map -b</pre><br />
<br />
2. On my computer the memory stick is called fs0 so I typed fs0: to change prompt to the memory stick<br />
<br />
3. <pre>cd P07</pre><br />
<br />
4. <pre>sas2flash -listall</pre>will show the controller. If not, check if it is installed to a pci-e port<br />
<br />
5. <pre>sas2flash.efi -c 0 -list</pre> will show controller details and take a note of the sas address number<br />
<br />
6. <pre>sas2flash.efi -o -e 6</pre> will erase the old firmware and boot rom<br />
<br />
7. <pre>sas2flash.efi -o -f 6GBPSAS.FW</pre> writes the dell 6gbs firmware<br />
<br />
8. <pre>sas2flash.efi -o -f 2118it.bin</pre> writes the P07 firmware<br />
<br />
9. Then I rebooted<br />
<br />
10. boot into efi again<br />
<br />
11. <pre>cd P20</pre><br />
<br />
12. <pre>sas2flash.efi -o -f 2118it.bin writes the P20 firmware</pre><br />
<br />
===Notes===<br />
Directly copied from the source, step number changed to fit my tutorial:<br />
<br />
1. Step 6 showed “Erasing Flash Region” and then after a while “ERROR: Erase Flash Operation Failed!”. I simply proceeded and the error did not appear to affect anything.<br />
<br />
2. Visit [https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/ source] to get screenshots vit the error messages<br />
<br />
=Compile rtorrent libtorrent and xmlrpc-c=<br />
==libtorrent==<br />
==rtorrent==<br />
./configure --prefix=/usr --with-xmlrpc-c |tee /tmp/conf.log<br />
<br />
=vim=<br />
<br />
# Merk Noe Og Trykk U For Å Få Det I Lowercase, U For Uppercase ;)<br />
# stor v for visual line eller liten for visual der du må merke noe manuelt<br />
# ok. jeg glemte å markere først :p<br />
# oki :)<br />
<br />
# iT'S cAPS lOCK DAY!<br />
<br />
# trykk ~ for å endre fra stor til liten bokstav ;)<br />
<br />
# legg i toppen av dokumentet for å endre inrykk, etc<br />
vim:ts=4:sw=4:sts=4:et:ai<br />
<br />
=grub=<br />
<br />
==Repair GRUB from Windows==<br />
<br />
To repair efi bootloader/grub from windows<br />
<br />
Open powershell as admin and execute the following command<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\{distro}\grubx64.efi</pre><br />
<br />
if you are running debian, it will look like this:<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\debian\grubx64.efi</pre><br />
<br />
==Repair/install GRUB on EFI from live-usb==<br />
<br />
source=https://askubuntu.com/questions/831216/how-can-i-reinstall-grub-to-the-efi-partition/831241#831241<br />
<br />
<pre>mount /dev/sdXY /mnt</pre><br />
<br />
If you have seperatate boot-partition:<br />
<br />
<pre>mount /dev/sdXX /mnt/boot</pre><br />
<br />
and finally mount the efi-partition under boot:<br />
<br />
<pre>mount /dev/sdXZ /mnt/boot/efi/</pre><br />
<br />
Bind-mount some system partitions from the live-system:<br />
<br />
<pre>for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done </pre><br />
<br />
<pre>chroot /mnt</pre><br />
<br />
grub-install --target=x86_64-efi --efi-root=/dev/sdXZ<br />
grub-mkconfig -o /boot/grub/grub.cfg</pre><br />
<br />
NOTE: Note : sdX = disk | sdXX = boot partition | sdXY = system partition | sdXZ = efi partition<br />
<br />
<br />
===Troubleshooting===<br />
<br />
EFI variables are not supported on this system.<br />
<br />
source:https://bbs.archlinux.org/viewtopic.php?pid=1349414#p1349414<br />
<br />
From outside chroot:<br />
<br />
<pre>modprobe efivarfs</pre><br />
<br />
From inside chroot:<br />
<br />
<pre> mount -t efivarfs efivarfs /sys/firmware/efi/efivars</pre><br />
<br />
==Boot Linux from GRUB shell==<br />
<br />
Something went down the alley and you're now stuck in the grub shell, or that's what you think :)<br />
<br />
First we need to figure out what partition our linux root-partition is on<br />
<br />
the command ls will list all disks and partitions<br />
<br />
to find what partition it is on, do:<br />
<br />
<pre>cat (hd0,gpt1)/etc/issue</pre><br />
<br />
do this with the different disksk and partitions until you find one that outputs a line that says something about what Linux flavlour you are running.<br />
On Arch it will look like this:<br />
<br />
<pre>Arch Linux \r (\l)</pre><br />
<br />
So if we say the root partition on Arch Linux was on (hd0,gpt2) you will need to run<br />
<br />
<pre>root=(hd0,gpt2)</pre><br />
<br />
This must be adjusted to fit your system.<br />
<br />
Next we need to tell what kernel we will run and what device (dev) the root-partition ison:<br />
<br />
<pre>linux /boot/vmlinuz root=/dev/nvme0n1p2</pre><br />
<br />
If the root-partion is on a m2-card and is on the second partition on device nvme0n1, do as above.<br />
<br />
Use autocomplete (tab-complete) if you want a more specific kernel-version<br />
<br />
Next we need to choose the initramfs image<br />
<br />
<pre>inird /boot/initramfs.img</pre><br />
<br />
Use tab-complete to find a more specifici version to match a more specicific kernel in the previous step<br />
<br />
Now it's time to boot:<br />
<br />
<pre>boot</pre><br />
<br />
=libvirt=<br />
<br />
==setup new vm from a template==<br />
<br />
If you have a qcow2 vm template, clone it.:<br />
<br />
If you clone a qcow2 in use, stop the vm first:<br />
<br />
<pre>virsh stop {domain-vm-name}</pre><br />
<br />
Then clone the qcow2<br />
<br />
<pre>virt-clone --original {Domain-Vm-Name-Here} --name {New-Domain-Vm-Name-Here} --auto-clone</pre><br />
<br />
Configure your VM to your likings either by virt-manager (gui) or by cli<br />
<br />
Start the new vm and log in, either by ssh, or via virt-manager<br />
<br />
Change hostname to match the new name of the VM<br />
<br />
<pre>sudo -i<br />
vi /etc/hostname</pre><br />
<br />
<br />
<pre>vi /etc/hosts</pre> to match the name of the new VM<br />
<br />
Example. change:<br />
<br />
<pre>127.0.1.1 debian-stretch-mal.debian-stretch-mal.local debian-stretch-mal</pre><br />
<br />
to<br />
<pre>127.0.1.1 new-name-vm.new-name-vm.local new-name-vm</pre><br />
<br />
Also add a line for the ip to the server who runs the VM and for the backup server if you have one, like this<br />
<br />
<pre>192.168.X.X hostname.domain.xx hostname</pre><br />
<br />
<br />
change local ip to a free address<br />
<br />
<pre> vi /etc/network/interfaces</pre><br />
<br />
and add the new ip in on the host <br />
<pre>/etc/hosts</pre><br />
<br />
Make ssh keys:<br />
<br />
<pre>ssh-keygen</pre><br />
go with the defaults by hit enter, when prompted for questions<br />
<br />
copy the the public key from <pre>.ssh/id_rsa.pub</pre><br />
<br />
If bareos is setup on the qcow2 vm template you also need to change the following line in bareos filedaemon config to match your new vm<br />
<br />
<pre>vi /etc/bareos/bareos-fd.conf<br />
<br />
FileDaemon {<br />
Name = new-name-vm.domain.xx-fd </pre><br />
<br />
*sources<br />
https://www.cyberciti.biz/faq/how-to-clone-existing-kvm-virtual-machine-images-on-linux/<br />
<br />
== Batch operations on VMs ==<br />
<br />
<br />
To shut down all running virtual machines, do:<br />
<br />
<pre>for vm in $( virsh list | awk '/running/ { print $2 }' ) ; do virsh shutdown $vm ; done</pre><br />
<br />
To start up all virtual machines from a folder with xml-files representing an individual virtual machine, do:<br />
<br />
<pre>for f in *.xml ; do vm=$( basename $f .xml ) ; virsh start $vm ; done</pre><br />
<br />
=add bareos client=<br />
<br />
If you already have a bareos backup server<br />
<br />
on the new vm or computer you want to backup to bareos<br />
<br />
Install bareos-filedaemon on the client if it's not already installed<br />
<pre> apt install bareos-filedaemon<br />
systemctl enable bareos-filedaemon.service</pre><br />
<br />
<br />
Then log into the bareos server and run bconsole<br />
<br />
<pre>configure add client name=new-name-vm address=192.168.X.X password=SOME_PASSWORD</pre><br />
<br />
Then the config is saved to<br />
<pre>/etc/bareos/bareos-dir-export/client/svennd/bareos-fd.d/director/bareos-dir.conf</pre><br />
<br />
Copy it to the client in:<br />
<pre>/etc/bareos/bareos-fd.d/directory/bareos-dir.conf</pre><br />
<br />
<br />
*sources<br />
https://www.svennd.be/adding-a-linux-client-to-bareos/<br />
<br />
<br />
=IRC=<br />
==Renew ssl cert==<br />
source= https://github.com/ubergeek42/weechat-android/wiki/Using-SSL-with-WeeChat#generating-a-self-signed-certificate=<br />
To create a certificate with a domain:<br />
<br />
<pre>export HOSTNAME=example.org</pre><br />
<br />
From within ~/.weechat/ssl do:<br />
<pre>openssl req -x509 -nodes -newkey rsa:2048 -keyout relay.pem -extensions san_env \<br />
-subj "/O=WeeChat/CN=$HOSTNAME" \<br />
-config <(cat /etc/ssl/openssl.cnf <(printf "\n[ san_env ]\nsubjectAltName=DNS:\${ENV::HOSTNAME}")) \<br />
-days 365 -out relay.pem</pre><br />
<br />
Then within weechat, reload to the new certificate<br />
<br />
<pre>/relay sslcertkey</pre><br />
<br />
=DNS with rndc=<br />
<br />
==Manipulating dns with rndc==<br />
<br />
login to the computer/vm that takes care of DNS<br />
<br />
ZONE=<domain>.<countrycode> ; rndc freeze $ZONE && vi /etc/bind/$ZONE.zone ; rndc thaw $ZONE ; tail -f /var/log/daemon.log<br />
<br />
Do it like this:<br />
<br />
<pre>rndc freeze domain.no</pre><br />
<br />
Edit stuff in open and you can add stuff:<br />
<br />
<pre><text-editor> /etc/bind/domain.no.zone</pre><br />
<br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Example</strong><br />
|-<br />
| If you use the text editor nano it will look like this: <br />
<pre>nano /etc/bind/domain.no.zone</pre><br />
|}<br />
<br />
Edit the file according to this:<br />
<br />
<pre><vm-domain-name-vm> AAAA ipv6-adr<br />
<vm-domain-name-vm> A ipv4-adr<br />
<br />
<vm-domain-name> CNAME <vm-domain-name></pre><br />
<br />
example:<br />
<br />
<pre>test-vm AAAA ipv6-adr<br />
test-vm A ipv4-adr<br />
<br />
test CNAME test-vm</pre><br />
<br />
Don't have same domain on both A/AAAA and CNAME<br />
<br />
Before you save and exit, add serial number to zone-file format: YYYYMMDDxx<br />
<br />
Oneliner to run. change domain.no to your domain<br />
<br />
<pre>rndc freeze domain.no && vi /etc/bind/karlsbakk.net.zone ; rndc thaw domain.no ; tail -f /var/log/daemon.log</pre><br />
<br />
==Local script to run==<br />
<br />
Open the local [https://github.com/rkarlsba/ymse/blob/master/ddns/ddns-update.sh ddns-update.sh] script and add test-vm to VM= variabel if not already present<br />
<br />
If you don't want to wait for the script to run automatically from cron, run it with the force flag<br />
<br />
<pre>ddns-update.sh --force</pre><br />
<br />
==Troubleshooting==<br />
<br />
Ipv4 not updated when address changes<br />
<br />
check if you remembered to thaw the zone<br />
<br />
=SSH=<br />
<br />
==TAB-complete==<br />
<br />
<pre>vi .ssh/config</pre><br />
<br />
Then add lines like this:<br />
<br />
<pre><br />
Host <name> # space between multiple names<br />
user admin # optional if you want to add username to log in with<br />
Hostname <ipaddress>/<domain/hostname><br />
Port 2022 # optional add if port is other than default 22<br />
</pre><br />
<br />
Example <br />
<pre><br />
Host test-vm test<br />
Hostname test-vm.test.no<br />
<br />
</pre><br />
<br />
== postgres ==<br />
https://stackoverflow.com/questions/32439167/psql-could-not-connect-to-server-connection-refused-error-when-connecting-to<br />
<br />
=== backup with restic and file quotes ===<br />
<br />
make a lv or something with a filesystem on it<br />
<br />
in fstab block - mountpoint filesystem defaults,usrquota 0 0</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Malin%27s_notes&diff=416Malin's notes2023-09-17T22:23:01Z<p>Wiki.malinux.no: /* Boot Linux from GRUB shell */</p>
<hr />
<div>==gnu/linux==<br />
<br />
To change ownership of everything that's not already owned by a user<br />
<br />
find /home/rtorrent/ ! -user rtorrent -exec chown rtorrent:rtorrent {} \; &<br />
<br />
==rtl8812AU==<br />
https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git<br />
<br />
remove led-disco<br />
<br />
/etc/modprobe.d/8188eu-blacklist.conf<br />
<br />
options 8812au rtw_led_enable=0<br />
<br />
==LVM==<br />
===[https://blog.raveland.tech/post/rename_vg/ rename Volume Group (VG)]===<br />
<br />
==mdadm==<br />
for dev in $( lsblk | awk '/sd[a-z].*1,8T/ { print }' ); do echo =============================== $dev ============================ ; smartctl -a /dev/$dev ; done | pastebinit<br />
<br />
<br />
<br />
mdadm --remove /dev/md0 failed # all failed devices<br />
<br />
mdadm --remove /dev/md0 detached # failed ones that aren't in /dev anymore<br />
<br />
ip addr add 192.168.0.101/24 dev eth0 ; ip route add default via 192.168.0.1 dev eth0<br />
<br />
<br />
<br />
Mulig rekkefølge med forbehold om at et ikke stemmer, for å endre vg navn på vg med root-partisjon<br />
vgchange gammel-vg ny-vg<br />
vgchange -ay<br />
<br />
endre i /etc/fstab<br />
<br />
grub-install /dev/XxX<br />
<br />
update-initramfs -k all -u<br />
<br />
reboot<br />
<br />
=Crossflash Dell PERC H200 from ir to it-mode=<br />
<br />
==The short answer== <br />
I slightly followed this guide:<br />
<br />
https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/<br />
<br />
The longer answer is. I followed the guide, this way, but did it a little different<br />
<br />
==The longer answer==<br />
<br />
Prepare a usb memory stick formatted as fat32 with two folders called P07 and P20<br />
<br />
===Step 1 download old firmware===<br />
<br />
1. Download this zip archive from dell and unzip it: https://downloads.dell.com/FOLDER02950081M/1/Y2R1T_9211_FW.zip?uid=f06bb69a-8c88-4a54-ac7b-ee8826244140&fn=Y2R1T_9211_FW.zip<br />
<br />
2. Extract 6GBPSAS.FW from Y2R1T_9211_FW/Firmware/6GbpsSASHBA_07.03.06.00_A10<br />
<br />
3. Extract 2118it.bin from FY2R1T_9211_FW/Firmware/9211-8i_P7/<br />
<br />
4. Extract sas2flash.efi from Y2R1T_9211_FW/sas2flash/p05/efi/<br />
<br />
5. Place the three extracted files in the P07 folder<br />
<br />
===Step 2 download current firmware===<br />
<br />
1. Extract 2118it.bin from Y2R1T_9211_FW/Firmware/9211-8i/P20/<br />
<br />
2. Download this zip https://docs.broadcom.com/docs-and-downloads/host-bus-adapters/host-bus-adapters-common-files/sas_sata_6g_p20/Installer_P20_for_UEFI.zip<br />
<br />
3. Extract sas2flash.efi from Installer_P20_for_UEFI/sas2flash_efi_ebc_rel/<br />
<br />
4. Place this to extracted files in the P20 folder<br />
<br />
===Step 3 download uefi shell===<br />
1. Download an uefi shell: [https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Obtaining_UEFI_Shell x86_64 UEFI SHELL] I choosed version 1 as it worked for the person in the guide [https://github.com/tianocore/edk2/raw/UDK2018/EdkShellBinPkg/FullShell/X64/Shell_Full.efi Direct download link]<br />
<br />
2. Extract Shell_Full.efi to the root of the memory stick. I had to rename it to Shellx64.efi to use it with my motherboard, asus P8H67_M_EVO. Check with you motherboard vendor to determine how to use efi-shell<br />
<br />
===Step 4 flashing===<br />
<br />
1. boot computer to efi shell<br />
<br />
2. If not present with a list with devices, type <pre>map -b</pre><br />
<br />
2. On my computer the memory stick is called fs0 so I typed fs0: to change prompt to the memory stick<br />
<br />
3. <pre>cd P07</pre><br />
<br />
4. <pre>sas2flash -listall</pre>will show the controller. If not, check if it is installed to a pci-e port<br />
<br />
5. <pre>sas2flash.efi -c 0 -list</pre> will show controller details and take a note of the sas address number<br />
<br />
6. <pre>sas2flash.efi -o -e 6</pre> will erase the old firmware and boot rom<br />
<br />
7. <pre>sas2flash.efi -o -f 6GBPSAS.FW</pre> writes the dell 6gbs firmware<br />
<br />
8. <pre>sas2flash.efi -o -f 2118it.bin</pre> writes the P07 firmware<br />
<br />
9. Then I rebooted<br />
<br />
10. boot into efi again<br />
<br />
11. <pre>cd P20</pre><br />
<br />
12. <pre>sas2flash.efi -o -f 2118it.bin writes the P20 firmware</pre><br />
<br />
===Notes===<br />
Directly copied from the source, step number changed to fit my tutorial:<br />
<br />
1. Step 6 showed “Erasing Flash Region” and then after a while “ERROR: Erase Flash Operation Failed!”. I simply proceeded and the error did not appear to affect anything.<br />
<br />
2. Visit [https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/ source] to get screenshots vit the error messages<br />
<br />
=Compile rtorrent libtorrent and xmlrpc-c=<br />
==libtorrent==<br />
==rtorrent==<br />
./configure --prefix=/usr --with-xmlrpc-c |tee /tmp/conf.log<br />
<br />
=vim=<br />
<br />
# Merk Noe Og Trykk U For Å Få Det I Lowercase, U For Uppercase ;)<br />
# stor v for visual line eller liten for visual der du må merke noe manuelt<br />
# ok. jeg glemte å markere først :p<br />
# oki :)<br />
<br />
# iT'S cAPS lOCK DAY!<br />
<br />
# trykk ~ for å endre fra stor til liten bokstav ;)<br />
<br />
# legg i toppen av dokumentet for å endre inrykk, etc<br />
vim:ts=4:sw=4:sts=4:et:ai<br />
<br />
=grub=<br />
<br />
==Repair GRUB from Windows==<br />
<br />
To repair efi bootloader/grub from windows<br />
<br />
Open powershell as admin and execute the following command<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\{distro}\grubx64.efi</pre><br />
<br />
if you are running debian, it will look like this:<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\debian\grubx64.efi</pre><br />
<br />
==Repair/install GRUB on EFI from live-usb==<br />
<br />
source=https://askubuntu.com/questions/831216/how-can-i-reinstall-grub-to-the-efi-partition/831241#831241<br />
<br />
<pre>mount /dev/sdXY /mnt</pre><br />
<br />
If you have seperatate boot-partition:<br />
<br />
<pre>mount /dev/sdXX /mnt/boot</pre><br />
<br />
and finally mount the efi-partition under boot:<br />
<br />
<pre>mount /dev/sdXZ /mnt/boot/efi/</pre><br />
<br />
Bind-mount some system partitions from the live-system:<br />
<br />
<pre>for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done </pre><br />
<br />
<pre>chroot /mnt</pre><br />
<br />
grub-install --target=x86_64-efi --efi-root=/dev/sdXZ<br />
grub-mkconfig -o /boot/grub/grub.cfg</pre><br />
<br />
NOTE: Note : sdX = disk | sdXX = boot partition | sdXY = system partition | sdXZ = efi partition<br />
<br />
<br />
===Troubleshooting===<br />
<br />
EFI variables are not supported on this system.<br />
<br />
source:https://bbs.archlinux.org/viewtopic.php?pid=1349414#p1349414<br />
<br />
From outside chroot:<br />
<br />
<pre>modprobe efivarfs</pre><br />
<br />
From inside chroot:<br />
<br />
<pre> mount -t efivarfs efivarfs /sys/firmware/efi/efivars</pre><br />
<br />
==Boot Linux from GRUB shell==<br />
<br />
Something went down the alley and you're now stuck in the grub shell, or that's what you think :)<br />
<br />
First we need to figure out what partition our linux root-partition is on<br />
<br />
the command ls will list all disks and partitions<br />
<br />
to find what partition it is on, do:<br />
<br />
<pre>cat (hd0,gpt1)/etc/issue</pre><br />
<br />
do this with the different disksk and partitions until you find one that outputs a line that says something about what Linux flavlour you are running.<br />
On Arch it will look like this:<br />
<br />
<pre>Arch Linux \r (\l)</pre><br />
<br />
So if we say the root partition on Arch Linux was on (hd0,gpt2) you will need to run<br />
<br />
<pre>root=(hd0,gpt2)</pre><br />
<br />
This must be adjusted to fit your system.<br />
<br />
Next we need to tell what kernel we will run and what device (dev) the root-partition ison:<br />
<br />
<pre>linux /boot/vmlinuz root=/dev/nvme0n1p2</pre><br />
<br />
If the root-partion is on a m2-card and is on the second partition on device nvme0n1, do as above.<br />
<br />
Use autocomplete (tab-complete) if you want a more specific kernel-version<br />
<br />
Next we need to choose the initramfs image<br />
<br />
<pre>inird /boot/initramfs.img</pre><br />
<br />
Use tab-complete to find a more specifici version to match a more specicific kernel in the previous step<br />
<br />
Now it's time to boot:<br />
<br />
<pre>boot</pre><br />
<br />
=libvirt=<br />
<br />
==setup new vm from a template==<br />
<br />
If you have a qcow2 vm template, clone it.:<br />
<br />
If you clone a qcow2 in use, stop the vm first:<br />
<br />
<pre>virsh stop {domain-vm-name}</pre><br />
<br />
Then clone the qcow2<br />
<br />
<pre>virt-clone --original {Domain-Vm-Name-Here} --name {New-Domain-Vm-Name-Here} --auto-clone</pre><br />
<br />
Configure your VM to your likings either by virt-manager (gui) or by cli<br />
<br />
Start the new vm and log in, either by ssh, or via virt-manager<br />
<br />
Change hostname to match the new name of the VM<br />
<br />
<pre>sudo -i<br />
vi /etc/hostname</pre><br />
<br />
<br />
<pre>vi /etc/hosts</pre> to match the name of the new VM<br />
<br />
Example. change:<br />
<br />
<pre>127.0.1.1 debian-stretch-mal.debian-stretch-mal.local debian-stretch-mal</pre><br />
<br />
to<br />
<pre>127.0.1.1 new-name-vm.new-name-vm.local new-name-vm</pre><br />
<br />
Also add a line for the ip to the server who runs the VM and for the backup server if you have one, like this<br />
<br />
<pre>192.168.X.X hostname.domain.xx hostname</pre><br />
<br />
<br />
change local ip to a free address<br />
<br />
<pre> vi /etc/network/interfaces</pre><br />
<br />
and add the new ip in on the host <br />
<pre>/etc/hosts</pre><br />
<br />
Make ssh keys:<br />
<br />
<pre>ssh-keygen</pre><br />
go with the defaults by hit enter, when prompted for questions<br />
<br />
copy the the public key from <pre>.ssh/id_rsa.pub</pre><br />
<br />
If bareos is setup on the qcow2 vm template you also need to change the following line in bareos filedaemon config to match your new vm<br />
<br />
<pre>vi /etc/bareos/bareos-fd.conf<br />
<br />
FileDaemon {<br />
Name = new-name-vm.domain.xx-fd </pre><br />
<br />
*sources<br />
https://www.cyberciti.biz/faq/how-to-clone-existing-kvm-virtual-machine-images-on-linux/<br />
<br />
== Batch operations on VMs ==<br />
<br />
<br />
To shut down all running virtual machines, do:<br />
<br />
<pre>for vm in $( virsh list | awk '/running/ { print $2 }' ) ; do virsh shutdown $vm ; done</pre><br />
<br />
To start up all virtual machines from a folder with xml-files representing an individual virtual machine, do:<br />
<br />
<pre>for f in *.xml ; do vm=$( basename $f .xml ) ; virsh start $vm ; done</pre><br />
<br />
=add bareos client=<br />
<br />
If you already have a bareos backup server<br />
<br />
on the new vm or computer you want to backup to bareos<br />
<br />
Install bareos-filedaemon on the client if it's not already installed<br />
<pre> apt install bareos-filedaemon<br />
systemctl enable bareos-filedaemon.service</pre><br />
<br />
<br />
Then log into the bareos server and run bconsole<br />
<br />
<pre>configure add client name=new-name-vm address=192.168.X.X password=SOME_PASSWORD</pre><br />
<br />
Then the config is saved to<br />
<pre>/etc/bareos/bareos-dir-export/client/svennd/bareos-fd.d/director/bareos-dir.conf</pre><br />
<br />
Copy it to the client in:<br />
<pre>/etc/bareos/bareos-fd.d/directory/bareos-dir.conf</pre><br />
<br />
<br />
*sources<br />
https://www.svennd.be/adding-a-linux-client-to-bareos/<br />
<br />
<br />
=IRC=<br />
==Renew ssl cert==<br />
source= https://github.com/ubergeek42/weechat-android/wiki/Using-SSL-with-WeeChat#generating-a-self-signed-certificate=<br />
To create a certificate with a domain:<br />
<br />
<pre>export HOSTNAME=example.org</pre><br />
<br />
From within ~/.weechat/ssl do:<br />
<pre>openssl req -x509 -nodes -newkey rsa:2048 -keyout relay.pem -extensions san_env \<br />
-subj "/O=WeeChat/CN=$HOSTNAME" \<br />
-config <(cat /etc/ssl/openssl.cnf <(printf "\n[ san_env ]\nsubjectAltName=DNS:\${ENV::HOSTNAME}")) \<br />
-days 365 -out relay.pem</pre><br />
<br />
Then within weechat, reload to the new certificate<br />
<br />
<pre>/relay sslcertkey</pre><br />
<br />
=DNS with rndc=<br />
<br />
==Manipulating dns with rndc==<br />
<br />
login to the computer/vm that takes care of DNS<br />
<br />
ZONE=<domain>.<countrycode> ; rndc freeze $ZONE && vi /etc/bind/$ZONE.zone ; rndc thaw $ZONE ; tail -f /var/log/daemon.log<br />
<br />
Do it like this:<br />
<br />
<pre>rndc freeze domain.no</pre><br />
<br />
Edit stuff in open and you can add stuff:<br />
<br />
<pre><text-editor> /etc/bind/domain.no.zone</pre><br />
<br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Example</strong><br />
|-<br />
| If you use the text editor nano it will look like this: <br />
<pre>nano /etc/bind/domain.no.zone</pre><br />
|}<br />
<br />
Edit the file according to this:<br />
<br />
<pre><vm-domain-name-vm> AAAA ipv6-adr<br />
<vm-domain-name-vm> A ipv4-adr<br />
<br />
<vm-domain-name> CNAME <vm-domain-name></pre><br />
<br />
example:<br />
<br />
<pre>test-vm AAAA ipv6-adr<br />
test-vm A ipv4-adr<br />
<br />
test CNAME test-vm</pre><br />
<br />
Don't have same domain on both A/AAAA and CNAME<br />
<br />
Before you save and exit, add serial number to zone-file format: YYYYMMDDxx<br />
<br />
Oneliner to run. change domain.no to your domain<br />
<br />
<pre>rndc freeze domain.no && vi /etc/bind/karlsbakk.net.zone ; rndc thaw domain.no ; tail -f /var/log/daemon.log</pre><br />
<br />
==Local script to run==<br />
<br />
Open the local [https://github.com/rkarlsba/ymse/blob/master/ddns/ddns-update.sh ddns-update.sh] script and add test-vm to VM= variabel if not already present<br />
<br />
If you don't want to wait for the script to run automatically from cron, run it with the force flag<br />
<br />
<pre>ddns-update.sh --force</pre><br />
<br />
==Troubleshooting==<br />
<br />
Ipv4 not updated when address changes<br />
<br />
check if you remembered to thaw the zone<br />
<br />
=SSH=<br />
<br />
==TAB-complete==<br />
<br />
<pre>vi .ssh/config</pre><br />
<br />
Then add lines like this:<br />
<br />
<pre><br />
Host <name> # space between multiple names<br />
user admin # optional if you want to add username to log in with<br />
Hostname <ipaddress>/<domain/hostname><br />
Port 2022 # optional add if port is other than default 22<br />
</pre><br />
<br />
Example <br />
<pre><br />
Host test-vm test<br />
Hostname test-vm.test.no<br />
<br />
</pre><br />
<br />
== postgres ==<br />
https://stackoverflow.com/questions/32439167/psql-could-not-connect-to-server-connection-refused-error-when-connecting-to</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Malin%27s_notes&diff=415Malin's notes2023-07-24T11:38:08Z<p>Wiki.malinux.no: /* vim */</p>
<hr />
<div>==gnu/linux==<br />
<br />
To change ownership of everything that's not already owned by a user<br />
<br />
find /home/rtorrent/ ! -user rtorrent -exec chown rtorrent:rtorrent {} \; &<br />
<br />
==rtl8812AU==<br />
https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git<br />
<br />
remove led-disco<br />
<br />
/etc/modprobe.d/8188eu-blacklist.conf<br />
<br />
options 8812au rtw_led_enable=0<br />
<br />
==LVM==<br />
===[https://blog.raveland.tech/post/rename_vg/ rename Volume Group (VG)]===<br />
<br />
==mdadm==<br />
for dev in $( lsblk | awk '/sd[a-z].*1,8T/ { print }' ); do echo =============================== $dev ============================ ; smartctl -a /dev/$dev ; done | pastebinit<br />
<br />
<br />
<br />
mdadm --remove /dev/md0 failed # all failed devices<br />
<br />
mdadm --remove /dev/md0 detached # failed ones that aren't in /dev anymore<br />
<br />
ip addr add 192.168.0.101/24 dev eth0 ; ip route add default via 192.168.0.1 dev eth0<br />
<br />
<br />
<br />
Mulig rekkefølge med forbehold om at et ikke stemmer, for å endre vg navn på vg med root-partisjon<br />
vgchange gammel-vg ny-vg<br />
vgchange -ay<br />
<br />
endre i /etc/fstab<br />
<br />
grub-install /dev/XxX<br />
<br />
update-initramfs -k all -u<br />
<br />
reboot<br />
<br />
=Crossflash Dell PERC H200 from ir to it-mode=<br />
<br />
==The short answer== <br />
I slightly followed this guide:<br />
<br />
https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/<br />
<br />
The longer answer is. I followed the guide, this way, but did it a little different<br />
<br />
==The longer answer==<br />
<br />
Prepare a usb memory stick formatted as fat32 with two folders called P07 and P20<br />
<br />
===Step 1 download old firmware===<br />
<br />
1. Download this zip archive from dell and unzip it: https://downloads.dell.com/FOLDER02950081M/1/Y2R1T_9211_FW.zip?uid=f06bb69a-8c88-4a54-ac7b-ee8826244140&fn=Y2R1T_9211_FW.zip<br />
<br />
2. Extract 6GBPSAS.FW from Y2R1T_9211_FW/Firmware/6GbpsSASHBA_07.03.06.00_A10<br />
<br />
3. Extract 2118it.bin from FY2R1T_9211_FW/Firmware/9211-8i_P7/<br />
<br />
4. Extract sas2flash.efi from Y2R1T_9211_FW/sas2flash/p05/efi/<br />
<br />
5. Place the three extracted files in the P07 folder<br />
<br />
===Step 2 download current firmware===<br />
<br />
1. Extract 2118it.bin from Y2R1T_9211_FW/Firmware/9211-8i/P20/<br />
<br />
2. Download this zip https://docs.broadcom.com/docs-and-downloads/host-bus-adapters/host-bus-adapters-common-files/sas_sata_6g_p20/Installer_P20_for_UEFI.zip<br />
<br />
3. Extract sas2flash.efi from Installer_P20_for_UEFI/sas2flash_efi_ebc_rel/<br />
<br />
4. Place this to extracted files in the P20 folder<br />
<br />
===Step 3 download uefi shell===<br />
1. Download an uefi shell: [https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Obtaining_UEFI_Shell x86_64 UEFI SHELL] I choosed version 1 as it worked for the person in the guide [https://github.com/tianocore/edk2/raw/UDK2018/EdkShellBinPkg/FullShell/X64/Shell_Full.efi Direct download link]<br />
<br />
2. Extract Shell_Full.efi to the root of the memory stick. I had to rename it to Shellx64.efi to use it with my motherboard, asus P8H67_M_EVO. Check with you motherboard vendor to determine how to use efi-shell<br />
<br />
===Step 4 flashing===<br />
<br />
1. boot computer to efi shell<br />
<br />
2. If not present with a list with devices, type <pre>map -b</pre><br />
<br />
2. On my computer the memory stick is called fs0 so I typed fs0: to change prompt to the memory stick<br />
<br />
3. <pre>cd P07</pre><br />
<br />
4. <pre>sas2flash -listall</pre>will show the controller. If not, check if it is installed to a pci-e port<br />
<br />
5. <pre>sas2flash.efi -c 0 -list</pre> will show controller details and take a note of the sas address number<br />
<br />
6. <pre>sas2flash.efi -o -e 6</pre> will erase the old firmware and boot rom<br />
<br />
7. <pre>sas2flash.efi -o -f 6GBPSAS.FW</pre> writes the dell 6gbs firmware<br />
<br />
8. <pre>sas2flash.efi -o -f 2118it.bin</pre> writes the P07 firmware<br />
<br />
9. Then I rebooted<br />
<br />
10. boot into efi again<br />
<br />
11. <pre>cd P20</pre><br />
<br />
12. <pre>sas2flash.efi -o -f 2118it.bin writes the P20 firmware</pre><br />
<br />
===Notes===<br />
Directly copied from the source, step number changed to fit my tutorial:<br />
<br />
1. Step 6 showed “Erasing Flash Region” and then after a while “ERROR: Erase Flash Operation Failed!”. I simply proceeded and the error did not appear to affect anything.<br />
<br />
2. Visit [https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/ source] to get screenshots vit the error messages<br />
<br />
=Compile rtorrent libtorrent and xmlrpc-c=<br />
==libtorrent==<br />
==rtorrent==<br />
./configure --prefix=/usr --with-xmlrpc-c |tee /tmp/conf.log<br />
<br />
=vim=<br />
<br />
# Merk Noe Og Trykk U For Å Få Det I Lowercase, U For Uppercase ;)<br />
# stor v for visual line eller liten for visual der du må merke noe manuelt<br />
# ok. jeg glemte å markere først :p<br />
# oki :)<br />
<br />
# iT'S cAPS lOCK DAY!<br />
<br />
# trykk ~ for å endre fra stor til liten bokstav ;)<br />
<br />
# legg i toppen av dokumentet for å endre inrykk, etc<br />
vim:ts=4:sw=4:sts=4:et:ai<br />
<br />
=grub=<br />
<br />
==Repair GRUB from Windows==<br />
<br />
To repair efi bootloader/grub from windows<br />
<br />
Open powershell as admin and execute the following command<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\{distro}\grubx64.efi</pre><br />
<br />
if you are running debian, it will look like this:<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\debian\grubx64.efi</pre><br />
<br />
==Repair/install GRUB on EFI from live-usb==<br />
<br />
source=https://askubuntu.com/questions/831216/how-can-i-reinstall-grub-to-the-efi-partition/831241#831241<br />
<br />
<pre>mount /dev/sdXY /mnt</pre><br />
<br />
If you have seperatate boot-partition:<br />
<br />
<pre>mount /dev/sdXX /mnt/boot</pre><br />
<br />
and finally mount the efi-partition under boot:<br />
<br />
<pre>mount /dev/sdXZ /mnt/boot/efi/</pre><br />
<br />
Bind-mount some system partitions from the live-system:<br />
<br />
<pre>for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done </pre><br />
<br />
<pre>chroot /mnt</pre><br />
<br />
grub-install --target=x86_64-efi --efi-root=/dev/sdXZ<br />
grub-mkconfig -o /boot/grub/grub.cfg</pre><br />
<br />
NOTE: Note : sdX = disk | sdXX = boot partition | sdXY = system partition | sdXZ = efi partition<br />
<br />
<br />
===Troubleshooting===<br />
<br />
EFI variables are not supported on this system.<br />
<br />
source:https://bbs.archlinux.org/viewtopic.php?pid=1349414#p1349414<br />
<br />
From outside chroot:<br />
<br />
<pre>modprobe efivarfs</pre><br />
<br />
From inside chroot:<br />
<br />
<pre> mount -t efivarfs efivarfs /sys/firmware/efi/efivars</pre><br />
<br />
==Boot Linux from GRUB shell==<br />
<br />
Something went down the alley and you're now stuck in the grub shell, or that's what you think :)<br />
<br />
First we need to figure out what partition our linux root-partition is on<br />
<br />
the command ls will list all disks and partitions<br />
<br />
to find what partition it is on, do:<br />
<br />
<pre>ls (hd0,gpt1)/etc/issue</pre><br />
<br />
do this with the different disksk and partitions until you find one that outputs a line that says something about what Linux flavlour you are running.<br />
On Arch it will look like this:<br />
<br />
<pre>Arch Linux \r (\l)</pre><br />
<br />
So if we say the root partition on Arch Linux was on (hd0,gpt2) you will need to run<br />
<br />
<pre>root=(hd0,gpt2)</pre><br />
<br />
This must be adjusted to fit your system.<br />
<br />
Next we need to tell what kernel we will run and what device (dev) the root-partition ison:<br />
<br />
<pre>linux /boot/vmlinuz root=/dev/nvme0n1p2</pre><br />
<br />
If the root-partion is on a m2-card and is on the second partition on device nvme0n1, do as above.<br />
<br />
Use autocomplete (tab-complete) if you want a more specific kernel-version<br />
<br />
Next we need to choose the initramfs image<br />
<br />
<pre>inird /boot/initramfs.img</pre><br />
<br />
Use tab-complete to find a more specifici version to match a more specicific kernel in the previous step<br />
<br />
Now it's time to boot:<br />
<br />
<pre>boot</pre><br />
<br />
=libvirt=<br />
<br />
==setup new vm from a template==<br />
<br />
If you have a qcow2 vm template, clone it.:<br />
<br />
If you clone a qcow2 in use, stop the vm first:<br />
<br />
<pre>virsh stop {domain-vm-name}</pre><br />
<br />
Then clone the qcow2<br />
<br />
<pre>virt-clone --original {Domain-Vm-Name-Here} --name {New-Domain-Vm-Name-Here} --auto-clone</pre><br />
<br />
Configure your VM to your likings either by virt-manager (gui) or by cli<br />
<br />
Start the new vm and log in, either by ssh, or via virt-manager<br />
<br />
Change hostname to match the new name of the VM<br />
<br />
<pre>sudo -i<br />
vi /etc/hostname</pre><br />
<br />
<br />
<pre>vi /etc/hosts</pre> to match the name of the new VM<br />
<br />
Example. change:<br />
<br />
<pre>127.0.1.1 debian-stretch-mal.debian-stretch-mal.local debian-stretch-mal</pre><br />
<br />
to<br />
<pre>127.0.1.1 new-name-vm.new-name-vm.local new-name-vm</pre><br />
<br />
Also add a line for the ip to the server who runs the VM and for the backup server if you have one, like this<br />
<br />
<pre>192.168.X.X hostname.domain.xx hostname</pre><br />
<br />
<br />
change local ip to a free address<br />
<br />
<pre> vi /etc/network/interfaces</pre><br />
<br />
and add the new ip in on the host <br />
<pre>/etc/hosts</pre><br />
<br />
Make ssh keys:<br />
<br />
<pre>ssh-keygen</pre><br />
go with the defaults by hit enter, when prompted for questions<br />
<br />
copy the the public key from <pre>.ssh/id_rsa.pub</pre><br />
<br />
If bareos is setup on the qcow2 vm template you also need to change the following line in bareos filedaemon config to match your new vm<br />
<br />
<pre>vi /etc/bareos/bareos-fd.conf<br />
<br />
FileDaemon {<br />
Name = new-name-vm.domain.xx-fd </pre><br />
<br />
*sources<br />
https://www.cyberciti.biz/faq/how-to-clone-existing-kvm-virtual-machine-images-on-linux/<br />
<br />
== Batch operations on VMs ==<br />
<br />
<br />
To shut down all running virtual machines, do:<br />
<br />
<pre>for vm in $( virsh list | awk '/running/ { print $2 }' ) ; do virsh shutdown $vm ; done</pre><br />
<br />
To start up all virtual machines from a folder with xml-files representing an individual virtual machine, do:<br />
<br />
<pre>for f in *.xml ; do vm=$( basename $f .xml ) ; virsh start $vm ; done</pre><br />
<br />
=add bareos client=<br />
<br />
If you already have a bareos backup server<br />
<br />
on the new vm or computer you want to backup to bareos<br />
<br />
Install bareos-filedaemon on the client if it's not already installed<br />
<pre> apt install bareos-filedaemon<br />
systemctl enable bareos-filedaemon.service</pre><br />
<br />
<br />
Then log into the bareos server and run bconsole<br />
<br />
<pre>configure add client name=new-name-vm address=192.168.X.X password=SOME_PASSWORD</pre><br />
<br />
Then the config is saved to<br />
<pre>/etc/bareos/bareos-dir-export/client/svennd/bareos-fd.d/director/bareos-dir.conf</pre><br />
<br />
Copy it to the client in:<br />
<pre>/etc/bareos/bareos-fd.d/directory/bareos-dir.conf</pre><br />
<br />
<br />
*sources<br />
https://www.svennd.be/adding-a-linux-client-to-bareos/<br />
<br />
<br />
=IRC=<br />
==Renew ssl cert==<br />
source= https://github.com/ubergeek42/weechat-android/wiki/Using-SSL-with-WeeChat#generating-a-self-signed-certificate=<br />
To create a certificate with a domain:<br />
<br />
<pre>export HOSTNAME=example.org</pre><br />
<br />
From within ~/.weechat/ssl do:<br />
<pre>openssl req -x509 -nodes -newkey rsa:2048 -keyout relay.pem -extensions san_env \<br />
-subj "/O=WeeChat/CN=$HOSTNAME" \<br />
-config <(cat /etc/ssl/openssl.cnf <(printf "\n[ san_env ]\nsubjectAltName=DNS:\${ENV::HOSTNAME}")) \<br />
-days 365 -out relay.pem</pre><br />
<br />
Then within weechat, reload to the new certificate<br />
<br />
<pre>/relay sslcertkey</pre><br />
<br />
=DNS with rndc=<br />
<br />
==Manipulating dns with rndc==<br />
<br />
login to the computer/vm that takes care of DNS<br />
<br />
ZONE=<domain>.<countrycode> ; rndc freeze $ZONE && vi /etc/bind/$ZONE.zone ; rndc thaw $ZONE ; tail -f /var/log/daemon.log<br />
<br />
Do it like this:<br />
<br />
<pre>rndc freeze domain.no</pre><br />
<br />
Edit stuff in open and you can add stuff:<br />
<br />
<pre><text-editor> /etc/bind/domain.no.zone</pre><br />
<br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Example</strong><br />
|-<br />
| If you use the text editor nano it will look like this: <br />
<pre>nano /etc/bind/domain.no.zone</pre><br />
|}<br />
<br />
Edit the file according to this:<br />
<br />
<pre><vm-domain-name-vm> AAAA ipv6-adr<br />
<vm-domain-name-vm> A ipv4-adr<br />
<br />
<vm-domain-name> CNAME <vm-domain-name></pre><br />
<br />
example:<br />
<br />
<pre>test-vm AAAA ipv6-adr<br />
test-vm A ipv4-adr<br />
<br />
test CNAME test-vm</pre><br />
<br />
Don't have same domain on both A/AAAA and CNAME<br />
<br />
Before you save and exit, add serial number to zone-file format: YYYYMMDDxx<br />
<br />
Oneliner to run. change domain.no to your domain<br />
<br />
<pre>rndc freeze domain.no && vi /etc/bind/karlsbakk.net.zone ; rndc thaw domain.no ; tail -f /var/log/daemon.log</pre><br />
<br />
==Local script to run==<br />
<br />
Open the local [https://github.com/rkarlsba/ymse/blob/master/ddns/ddns-update.sh ddns-update.sh] script and add test-vm to VM= variabel if not already present<br />
<br />
If you don't want to wait for the script to run automatically from cron, run it with the force flag<br />
<br />
<pre>ddns-update.sh --force</pre><br />
<br />
==Troubleshooting==<br />
<br />
Ipv4 not updated when address changes<br />
<br />
check if you remembered to thaw the zone<br />
<br />
=SSH=<br />
<br />
==TAB-complete==<br />
<br />
<pre>vi .ssh/config</pre><br />
<br />
Then add lines like this:<br />
<br />
<pre><br />
Host <name> # space between multiple names<br />
user admin # optional if you want to add username to log in with<br />
Hostname <ipaddress>/<domain/hostname><br />
Port 2022 # optional add if port is other than default 22<br />
</pre><br />
<br />
Example <br />
<pre><br />
Host test-vm test<br />
Hostname test-vm.test.no<br />
<br />
</pre><br />
<br />
== postgres ==<br />
https://stackoverflow.com/questions/32439167/psql-could-not-connect-to-server-connection-refused-error-when-connecting-to</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Malin%27s_notes&diff=414Malin's notes2023-04-02T21:24:30Z<p>Wiki.malinux.no: /* Batch operations on VMs */</p>
<hr />
<div>==gnu/linux==<br />
<br />
To change ownership of everything that's not already owned by a user<br />
<br />
find /home/rtorrent/ ! -user rtorrent -exec chown rtorrent:rtorrent {} \; &<br />
<br />
==rtl8812AU==<br />
https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git<br />
<br />
remove led-disco<br />
<br />
/etc/modprobe.d/8188eu-blacklist.conf<br />
<br />
options 8812au rtw_led_enable=0<br />
<br />
==LVM==<br />
===[https://blog.raveland.tech/post/rename_vg/ rename Volume Group (VG)]===<br />
<br />
==mdadm==<br />
for dev in $( lsblk | awk '/sd[a-z].*1,8T/ { print }' ); do echo =============================== $dev ============================ ; smartctl -a /dev/$dev ; done | pastebinit<br />
<br />
<br />
<br />
mdadm --remove /dev/md0 failed # all failed devices<br />
<br />
mdadm --remove /dev/md0 detached # failed ones that aren't in /dev anymore<br />
<br />
ip addr add 192.168.0.101/24 dev eth0 ; ip route add default via 192.168.0.1 dev eth0<br />
<br />
<br />
<br />
Mulig rekkefølge med forbehold om at et ikke stemmer, for å endre vg navn på vg med root-partisjon<br />
vgchange gammel-vg ny-vg<br />
vgchange -ay<br />
<br />
endre i /etc/fstab<br />
<br />
grub-install /dev/XxX<br />
<br />
update-initramfs -k all -u<br />
<br />
reboot<br />
<br />
=Crossflash Dell PERC H200 from ir to it-mode=<br />
<br />
==The short answer== <br />
I slightly followed this guide:<br />
<br />
https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/<br />
<br />
The longer answer is. I followed the guide, this way, but did it a little different<br />
<br />
==The longer answer==<br />
<br />
Prepare a usb memory stick formatted as fat32 with two folders called P07 and P20<br />
<br />
===Step 1 download old firmware===<br />
<br />
1. Download this zip archive from dell and unzip it: https://downloads.dell.com/FOLDER02950081M/1/Y2R1T_9211_FW.zip?uid=f06bb69a-8c88-4a54-ac7b-ee8826244140&fn=Y2R1T_9211_FW.zip<br />
<br />
2. Extract 6GBPSAS.FW from Y2R1T_9211_FW/Firmware/6GbpsSASHBA_07.03.06.00_A10<br />
<br />
3. Extract 2118it.bin from FY2R1T_9211_FW/Firmware/9211-8i_P7/<br />
<br />
4. Extract sas2flash.efi from Y2R1T_9211_FW/sas2flash/p05/efi/<br />
<br />
5. Place the three extracted files in the P07 folder<br />
<br />
===Step 2 download current firmware===<br />
<br />
1. Extract 2118it.bin from Y2R1T_9211_FW/Firmware/9211-8i/P20/<br />
<br />
2. Download this zip https://docs.broadcom.com/docs-and-downloads/host-bus-adapters/host-bus-adapters-common-files/sas_sata_6g_p20/Installer_P20_for_UEFI.zip<br />
<br />
3. Extract sas2flash.efi from Installer_P20_for_UEFI/sas2flash_efi_ebc_rel/<br />
<br />
4. Place this to extracted files in the P20 folder<br />
<br />
===Step 3 download uefi shell===<br />
1. Download an uefi shell: [https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Obtaining_UEFI_Shell x86_64 UEFI SHELL] I choosed version 1 as it worked for the person in the guide [https://github.com/tianocore/edk2/raw/UDK2018/EdkShellBinPkg/FullShell/X64/Shell_Full.efi Direct download link]<br />
<br />
2. Extract Shell_Full.efi to the root of the memory stick. I had to rename it to Shellx64.efi to use it with my motherboard, asus P8H67_M_EVO. Check with you motherboard vendor to determine how to use efi-shell<br />
<br />
===Step 4 flashing===<br />
<br />
1. boot computer to efi shell<br />
<br />
2. If not present with a list with devices, type <pre>map -b</pre><br />
<br />
2. On my computer the memory stick is called fs0 so I typed fs0: to change prompt to the memory stick<br />
<br />
3. <pre>cd P07</pre><br />
<br />
4. <pre>sas2flash -listall</pre>will show the controller. If not, check if it is installed to a pci-e port<br />
<br />
5. <pre>sas2flash.efi -c 0 -list</pre> will show controller details and take a note of the sas address number<br />
<br />
6. <pre>sas2flash.efi -o -e 6</pre> will erase the old firmware and boot rom<br />
<br />
7. <pre>sas2flash.efi -o -f 6GBPSAS.FW</pre> writes the dell 6gbs firmware<br />
<br />
8. <pre>sas2flash.efi -o -f 2118it.bin</pre> writes the P07 firmware<br />
<br />
9. Then I rebooted<br />
<br />
10. boot into efi again<br />
<br />
11. <pre>cd P20</pre><br />
<br />
12. <pre>sas2flash.efi -o -f 2118it.bin writes the P20 firmware</pre><br />
<br />
===Notes===<br />
Directly copied from the source, step number changed to fit my tutorial:<br />
<br />
1. Step 6 showed “Erasing Flash Region” and then after a while “ERROR: Erase Flash Operation Failed!”. I simply proceeded and the error did not appear to affect anything.<br />
<br />
2. Visit [https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/ source] to get screenshots vit the error messages<br />
<br />
=Compile rtorrent libtorrent and xmlrpc-c=<br />
==libtorrent==<br />
==rtorrent==<br />
./configure --prefix=/usr --with-xmlrpc-c |tee /tmp/conf.log<br />
<br />
=vim=<br />
<br />
# Merk Noe Og Trykk U For Å Få Det I Lowercase, U For Uppercase ;)<br />
# stor v for visual line eller liten for visual der du må merke noe manuelt<br />
# ok. jeg glemte å markere først :p<br />
# oki :)<br />
<br />
# iT'S cAPS lOCK DAY!<br />
<br />
# trykk ~ for å endre fra stor til liten bokstav ;)<br />
<br />
=grub=<br />
<br />
==Repair GRUB from Windows==<br />
<br />
To repair efi bootloader/grub from windows<br />
<br />
Open powershell as admin and execute the following command<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\{distro}\grubx64.efi</pre><br />
<br />
if you are running debian, it will look like this:<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\debian\grubx64.efi</pre><br />
<br />
==Repair/install GRUB on EFI from live-usb==<br />
<br />
source=https://askubuntu.com/questions/831216/how-can-i-reinstall-grub-to-the-efi-partition/831241#831241<br />
<br />
<pre>mount /dev/sdXY /mnt</pre><br />
<br />
If you have seperatate boot-partition:<br />
<br />
<pre>mount /dev/sdXX /mnt/boot</pre><br />
<br />
and finally mount the efi-partition under boot:<br />
<br />
<pre>mount /dev/sdXZ /mnt/boot/efi/</pre><br />
<br />
Bind-mount some system partitions from the live-system:<br />
<br />
<pre>for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done </pre><br />
<br />
<pre>chroot /mnt</pre><br />
<br />
grub-install --target=x86_64-efi --efi-root=/dev/sdXZ<br />
grub-mkconfig -o /boot/grub/grub.cfg</pre><br />
<br />
NOTE: Note : sdX = disk | sdXX = boot partition | sdXY = system partition | sdXZ = efi partition<br />
<br />
<br />
===Troubleshooting===<br />
<br />
EFI variables are not supported on this system.<br />
<br />
source:https://bbs.archlinux.org/viewtopic.php?pid=1349414#p1349414<br />
<br />
From outside chroot:<br />
<br />
<pre>modprobe efivarfs</pre><br />
<br />
From inside chroot:<br />
<br />
<pre> mount -t efivarfs efivarfs /sys/firmware/efi/efivars</pre><br />
<br />
==Boot Linux from GRUB shell==<br />
<br />
Something went down the alley and you're now stuck in the grub shell, or that's what you think :)<br />
<br />
First we need to figure out what partition our linux root-partition is on<br />
<br />
the command ls will list all disks and partitions<br />
<br />
to find what partition it is on, do:<br />
<br />
<pre>ls (hd0,gpt1)/etc/issue</pre><br />
<br />
do this with the different disksk and partitions until you find one that outputs a line that says something about what Linux flavlour you are running.<br />
On Arch it will look like this:<br />
<br />
<pre>Arch Linux \r (\l)</pre><br />
<br />
So if we say the root partition on Arch Linux was on (hd0,gpt2) you will need to run<br />
<br />
<pre>root=(hd0,gpt2)</pre><br />
<br />
This must be adjusted to fit your system.<br />
<br />
Next we need to tell what kernel we will run and what device (dev) the root-partition ison:<br />
<br />
<pre>linux /boot/vmlinuz root=/dev/nvme0n1p2</pre><br />
<br />
If the root-partion is on a m2-card and is on the second partition on device nvme0n1, do as above.<br />
<br />
Use autocomplete (tab-complete) if you want a more specific kernel-version<br />
<br />
Next we need to choose the initramfs image<br />
<br />
<pre>inird /boot/initramfs.img</pre><br />
<br />
Use tab-complete to find a more specifici version to match a more specicific kernel in the previous step<br />
<br />
Now it's time to boot:<br />
<br />
<pre>boot</pre><br />
<br />
=libvirt=<br />
<br />
==setup new vm from a template==<br />
<br />
If you have a qcow2 vm template, clone it.:<br />
<br />
If you clone a qcow2 in use, stop the vm first:<br />
<br />
<pre>virsh stop {domain-vm-name}</pre><br />
<br />
Then clone the qcow2<br />
<br />
<pre>virt-clone --original {Domain-Vm-Name-Here} --name {New-Domain-Vm-Name-Here} --auto-clone</pre><br />
<br />
Configure your VM to your likings either by virt-manager (gui) or by cli<br />
<br />
Start the new vm and log in, either by ssh, or via virt-manager<br />
<br />
Change hostname to match the new name of the VM<br />
<br />
<pre>sudo -i<br />
vi /etc/hostname</pre><br />
<br />
<br />
<pre>vi /etc/hosts</pre> to match the name of the new VM<br />
<br />
Example. change:<br />
<br />
<pre>127.0.1.1 debian-stretch-mal.debian-stretch-mal.local debian-stretch-mal</pre><br />
<br />
to<br />
<pre>127.0.1.1 new-name-vm.new-name-vm.local new-name-vm</pre><br />
<br />
Also add a line for the ip to the server who runs the VM and for the backup server if you have one, like this<br />
<br />
<pre>192.168.X.X hostname.domain.xx hostname</pre><br />
<br />
<br />
change local ip to a free address<br />
<br />
<pre> vi /etc/network/interfaces</pre><br />
<br />
and add the new ip in on the host <br />
<pre>/etc/hosts</pre><br />
<br />
Make ssh keys:<br />
<br />
<pre>ssh-keygen</pre><br />
go with the defaults by hit enter, when prompted for questions<br />
<br />
copy the the public key from <pre>.ssh/id_rsa.pub</pre><br />
<br />
If bareos is setup on the qcow2 vm template you also need to change the following line in bareos filedaemon config to match your new vm<br />
<br />
<pre>vi /etc/bareos/bareos-fd.conf<br />
<br />
FileDaemon {<br />
Name = new-name-vm.domain.xx-fd </pre><br />
<br />
*sources<br />
https://www.cyberciti.biz/faq/how-to-clone-existing-kvm-virtual-machine-images-on-linux/<br />
<br />
== Batch operations on VMs ==<br />
<br />
<br />
To shut down all running virtual machines, do:<br />
<br />
<pre>for vm in $( virsh list | awk '/running/ { print $2 }' ) ; do virsh shutdown $vm ; done</pre><br />
<br />
To start up all virtual machines from a folder with xml-files representing an individual virtual machine, do:<br />
<br />
<pre>for f in *.xml ; do vm=$( basename $f .xml ) ; virsh start $vm ; done</pre><br />
<br />
=add bareos client=<br />
<br />
If you already have a bareos backup server<br />
<br />
on the new vm or computer you want to backup to bareos<br />
<br />
Install bareos-filedaemon on the client if it's not already installed<br />
<pre> apt install bareos-filedaemon<br />
systemctl enable bareos-filedaemon.service</pre><br />
<br />
<br />
Then log into the bareos server and run bconsole<br />
<br />
<pre>configure add client name=new-name-vm address=192.168.X.X password=SOME_PASSWORD</pre><br />
<br />
Then the config is saved to<br />
<pre>/etc/bareos/bareos-dir-export/client/svennd/bareos-fd.d/director/bareos-dir.conf</pre><br />
<br />
Copy it to the client in:<br />
<pre>/etc/bareos/bareos-fd.d/directory/bareos-dir.conf</pre><br />
<br />
<br />
*sources<br />
https://www.svennd.be/adding-a-linux-client-to-bareos/<br />
<br />
<br />
=IRC=<br />
==Renew ssl cert==<br />
source= https://github.com/ubergeek42/weechat-android/wiki/Using-SSL-with-WeeChat#generating-a-self-signed-certificate=<br />
To create a certificate with a domain:<br />
<br />
<pre>export HOSTNAME=example.org</pre><br />
<br />
From within ~/.weechat/ssl do:<br />
<pre>openssl req -x509 -nodes -newkey rsa:2048 -keyout relay.pem -extensions san_env \<br />
-subj "/O=WeeChat/CN=$HOSTNAME" \<br />
-config <(cat /etc/ssl/openssl.cnf <(printf "\n[ san_env ]\nsubjectAltName=DNS:\${ENV::HOSTNAME}")) \<br />
-days 365 -out relay.pem</pre><br />
<br />
Then within weechat, reload to the new certificate<br />
<br />
<pre>/relay sslcertkey</pre><br />
<br />
=DNS with rndc=<br />
<br />
==Manipulating dns with rndc==<br />
<br />
login to the computer/vm that takes care of DNS<br />
<br />
ZONE=<domain>.<countrycode> ; rndc freeze $ZONE && vi /etc/bind/$ZONE.zone ; rndc thaw $ZONE ; tail -f /var/log/daemon.log<br />
<br />
Do it like this:<br />
<br />
<pre>rndc freeze domain.no</pre><br />
<br />
Edit stuff in open and you can add stuff:<br />
<br />
<pre><text-editor> /etc/bind/domain.no.zone</pre><br />
<br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Example</strong><br />
|-<br />
| If you use the text editor nano it will look like this: <br />
<pre>nano /etc/bind/domain.no.zone</pre><br />
|}<br />
<br />
Edit the file according to this:<br />
<br />
<pre><vm-domain-name-vm> AAAA ipv6-adr<br />
<vm-domain-name-vm> A ipv4-adr<br />
<br />
<vm-domain-name> CNAME <vm-domain-name></pre><br />
<br />
example:<br />
<br />
<pre>test-vm AAAA ipv6-adr<br />
test-vm A ipv4-adr<br />
<br />
test CNAME test-vm</pre><br />
<br />
Don't have same domain on both A/AAAA and CNAME<br />
<br />
Before you save and exit, add serial number to zone-file format: YYYYMMDDxx<br />
<br />
Oneliner to run. change domain.no to your domain<br />
<br />
<pre>rndc freeze domain.no && vi /etc/bind/karlsbakk.net.zone ; rndc thaw domain.no ; tail -f /var/log/daemon.log</pre><br />
<br />
==Local script to run==<br />
<br />
Open the local [https://github.com/rkarlsba/ymse/blob/master/ddns/ddns-update.sh ddns-update.sh] script and add test-vm to VM= variabel if not already present<br />
<br />
If you don't want to wait for the script to run automatically from cron, run it with the force flag<br />
<br />
<pre>ddns-update.sh --force</pre><br />
<br />
==Troubleshooting==<br />
<br />
Ipv4 not updated when address changes<br />
<br />
check if you remembered to thaw the zone<br />
<br />
=SSH=<br />
<br />
==TAB-complete==<br />
<br />
<pre>vi .ssh/config</pre><br />
<br />
Then add lines like this:<br />
<br />
<pre><br />
Host <name> # space between multiple names<br />
user admin # optional if you want to add username to log in with<br />
Hostname <ipaddress>/<domain/hostname><br />
Port 2022 # optional add if port is other than default 22<br />
</pre><br />
<br />
Example <br />
<pre><br />
Host test-vm test<br />
Hostname test-vm.test.no<br />
<br />
</pre><br />
<br />
== postgres ==<br />
https://stackoverflow.com/questions/32439167/psql-could-not-connect-to-server-connection-refused-error-when-connecting-to</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Malin%27s_notes&diff=413Malin's notes2023-03-31T22:10:38Z<p>Wiki.malinux.no: /* libvirt */</p>
<hr />
<div>==gnu/linux==<br />
<br />
To change ownership of everything that's not already owned by a user<br />
<br />
find /home/rtorrent/ ! -user rtorrent -exec chown rtorrent:rtorrent {} \; &<br />
<br />
==rtl8812AU==<br />
https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git<br />
<br />
remove led-disco<br />
<br />
/etc/modprobe.d/8188eu-blacklist.conf<br />
<br />
options 8812au rtw_led_enable=0<br />
<br />
==LVM==<br />
===[https://blog.raveland.tech/post/rename_vg/ rename Volume Group (VG)]===<br />
<br />
==mdadm==<br />
for dev in $( lsblk | awk '/sd[a-z].*1,8T/ { print }' ); do echo =============================== $dev ============================ ; smartctl -a /dev/$dev ; done | pastebinit<br />
<br />
<br />
<br />
mdadm --remove /dev/md0 failed # all failed devices<br />
<br />
mdadm --remove /dev/md0 detached # failed ones that aren't in /dev anymore<br />
<br />
ip addr add 192.168.0.101/24 dev eth0 ; ip route add default via 192.168.0.1 dev eth0<br />
<br />
<br />
<br />
Mulig rekkefølge med forbehold om at et ikke stemmer, for å endre vg navn på vg med root-partisjon<br />
vgchange gammel-vg ny-vg<br />
vgchange -ay<br />
<br />
endre i /etc/fstab<br />
<br />
grub-install /dev/XxX<br />
<br />
update-initramfs -k all -u<br />
<br />
reboot<br />
<br />
=Crossflash Dell PERC H200 from ir to it-mode=<br />
<br />
==The short answer== <br />
I slightly followed this guide:<br />
<br />
https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/<br />
<br />
The longer answer is. I followed the guide, this way, but did it a little different<br />
<br />
==The longer answer==<br />
<br />
Prepare a usb memory stick formatted as fat32 with two folders called P07 and P20<br />
<br />
===Step 1 download old firmware===<br />
<br />
1. Download this zip archive from dell and unzip it: https://downloads.dell.com/FOLDER02950081M/1/Y2R1T_9211_FW.zip?uid=f06bb69a-8c88-4a54-ac7b-ee8826244140&fn=Y2R1T_9211_FW.zip<br />
<br />
2. Extract 6GBPSAS.FW from Y2R1T_9211_FW/Firmware/6GbpsSASHBA_07.03.06.00_A10<br />
<br />
3. Extract 2118it.bin from FY2R1T_9211_FW/Firmware/9211-8i_P7/<br />
<br />
4. Extract sas2flash.efi from Y2R1T_9211_FW/sas2flash/p05/efi/<br />
<br />
5. Place the three extracted files in the P07 folder<br />
<br />
===Step 2 download current firmware===<br />
<br />
1. Extract 2118it.bin from Y2R1T_9211_FW/Firmware/9211-8i/P20/<br />
<br />
2. Download this zip https://docs.broadcom.com/docs-and-downloads/host-bus-adapters/host-bus-adapters-common-files/sas_sata_6g_p20/Installer_P20_for_UEFI.zip<br />
<br />
3. Extract sas2flash.efi from Installer_P20_for_UEFI/sas2flash_efi_ebc_rel/<br />
<br />
4. Place this to extracted files in the P20 folder<br />
<br />
===Step 3 download uefi shell===<br />
1. Download an uefi shell: [https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Obtaining_UEFI_Shell x86_64 UEFI SHELL] I choosed version 1 as it worked for the person in the guide [https://github.com/tianocore/edk2/raw/UDK2018/EdkShellBinPkg/FullShell/X64/Shell_Full.efi Direct download link]<br />
<br />
2. Extract Shell_Full.efi to the root of the memory stick. I had to rename it to Shellx64.efi to use it with my motherboard, asus P8H67_M_EVO. Check with you motherboard vendor to determine how to use efi-shell<br />
<br />
===Step 4 flashing===<br />
<br />
1. boot computer to efi shell<br />
<br />
2. If not present with a list with devices, type <pre>map -b</pre><br />
<br />
2. On my computer the memory stick is called fs0 so I typed fs0: to change prompt to the memory stick<br />
<br />
3. <pre>cd P07</pre><br />
<br />
4. <pre>sas2flash -listall</pre>will show the controller. If not, check if it is installed to a pci-e port<br />
<br />
5. <pre>sas2flash.efi -c 0 -list</pre> will show controller details and take a note of the sas address number<br />
<br />
6. <pre>sas2flash.efi -o -e 6</pre> will erase the old firmware and boot rom<br />
<br />
7. <pre>sas2flash.efi -o -f 6GBPSAS.FW</pre> writes the dell 6gbs firmware<br />
<br />
8. <pre>sas2flash.efi -o -f 2118it.bin</pre> writes the P07 firmware<br />
<br />
9. Then I rebooted<br />
<br />
10. boot into efi again<br />
<br />
11. <pre>cd P20</pre><br />
<br />
12. <pre>sas2flash.efi -o -f 2118it.bin writes the P20 firmware</pre><br />
<br />
===Notes===<br />
Directly copied from the source, step number changed to fit my tutorial:<br />
<br />
1. Step 6 showed “Erasing Flash Region” and then after a while “ERROR: Erase Flash Operation Failed!”. I simply proceeded and the error did not appear to affect anything.<br />
<br />
2. Visit [https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/ source] to get screenshots vit the error messages<br />
<br />
=Compile rtorrent libtorrent and xmlrpc-c=<br />
==libtorrent==<br />
==rtorrent==<br />
./configure --prefix=/usr --with-xmlrpc-c |tee /tmp/conf.log<br />
<br />
=vim=<br />
<br />
# Merk Noe Og Trykk U For Å Få Det I Lowercase, U For Uppercase ;)<br />
# stor v for visual line eller liten for visual der du må merke noe manuelt<br />
# ok. jeg glemte å markere først :p<br />
# oki :)<br />
<br />
# iT'S cAPS lOCK DAY!<br />
<br />
# trykk ~ for å endre fra stor til liten bokstav ;)<br />
<br />
=grub=<br />
<br />
==Repair GRUB from Windows==<br />
<br />
To repair efi bootloader/grub from windows<br />
<br />
Open powershell as admin and execute the following command<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\{distro}\grubx64.efi</pre><br />
<br />
if you are running debian, it will look like this:<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\debian\grubx64.efi</pre><br />
<br />
==Repair/install GRUB on EFI from live-usb==<br />
<br />
source=https://askubuntu.com/questions/831216/how-can-i-reinstall-grub-to-the-efi-partition/831241#831241<br />
<br />
<pre>mount /dev/sdXY /mnt</pre><br />
<br />
If you have seperatate boot-partition:<br />
<br />
<pre>mount /dev/sdXX /mnt/boot</pre><br />
<br />
and finally mount the efi-partition under boot:<br />
<br />
<pre>mount /dev/sdXZ /mnt/boot/efi/</pre><br />
<br />
Bind-mount some system partitions from the live-system:<br />
<br />
<pre>for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done </pre><br />
<br />
<pre>chroot /mnt</pre><br />
<br />
grub-install --target=x86_64-efi --efi-root=/dev/sdXZ<br />
grub-mkconfig -o /boot/grub/grub.cfg</pre><br />
<br />
NOTE: Note : sdX = disk | sdXX = boot partition | sdXY = system partition | sdXZ = efi partition<br />
<br />
<br />
===Troubleshooting===<br />
<br />
EFI variables are not supported on this system.<br />
<br />
source:https://bbs.archlinux.org/viewtopic.php?pid=1349414#p1349414<br />
<br />
From outside chroot:<br />
<br />
<pre>modprobe efivarfs</pre><br />
<br />
From inside chroot:<br />
<br />
<pre> mount -t efivarfs efivarfs /sys/firmware/efi/efivars</pre><br />
<br />
==Boot Linux from GRUB shell==<br />
<br />
Something went down the alley and you're now stuck in the grub shell, or that's what you think :)<br />
<br />
First we need to figure out what partition our linux root-partition is on<br />
<br />
the command ls will list all disks and partitions<br />
<br />
to find what partition it is on, do:<br />
<br />
<pre>ls (hd0,gpt1)/etc/issue</pre><br />
<br />
do this with the different disksk and partitions until you find one that outputs a line that says something about what Linux flavlour you are running.<br />
On Arch it will look like this:<br />
<br />
<pre>Arch Linux \r (\l)</pre><br />
<br />
So if we say the root partition on Arch Linux was on (hd0,gpt2) you will need to run<br />
<br />
<pre>root=(hd0,gpt2)</pre><br />
<br />
This must be adjusted to fit your system.<br />
<br />
Next we need to tell what kernel we will run and what device (dev) the root-partition ison:<br />
<br />
<pre>linux /boot/vmlinuz root=/dev/nvme0n1p2</pre><br />
<br />
If the root-partion is on a m2-card and is on the second partition on device nvme0n1, do as above.<br />
<br />
Use autocomplete (tab-complete) if you want a more specific kernel-version<br />
<br />
Next we need to choose the initramfs image<br />
<br />
<pre>inird /boot/initramfs.img</pre><br />
<br />
Use tab-complete to find a more specifici version to match a more specicific kernel in the previous step<br />
<br />
Now it's time to boot:<br />
<br />
<pre>boot</pre><br />
<br />
=libvirt=<br />
<br />
==setup new vm from a template==<br />
<br />
If you have a qcow2 vm template, clone it.:<br />
<br />
If you clone a qcow2 in use, stop the vm first:<br />
<br />
<pre>virsh stop {domain-vm-name}</pre><br />
<br />
Then clone the qcow2<br />
<br />
<pre>virt-clone --original {Domain-Vm-Name-Here} --name {New-Domain-Vm-Name-Here} --auto-clone</pre><br />
<br />
Configure your VM to your likings either by virt-manager (gui) or by cli<br />
<br />
Start the new vm and log in, either by ssh, or via virt-manager<br />
<br />
Change hostname to match the new name of the VM<br />
<br />
<pre>sudo -i<br />
vi /etc/hostname</pre><br />
<br />
<br />
<pre>vi /etc/hosts</pre> to match the name of the new VM<br />
<br />
Example. change:<br />
<br />
<pre>127.0.1.1 debian-stretch-mal.debian-stretch-mal.local debian-stretch-mal</pre><br />
<br />
to<br />
<pre>127.0.1.1 new-name-vm.new-name-vm.local new-name-vm</pre><br />
<br />
Also add a line for the ip to the server who runs the VM and for the backup server if you have one, like this<br />
<br />
<pre>192.168.X.X hostname.domain.xx hostname</pre><br />
<br />
<br />
change local ip to a free address<br />
<br />
<pre> vi /etc/network/interfaces</pre><br />
<br />
and add the new ip in on the host <br />
<pre>/etc/hosts</pre><br />
<br />
Make ssh keys:<br />
<br />
<pre>ssh-keygen</pre><br />
go with the defaults by hit enter, when prompted for questions<br />
<br />
copy the the public key from <pre>.ssh/id_rsa.pub</pre><br />
<br />
If bareos is setup on the qcow2 vm template you also need to change the following line in bareos filedaemon config to match your new vm<br />
<br />
<pre>vi /etc/bareos/bareos-fd.conf<br />
<br />
FileDaemon {<br />
Name = new-name-vm.domain.xx-fd </pre><br />
<br />
*sources<br />
https://www.cyberciti.biz/faq/how-to-clone-existing-kvm-virtual-machine-images-on-linux/<br />
<br />
== Batch operations on VMs ==<br />
<br />
<br />
To shut down all running virtual machines, do:<br />
<br />
<pre>for vm in $( virsh list | awk '/running/ { print $2 }' ) ; do virsh shutdown $vm ; donFor vm in $( virsh list | awk '/running/ { print $2 }' ) ; do virsh shutdown $vm ; done</pre><br />
<br />
To start up all virtual machines from a folder with xml-files representing an individual virtual machine, do:<br />
<br />
<pre>for f in *.xml ; do vm=$( basename $f .xml ) ; virsh start $vm ; done</pre><br />
<br />
=add bareos client=<br />
<br />
If you already have a bareos backup server<br />
<br />
on the new vm or computer you want to backup to bareos<br />
<br />
Install bareos-filedaemon on the client if it's not already installed<br />
<pre> apt install bareos-filedaemon<br />
systemctl enable bareos-filedaemon.service</pre><br />
<br />
<br />
Then log into the bareos server and run bconsole<br />
<br />
<pre>configure add client name=new-name-vm address=192.168.X.X password=SOME_PASSWORD</pre><br />
<br />
Then the config is saved to<br />
<pre>/etc/bareos/bareos-dir-export/client/svennd/bareos-fd.d/director/bareos-dir.conf</pre><br />
<br />
Copy it to the client in:<br />
<pre>/etc/bareos/bareos-fd.d/directory/bareos-dir.conf</pre><br />
<br />
<br />
*sources<br />
https://www.svennd.be/adding-a-linux-client-to-bareos/<br />
<br />
<br />
=IRC=<br />
==Renew ssl cert==<br />
source= https://github.com/ubergeek42/weechat-android/wiki/Using-SSL-with-WeeChat#generating-a-self-signed-certificate=<br />
To create a certificate with a domain:<br />
<br />
<pre>export HOSTNAME=example.org</pre><br />
<br />
From within ~/.weechat/ssl do:<br />
<pre>openssl req -x509 -nodes -newkey rsa:2048 -keyout relay.pem -extensions san_env \<br />
-subj "/O=WeeChat/CN=$HOSTNAME" \<br />
-config <(cat /etc/ssl/openssl.cnf <(printf "\n[ san_env ]\nsubjectAltName=DNS:\${ENV::HOSTNAME}")) \<br />
-days 365 -out relay.pem</pre><br />
<br />
Then within weechat, reload to the new certificate<br />
<br />
<pre>/relay sslcertkey</pre><br />
<br />
=DNS with rndc=<br />
<br />
==Manipulating dns with rndc==<br />
<br />
login to the computer/vm that takes care of DNS<br />
<br />
ZONE=<domain>.<countrycode> ; rndc freeze $ZONE && vi /etc/bind/$ZONE.zone ; rndc thaw $ZONE ; tail -f /var/log/daemon.log<br />
<br />
Do it like this:<br />
<br />
<pre>rndc freeze domain.no</pre><br />
<br />
Edit stuff in open and you can add stuff:<br />
<br />
<pre><text-editor> /etc/bind/domain.no.zone</pre><br />
<br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Example</strong><br />
|-<br />
| If you use the text editor nano it will look like this: <br />
<pre>nano /etc/bind/domain.no.zone</pre><br />
|}<br />
<br />
Edit the file according to this:<br />
<br />
<pre><vm-domain-name-vm> AAAA ipv6-adr<br />
<vm-domain-name-vm> A ipv4-adr<br />
<br />
<vm-domain-name> CNAME <vm-domain-name></pre><br />
<br />
example:<br />
<br />
<pre>test-vm AAAA ipv6-adr<br />
test-vm A ipv4-adr<br />
<br />
test CNAME test-vm</pre><br />
<br />
Don't have same domain on both A/AAAA and CNAME<br />
<br />
Before you save and exit, add serial number to zone-file format: YYYYMMDDxx<br />
<br />
Oneliner to run. change domain.no to your domain<br />
<br />
<pre>rndc freeze domain.no && vi /etc/bind/karlsbakk.net.zone ; rndc thaw domain.no ; tail -f /var/log/daemon.log</pre><br />
<br />
==Local script to run==<br />
<br />
Open the local [https://github.com/rkarlsba/ymse/blob/master/ddns/ddns-update.sh ddns-update.sh] script and add test-vm to VM= variabel if not already present<br />
<br />
If you don't want to wait for the script to run automatically from cron, run it with the force flag<br />
<br />
<pre>ddns-update.sh --force</pre><br />
<br />
==Troubleshooting==<br />
<br />
Ipv4 not updated when address changes<br />
<br />
check if you remembered to thaw the zone<br />
<br />
=SSH=<br />
<br />
==TAB-complete==<br />
<br />
<pre>vi .ssh/config</pre><br />
<br />
Then add lines like this:<br />
<br />
<pre><br />
Host <name> # space between multiple names<br />
user admin # optional if you want to add username to log in with<br />
Hostname <ipaddress>/<domain/hostname><br />
Port 2022 # optional add if port is other than default 22<br />
</pre><br />
<br />
Example <br />
<pre><br />
Host test-vm test<br />
Hostname test-vm.test.no<br />
<br />
</pre><br />
<br />
== postgres ==<br />
https://stackoverflow.com/questions/32439167/psql-could-not-connect-to-server-connection-refused-error-when-connecting-to</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Malin%27s_notes&diff=412Malin's notes2023-03-31T22:09:14Z<p>Wiki.malinux.no: /* libvirt */</p>
<hr />
<div>==gnu/linux==<br />
<br />
To change ownership of everything that's not already owned by a user<br />
<br />
find /home/rtorrent/ ! -user rtorrent -exec chown rtorrent:rtorrent {} \; &<br />
<br />
==rtl8812AU==<br />
https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git<br />
<br />
remove led-disco<br />
<br />
/etc/modprobe.d/8188eu-blacklist.conf<br />
<br />
options 8812au rtw_led_enable=0<br />
<br />
==LVM==<br />
===[https://blog.raveland.tech/post/rename_vg/ rename Volume Group (VG)]===<br />
<br />
==mdadm==<br />
for dev in $( lsblk | awk '/sd[a-z].*1,8T/ { print }' ); do echo =============================== $dev ============================ ; smartctl -a /dev/$dev ; done | pastebinit<br />
<br />
<br />
<br />
mdadm --remove /dev/md0 failed # all failed devices<br />
<br />
mdadm --remove /dev/md0 detached # failed ones that aren't in /dev anymore<br />
<br />
ip addr add 192.168.0.101/24 dev eth0 ; ip route add default via 192.168.0.1 dev eth0<br />
<br />
<br />
<br />
Mulig rekkefølge med forbehold om at et ikke stemmer, for å endre vg navn på vg med root-partisjon<br />
vgchange gammel-vg ny-vg<br />
vgchange -ay<br />
<br />
endre i /etc/fstab<br />
<br />
grub-install /dev/XxX<br />
<br />
update-initramfs -k all -u<br />
<br />
reboot<br />
<br />
=Crossflash Dell PERC H200 from ir to it-mode=<br />
<br />
==The short answer== <br />
I slightly followed this guide:<br />
<br />
https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/<br />
<br />
The longer answer is. I followed the guide, this way, but did it a little different<br />
<br />
==The longer answer==<br />
<br />
Prepare a usb memory stick formatted as fat32 with two folders called P07 and P20<br />
<br />
===Step 1 download old firmware===<br />
<br />
1. Download this zip archive from dell and unzip it: https://downloads.dell.com/FOLDER02950081M/1/Y2R1T_9211_FW.zip?uid=f06bb69a-8c88-4a54-ac7b-ee8826244140&fn=Y2R1T_9211_FW.zip<br />
<br />
2. Extract 6GBPSAS.FW from Y2R1T_9211_FW/Firmware/6GbpsSASHBA_07.03.06.00_A10<br />
<br />
3. Extract 2118it.bin from FY2R1T_9211_FW/Firmware/9211-8i_P7/<br />
<br />
4. Extract sas2flash.efi from Y2R1T_9211_FW/sas2flash/p05/efi/<br />
<br />
5. Place the three extracted files in the P07 folder<br />
<br />
===Step 2 download current firmware===<br />
<br />
1. Extract 2118it.bin from Y2R1T_9211_FW/Firmware/9211-8i/P20/<br />
<br />
2. Download this zip https://docs.broadcom.com/docs-and-downloads/host-bus-adapters/host-bus-adapters-common-files/sas_sata_6g_p20/Installer_P20_for_UEFI.zip<br />
<br />
3. Extract sas2flash.efi from Installer_P20_for_UEFI/sas2flash_efi_ebc_rel/<br />
<br />
4. Place this to extracted files in the P20 folder<br />
<br />
===Step 3 download uefi shell===<br />
1. Download an uefi shell: [https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Obtaining_UEFI_Shell x86_64 UEFI SHELL] I choosed version 1 as it worked for the person in the guide [https://github.com/tianocore/edk2/raw/UDK2018/EdkShellBinPkg/FullShell/X64/Shell_Full.efi Direct download link]<br />
<br />
2. Extract Shell_Full.efi to the root of the memory stick. I had to rename it to Shellx64.efi to use it with my motherboard, asus P8H67_M_EVO. Check with you motherboard vendor to determine how to use efi-shell<br />
<br />
===Step 4 flashing===<br />
<br />
1. boot computer to efi shell<br />
<br />
2. If not present with a list with devices, type <pre>map -b</pre><br />
<br />
2. On my computer the memory stick is called fs0 so I typed fs0: to change prompt to the memory stick<br />
<br />
3. <pre>cd P07</pre><br />
<br />
4. <pre>sas2flash -listall</pre>will show the controller. If not, check if it is installed to a pci-e port<br />
<br />
5. <pre>sas2flash.efi -c 0 -list</pre> will show controller details and take a note of the sas address number<br />
<br />
6. <pre>sas2flash.efi -o -e 6</pre> will erase the old firmware and boot rom<br />
<br />
7. <pre>sas2flash.efi -o -f 6GBPSAS.FW</pre> writes the dell 6gbs firmware<br />
<br />
8. <pre>sas2flash.efi -o -f 2118it.bin</pre> writes the P07 firmware<br />
<br />
9. Then I rebooted<br />
<br />
10. boot into efi again<br />
<br />
11. <pre>cd P20</pre><br />
<br />
12. <pre>sas2flash.efi -o -f 2118it.bin writes the P20 firmware</pre><br />
<br />
===Notes===<br />
Directly copied from the source, step number changed to fit my tutorial:<br />
<br />
1. Step 6 showed “Erasing Flash Region” and then after a while “ERROR: Erase Flash Operation Failed!”. I simply proceeded and the error did not appear to affect anything.<br />
<br />
2. Visit [https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/ source] to get screenshots vit the error messages<br />
<br />
=Compile rtorrent libtorrent and xmlrpc-c=<br />
==libtorrent==<br />
==rtorrent==<br />
./configure --prefix=/usr --with-xmlrpc-c |tee /tmp/conf.log<br />
<br />
=vim=<br />
<br />
# Merk Noe Og Trykk U For Å Få Det I Lowercase, U For Uppercase ;)<br />
# stor v for visual line eller liten for visual der du må merke noe manuelt<br />
# ok. jeg glemte å markere først :p<br />
# oki :)<br />
<br />
# iT'S cAPS lOCK DAY!<br />
<br />
# trykk ~ for å endre fra stor til liten bokstav ;)<br />
<br />
=grub=<br />
<br />
==Repair GRUB from Windows==<br />
<br />
To repair efi bootloader/grub from windows<br />
<br />
Open powershell as admin and execute the following command<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\{distro}\grubx64.efi</pre><br />
<br />
if you are running debian, it will look like this:<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\debian\grubx64.efi</pre><br />
<br />
==Repair/install GRUB on EFI from live-usb==<br />
<br />
source=https://askubuntu.com/questions/831216/how-can-i-reinstall-grub-to-the-efi-partition/831241#831241<br />
<br />
<pre>mount /dev/sdXY /mnt</pre><br />
<br />
If you have seperatate boot-partition:<br />
<br />
<pre>mount /dev/sdXX /mnt/boot</pre><br />
<br />
and finally mount the efi-partition under boot:<br />
<br />
<pre>mount /dev/sdXZ /mnt/boot/efi/</pre><br />
<br />
Bind-mount some system partitions from the live-system:<br />
<br />
<pre>for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done </pre><br />
<br />
<pre>chroot /mnt</pre><br />
<br />
grub-install --target=x86_64-efi --efi-root=/dev/sdXZ<br />
grub-mkconfig -o /boot/grub/grub.cfg</pre><br />
<br />
NOTE: Note : sdX = disk | sdXX = boot partition | sdXY = system partition | sdXZ = efi partition<br />
<br />
<br />
===Troubleshooting===<br />
<br />
EFI variables are not supported on this system.<br />
<br />
source:https://bbs.archlinux.org/viewtopic.php?pid=1349414#p1349414<br />
<br />
From outside chroot:<br />
<br />
<pre>modprobe efivarfs</pre><br />
<br />
From inside chroot:<br />
<br />
<pre> mount -t efivarfs efivarfs /sys/firmware/efi/efivars</pre><br />
<br />
==Boot Linux from GRUB shell==<br />
<br />
Something went down the alley and you're now stuck in the grub shell, or that's what you think :)<br />
<br />
First we need to figure out what partition our linux root-partition is on<br />
<br />
the command ls will list all disks and partitions<br />
<br />
to find what partition it is on, do:<br />
<br />
<pre>ls (hd0,gpt1)/etc/issue</pre><br />
<br />
do this with the different disksk and partitions until you find one that outputs a line that says something about what Linux flavlour you are running.<br />
On Arch it will look like this:<br />
<br />
<pre>Arch Linux \r (\l)</pre><br />
<br />
So if we say the root partition on Arch Linux was on (hd0,gpt2) you will need to run<br />
<br />
<pre>root=(hd0,gpt2)</pre><br />
<br />
This must be adjusted to fit your system.<br />
<br />
Next we need to tell what kernel we will run and what device (dev) the root-partition ison:<br />
<br />
<pre>linux /boot/vmlinuz root=/dev/nvme0n1p2</pre><br />
<br />
If the root-partion is on a m2-card and is on the second partition on device nvme0n1, do as above.<br />
<br />
Use autocomplete (tab-complete) if you want a more specific kernel-version<br />
<br />
Next we need to choose the initramfs image<br />
<br />
<pre>inird /boot/initramfs.img</pre><br />
<br />
Use tab-complete to find a more specifici version to match a more specicific kernel in the previous step<br />
<br />
Now it's time to boot:<br />
<br />
<pre>boot</pre><br />
<br />
=libvirt=<br />
<br />
==setup new vm from a template==<br />
<br />
If you have a qcow2 vm template, clone it.:<br />
<br />
If you clone a qcow2 in use, stop the vm first:<br />
<br />
<pre>virsh stop {domain-vm-name}</pre><br />
<br />
Then clone the qcow2<br />
<br />
<pre>virt-clone --original {Domain-Vm-Name-Here} --name {New-Domain-Vm-Name-Here} --auto-clone</pre><br />
<br />
Configure your VM to your likings either by virt-manager (gui) or by cli<br />
<br />
Start the new vm and log in, either by ssh, or via virt-manager<br />
<br />
Change hostname to match the new name of the VM<br />
<br />
<pre>sudo -i<br />
vi /etc/hostname</pre><br />
<br />
<br />
<pre>vi /etc/hosts</pre> to match the name of the new VM<br />
<br />
Example. change:<br />
<br />
<pre>127.0.1.1 debian-stretch-mal.debian-stretch-mal.local debian-stretch-mal</pre><br />
<br />
to<br />
<pre>127.0.1.1 new-name-vm.new-name-vm.local new-name-vm</pre><br />
<br />
Also add a line for the ip to the server who runs the VM and for the backup server if you have one, like this<br />
<br />
<pre>192.168.X.X hostname.domain.xx hostname</pre><br />
<br />
<br />
change local ip to a free address<br />
<br />
<pre> vi /etc/network/interfaces</pre><br />
<br />
and add the new ip in on the host <br />
<pre>/etc/hosts</pre><br />
<br />
Make ssh keys:<br />
<br />
<pre>ssh-keygen</pre><br />
go with the defaults by hit enter, when prompted for questions<br />
<br />
copy the the public key from <pre>.ssh/id_rsa.pub</pre><br />
<br />
If bareos is setup on the qcow2 vm template you also need to change the following line in bareos filedaemon config to match your new vm<br />
<br />
<pre>vi /etc/bareos/bareos-fd.conf<br />
<br />
FileDaemon {<br />
Name = new-name-vm.domain.xx-fd </pre><br />
<br />
*sources<br />
https://www.cyberciti.biz/faq/how-to-clone-existing-kvm-virtual-machine-images-on-linux/<br />
<br />
=== Batch operations on VMs ===<br />
<br />
<br />
To shut down all running virtual machines, do:<br />
<br />
<pre>for vm in $( virsh list | awk '/running/ { print $2 }' ) ; do virsh shutdown $vm ; donFor vm in $( virsh list | awk '/running/ { print $2 }' ) ; do virsh shutdown $vm ; done</pre><br />
<br />
To start up all virtual machines from a folder with xml-files representing an individual virtual machine, do:<br />
<br />
<pre>for f in *.xml ; do vm=$( basename $f .xml ) ; virsh start $vm ; done</pre><br />
<br />
=add bareos client=<br />
<br />
If you already have a bareos backup server<br />
<br />
on the new vm or computer you want to backup to bareos<br />
<br />
Install bareos-filedaemon on the client if it's not already installed<br />
<pre> apt install bareos-filedaemon<br />
systemctl enable bareos-filedaemon.service</pre><br />
<br />
<br />
Then log into the bareos server and run bconsole<br />
<br />
<pre>configure add client name=new-name-vm address=192.168.X.X password=SOME_PASSWORD</pre><br />
<br />
Then the config is saved to<br />
<pre>/etc/bareos/bareos-dir-export/client/svennd/bareos-fd.d/director/bareos-dir.conf</pre><br />
<br />
Copy it to the client in:<br />
<pre>/etc/bareos/bareos-fd.d/directory/bareos-dir.conf</pre><br />
<br />
<br />
*sources<br />
https://www.svennd.be/adding-a-linux-client-to-bareos/<br />
<br />
<br />
=IRC=<br />
==Renew ssl cert==<br />
source= https://github.com/ubergeek42/weechat-android/wiki/Using-SSL-with-WeeChat#generating-a-self-signed-certificate=<br />
To create a certificate with a domain:<br />
<br />
<pre>export HOSTNAME=example.org</pre><br />
<br />
From within ~/.weechat/ssl do:<br />
<pre>openssl req -x509 -nodes -newkey rsa:2048 -keyout relay.pem -extensions san_env \<br />
-subj "/O=WeeChat/CN=$HOSTNAME" \<br />
-config <(cat /etc/ssl/openssl.cnf <(printf "\n[ san_env ]\nsubjectAltName=DNS:\${ENV::HOSTNAME}")) \<br />
-days 365 -out relay.pem</pre><br />
<br />
Then within weechat, reload to the new certificate<br />
<br />
<pre>/relay sslcertkey</pre><br />
<br />
=DNS with rndc=<br />
<br />
==Manipulating dns with rndc==<br />
<br />
login to the computer/vm that takes care of DNS<br />
<br />
ZONE=<domain>.<countrycode> ; rndc freeze $ZONE && vi /etc/bind/$ZONE.zone ; rndc thaw $ZONE ; tail -f /var/log/daemon.log<br />
<br />
Do it like this:<br />
<br />
<pre>rndc freeze domain.no</pre><br />
<br />
Edit stuff in open and you can add stuff:<br />
<br />
<pre><text-editor> /etc/bind/domain.no.zone</pre><br />
<br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Example</strong><br />
|-<br />
| If you use the text editor nano it will look like this: <br />
<pre>nano /etc/bind/domain.no.zone</pre><br />
|}<br />
<br />
Edit the file according to this:<br />
<br />
<pre><vm-domain-name-vm> AAAA ipv6-adr<br />
<vm-domain-name-vm> A ipv4-adr<br />
<br />
<vm-domain-name> CNAME <vm-domain-name></pre><br />
<br />
example:<br />
<br />
<pre>test-vm AAAA ipv6-adr<br />
test-vm A ipv4-adr<br />
<br />
test CNAME test-vm</pre><br />
<br />
Don't have same domain on both A/AAAA and CNAME<br />
<br />
Before you save and exit, add serial number to zone-file format: YYYYMMDDxx<br />
<br />
Oneliner to run. change domain.no to your domain<br />
<br />
<pre>rndc freeze domain.no && vi /etc/bind/karlsbakk.net.zone ; rndc thaw domain.no ; tail -f /var/log/daemon.log</pre><br />
<br />
==Local script to run==<br />
<br />
Open the local [https://github.com/rkarlsba/ymse/blob/master/ddns/ddns-update.sh ddns-update.sh] script and add test-vm to VM= variabel if not already present<br />
<br />
If you don't want to wait for the script to run automatically from cron, run it with the force flag<br />
<br />
<pre>ddns-update.sh --force</pre><br />
<br />
==Troubleshooting==<br />
<br />
Ipv4 not updated when address changes<br />
<br />
check if you remembered to thaw the zone<br />
<br />
=SSH=<br />
<br />
==TAB-complete==<br />
<br />
<pre>vi .ssh/config</pre><br />
<br />
Then add lines like this:<br />
<br />
<pre><br />
Host <name> # space between multiple names<br />
user admin # optional if you want to add username to log in with<br />
Hostname <ipaddress>/<domain/hostname><br />
Port 2022 # optional add if port is other than default 22<br />
</pre><br />
<br />
Example <br />
<pre><br />
Host test-vm test<br />
Hostname test-vm.test.no<br />
<br />
</pre><br />
<br />
== postgres ==<br />
https://stackoverflow.com/questions/32439167/psql-could-not-connect-to-server-connection-refused-error-when-connecting-to</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Malin%27s_notes&diff=411Malin's notes2023-02-16T19:06:55Z<p>Wiki.malinux.no: /* grub */</p>
<hr />
<div>==gnu/linux==<br />
<br />
To change ownership of everything that's not already owned by a user<br />
<br />
find /home/rtorrent/ ! -user rtorrent -exec chown rtorrent:rtorrent {} \; &<br />
<br />
==rtl8812AU==<br />
https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git<br />
<br />
remove led-disco<br />
<br />
/etc/modprobe.d/8188eu-blacklist.conf<br />
<br />
options 8812au rtw_led_enable=0<br />
<br />
==LVM==<br />
===[https://blog.raveland.tech/post/rename_vg/ rename Volume Group (VG)]===<br />
<br />
==mdadm==<br />
for dev in $( lsblk | awk '/sd[a-z].*1,8T/ { print }' ); do echo =============================== $dev ============================ ; smartctl -a /dev/$dev ; done | pastebinit<br />
<br />
<br />
<br />
mdadm --remove /dev/md0 failed # all failed devices<br />
<br />
mdadm --remove /dev/md0 detached # failed ones that aren't in /dev anymore<br />
<br />
ip addr add 192.168.0.101/24 dev eth0 ; ip route add default via 192.168.0.1 dev eth0<br />
<br />
<br />
<br />
Mulig rekkefølge med forbehold om at et ikke stemmer, for å endre vg navn på vg med root-partisjon<br />
vgchange gammel-vg ny-vg<br />
vgchange -ay<br />
<br />
endre i /etc/fstab<br />
<br />
grub-install /dev/XxX<br />
<br />
update-initramfs -k all -u<br />
<br />
reboot<br />
<br />
=Crossflash Dell PERC H200 from ir to it-mode=<br />
<br />
==The short answer== <br />
I slightly followed this guide:<br />
<br />
https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/<br />
<br />
The longer answer is. I followed the guide, this way, but did it a little different<br />
<br />
==The longer answer==<br />
<br />
Prepare a usb memory stick formatted as fat32 with two folders called P07 and P20<br />
<br />
===Step 1 download old firmware===<br />
<br />
1. Download this zip archive from dell and unzip it: https://downloads.dell.com/FOLDER02950081M/1/Y2R1T_9211_FW.zip?uid=f06bb69a-8c88-4a54-ac7b-ee8826244140&fn=Y2R1T_9211_FW.zip<br />
<br />
2. Extract 6GBPSAS.FW from Y2R1T_9211_FW/Firmware/6GbpsSASHBA_07.03.06.00_A10<br />
<br />
3. Extract 2118it.bin from FY2R1T_9211_FW/Firmware/9211-8i_P7/<br />
<br />
4. Extract sas2flash.efi from Y2R1T_9211_FW/sas2flash/p05/efi/<br />
<br />
5. Place the three extracted files in the P07 folder<br />
<br />
===Step 2 download current firmware===<br />
<br />
1. Extract 2118it.bin from Y2R1T_9211_FW/Firmware/9211-8i/P20/<br />
<br />
2. Download this zip https://docs.broadcom.com/docs-and-downloads/host-bus-adapters/host-bus-adapters-common-files/sas_sata_6g_p20/Installer_P20_for_UEFI.zip<br />
<br />
3. Extract sas2flash.efi from Installer_P20_for_UEFI/sas2flash_efi_ebc_rel/<br />
<br />
4. Place this to extracted files in the P20 folder<br />
<br />
===Step 3 download uefi shell===<br />
1. Download an uefi shell: [https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Obtaining_UEFI_Shell x86_64 UEFI SHELL] I choosed version 1 as it worked for the person in the guide [https://github.com/tianocore/edk2/raw/UDK2018/EdkShellBinPkg/FullShell/X64/Shell_Full.efi Direct download link]<br />
<br />
2. Extract Shell_Full.efi to the root of the memory stick. I had to rename it to Shellx64.efi to use it with my motherboard, asus P8H67_M_EVO. Check with you motherboard vendor to determine how to use efi-shell<br />
<br />
===Step 4 flashing===<br />
<br />
1. boot computer to efi shell<br />
<br />
2. If not present with a list with devices, type <pre>map -b</pre><br />
<br />
2. On my computer the memory stick is called fs0 so I typed fs0: to change prompt to the memory stick<br />
<br />
3. <pre>cd P07</pre><br />
<br />
4. <pre>sas2flash -listall</pre>will show the controller. If not, check if it is installed to a pci-e port<br />
<br />
5. <pre>sas2flash.efi -c 0 -list</pre> will show controller details and take a note of the sas address number<br />
<br />
6. <pre>sas2flash.efi -o -e 6</pre> will erase the old firmware and boot rom<br />
<br />
7. <pre>sas2flash.efi -o -f 6GBPSAS.FW</pre> writes the dell 6gbs firmware<br />
<br />
8. <pre>sas2flash.efi -o -f 2118it.bin</pre> writes the P07 firmware<br />
<br />
9. Then I rebooted<br />
<br />
10. boot into efi again<br />
<br />
11. <pre>cd P20</pre><br />
<br />
12. <pre>sas2flash.efi -o -f 2118it.bin writes the P20 firmware</pre><br />
<br />
===Notes===<br />
Directly copied from the source, step number changed to fit my tutorial:<br />
<br />
1. Step 6 showed “Erasing Flash Region” and then after a while “ERROR: Erase Flash Operation Failed!”. I simply proceeded and the error did not appear to affect anything.<br />
<br />
2. Visit [https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/ source] to get screenshots vit the error messages<br />
<br />
=Compile rtorrent libtorrent and xmlrpc-c=<br />
==libtorrent==<br />
==rtorrent==<br />
./configure --prefix=/usr --with-xmlrpc-c |tee /tmp/conf.log<br />
<br />
=vim=<br />
<br />
# Merk Noe Og Trykk U For Å Få Det I Lowercase, U For Uppercase ;)<br />
# stor v for visual line eller liten for visual der du må merke noe manuelt<br />
# ok. jeg glemte å markere først :p<br />
# oki :)<br />
<br />
# iT'S cAPS lOCK DAY!<br />
<br />
# trykk ~ for å endre fra stor til liten bokstav ;)<br />
<br />
=grub=<br />
<br />
==Repair GRUB from Windows==<br />
<br />
To repair efi bootloader/grub from windows<br />
<br />
Open powershell as admin and execute the following command<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\{distro}\grubx64.efi</pre><br />
<br />
if you are running debian, it will look like this:<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\debian\grubx64.efi</pre><br />
<br />
==Repair/install GRUB on EFI from live-usb==<br />
<br />
source=https://askubuntu.com/questions/831216/how-can-i-reinstall-grub-to-the-efi-partition/831241#831241<br />
<br />
<pre>mount /dev/sdXY /mnt</pre><br />
<br />
If you have seperatate boot-partition:<br />
<br />
<pre>mount /dev/sdXX /mnt/boot</pre><br />
<br />
and finally mount the efi-partition under boot:<br />
<br />
<pre>mount /dev/sdXZ /mnt/boot/efi/</pre><br />
<br />
Bind-mount some system partitions from the live-system:<br />
<br />
<pre>for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done </pre><br />
<br />
<pre>chroot /mnt</pre><br />
<br />
grub-install --target=x86_64-efi --efi-root=/dev/sdXZ<br />
grub-mkconfig -o /boot/grub/grub.cfg</pre><br />
<br />
NOTE: Note : sdX = disk | sdXX = boot partition | sdXY = system partition | sdXZ = efi partition<br />
<br />
<br />
===Troubleshooting===<br />
<br />
EFI variables are not supported on this system.<br />
<br />
source:https://bbs.archlinux.org/viewtopic.php?pid=1349414#p1349414<br />
<br />
From outside chroot:<br />
<br />
<pre>modprobe efivarfs</pre><br />
<br />
From inside chroot:<br />
<br />
<pre> mount -t efivarfs efivarfs /sys/firmware/efi/efivars</pre><br />
<br />
==Boot Linux from GRUB shell==<br />
<br />
Something went down the alley and you're now stuck in the grub shell, or that's what you think :)<br />
<br />
First we need to figure out what partition our linux root-partition is on<br />
<br />
the command ls will list all disks and partitions<br />
<br />
to find what partition it is on, do:<br />
<br />
<pre>ls (hd0,gpt1)/etc/issue</pre><br />
<br />
do this with the different disksk and partitions until you find one that outputs a line that says something about what Linux flavlour you are running.<br />
On Arch it will look like this:<br />
<br />
<pre>Arch Linux \r (\l)</pre><br />
<br />
So if we say the root partition on Arch Linux was on (hd0,gpt2) you will need to run<br />
<br />
<pre>root=(hd0,gpt2)</pre><br />
<br />
This must be adjusted to fit your system.<br />
<br />
Next we need to tell what kernel we will run and what device (dev) the root-partition ison:<br />
<br />
<pre>linux /boot/vmlinuz root=/dev/nvme0n1p2</pre><br />
<br />
If the root-partion is on a m2-card and is on the second partition on device nvme0n1, do as above.<br />
<br />
Use autocomplete (tab-complete) if you want a more specific kernel-version<br />
<br />
Next we need to choose the initramfs image<br />
<br />
<pre>inird /boot/initramfs.img</pre><br />
<br />
Use tab-complete to find a more specifici version to match a more specicific kernel in the previous step<br />
<br />
Now it's time to boot:<br />
<br />
<pre>boot</pre><br />
<br />
=libvirt=<br />
<br />
==setup new vm from a template==<br />
<br />
If you have a qcow2 vm template, clone it.:<br />
<br />
If you clone a qcow2 in use, stop the vm first:<br />
<br />
<pre>virsh stop {domain-vm-name}</pre><br />
<br />
Then clone the qcow2<br />
<br />
<pre>virt-clone --original {Domain-Vm-Name-Here} --name {New-Domain-Vm-Name-Here} --auto-clone</pre><br />
<br />
Configure your VM to your likings either by virt-manager (gui) or by cli<br />
<br />
Start the new vm and log in, either by ssh, or via virt-manager<br />
<br />
Change hostname to match the new name of the VM<br />
<br />
<pre>sudo -i<br />
vi /etc/hostname</pre><br />
<br />
<br />
<pre>vi /etc/hosts</pre> to match the name of the new VM<br />
<br />
Example. change:<br />
<br />
<pre>127.0.1.1 debian-stretch-mal.debian-stretch-mal.local debian-stretch-mal</pre><br />
<br />
to<br />
<pre>127.0.1.1 new-name-vm.new-name-vm.local new-name-vm</pre><br />
<br />
Also add a line for the ip to the server who runs the VM and for the backup server if you have one, like this<br />
<br />
<pre>192.168.X.X hostname.domain.xx hostname</pre><br />
<br />
<br />
change local ip to a free address<br />
<br />
<pre> vi /etc/network/interfaces</pre><br />
<br />
and add the new ip in on the host <br />
<pre>/etc/hosts</pre><br />
<br />
Make ssh keys:<br />
<br />
<pre>ssh-keygen</pre><br />
go with the defaults by hit enter, when prompted for questions<br />
<br />
copy the the public key from <pre>.ssh/id_rsa.pub</pre><br />
<br />
If bareos is setup on the qcow2 vm template you also need to change the following line in bareos filedaemon config to match your new vm<br />
<br />
<pre>vi /etc/bareos/bareos-fd.conf<br />
<br />
FileDaemon {<br />
Name = new-name-vm.domain.xx-fd </pre><br />
<br />
*sources<br />
https://www.cyberciti.biz/faq/how-to-clone-existing-kvm-virtual-machine-images-on-linux/<br />
<br />
=add bareos client=<br />
<br />
If you already have a bareos backup server<br />
<br />
on the new vm or computer you want to backup to bareos<br />
<br />
Install bareos-filedaemon on the client if it's not already installed<br />
<pre> apt install bareos-filedaemon<br />
systemctl enable bareos-filedaemon.service</pre><br />
<br />
<br />
Then log into the bareos server and run bconsole<br />
<br />
<pre>configure add client name=new-name-vm address=192.168.X.X password=SOME_PASSWORD</pre><br />
<br />
Then the config is saved to<br />
<pre>/etc/bareos/bareos-dir-export/client/svennd/bareos-fd.d/director/bareos-dir.conf</pre><br />
<br />
Copy it to the client in:<br />
<pre>/etc/bareos/bareos-fd.d/directory/bareos-dir.conf</pre><br />
<br />
<br />
*sources<br />
https://www.svennd.be/adding-a-linux-client-to-bareos/<br />
<br />
<br />
=IRC=<br />
==Renew ssl cert==<br />
source= https://github.com/ubergeek42/weechat-android/wiki/Using-SSL-with-WeeChat#generating-a-self-signed-certificate=<br />
To create a certificate with a domain:<br />
<br />
<pre>export HOSTNAME=example.org</pre><br />
<br />
From within ~/.weechat/ssl do:<br />
<pre>openssl req -x509 -nodes -newkey rsa:2048 -keyout relay.pem -extensions san_env \<br />
-subj "/O=WeeChat/CN=$HOSTNAME" \<br />
-config <(cat /etc/ssl/openssl.cnf <(printf "\n[ san_env ]\nsubjectAltName=DNS:\${ENV::HOSTNAME}")) \<br />
-days 365 -out relay.pem</pre><br />
<br />
Then within weechat, reload to the new certificate<br />
<br />
<pre>/relay sslcertkey</pre><br />
<br />
=DNS with rndc=<br />
<br />
==Manipulating dns with rndc==<br />
<br />
login to the computer/vm that takes care of DNS<br />
<br />
ZONE=<domain>.<countrycode> ; rndc freeze $ZONE && vi /etc/bind/$ZONE.zone ; rndc thaw $ZONE ; tail -f /var/log/daemon.log<br />
<br />
Do it like this:<br />
<br />
<pre>rndc freeze domain.no</pre><br />
<br />
Edit stuff in open and you can add stuff:<br />
<br />
<pre><text-editor> /etc/bind/domain.no.zone</pre><br />
<br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Example</strong><br />
|-<br />
| If you use the text editor nano it will look like this: <br />
<pre>nano /etc/bind/domain.no.zone</pre><br />
|}<br />
<br />
Edit the file according to this:<br />
<br />
<pre><vm-domain-name-vm> AAAA ipv6-adr<br />
<vm-domain-name-vm> A ipv4-adr<br />
<br />
<vm-domain-name> CNAME <vm-domain-name></pre><br />
<br />
example:<br />
<br />
<pre>test-vm AAAA ipv6-adr<br />
test-vm A ipv4-adr<br />
<br />
test CNAME test-vm</pre><br />
<br />
Don't have same domain on both A/AAAA and CNAME<br />
<br />
Before you save and exit, add serial number to zone-file format: YYYYMMDDxx<br />
<br />
Oneliner to run. change domain.no to your domain<br />
<br />
<pre>rndc freeze domain.no && vi /etc/bind/karlsbakk.net.zone ; rndc thaw domain.no ; tail -f /var/log/daemon.log</pre><br />
<br />
==Local script to run==<br />
<br />
Open the local [https://github.com/rkarlsba/ymse/blob/master/ddns/ddns-update.sh ddns-update.sh] script and add test-vm to VM= variabel if not already present<br />
<br />
If you don't want to wait for the script to run automatically from cron, run it with the force flag<br />
<br />
<pre>ddns-update.sh --force</pre><br />
<br />
==Troubleshooting==<br />
<br />
Ipv4 not updated when address changes<br />
<br />
check if you remembered to thaw the zone<br />
<br />
=SSH=<br />
<br />
==TAB-complete==<br />
<br />
<pre>vi .ssh/config</pre><br />
<br />
Then add lines like this:<br />
<br />
<pre><br />
Host <name> # space between multiple names<br />
user admin # optional if you want to add username to log in with<br />
Hostname <ipaddress>/<domain/hostname><br />
Port 2022 # optional add if port is other than default 22<br />
</pre><br />
<br />
Example <br />
<pre><br />
Host test-vm test<br />
Hostname test-vm.test.no<br />
<br />
</pre><br />
<br />
== postgres ==<br />
https://stackoverflow.com/questions/32439167/psql-could-not-connect-to-server-connection-refused-error-when-connecting-to</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Eve_Online&diff=410Eve Online2023-02-12T18:54:09Z<p>Wiki.malinux.no: Created page with "===Eve Online linux tips and tricks === ==Eve Online VKD3D (aka dx12 to vulkan) with lutris== =Enable vkd3d= * make a file called dxvk.conf in the same folder as the eve.ex..."</p>
<hr />
<div>===Eve Online linux tips and tricks ===<br />
<br />
==Eve Online VKD3D (aka dx12 to vulkan) with lutris==<br />
<br />
=Enable vkd3d=<br />
<br />
* make a file called dxvk.conf in the same folder as the eve.exe file and paste this environment variable:<br />
<br />
<pre>d3d11.maxFeatureLevel = 12_1</pre></div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Gaming&diff=409Gaming2023-02-12T18:51:11Z<p>Wiki.malinux.no: </p>
<hr />
<div>* [[ARK: Survival Evolved]]<br />
* [[Emulating]]<br />
* [[Eve Online]]<br />
* [[Vrising Dedicated Debian 11 Server WINE]]</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Malin%27s_notes&diff=408Malin's notes2022-11-16T11:52:27Z<p>Wiki.malinux.no: /* grub */</p>
<hr />
<div>==gnu/linux==<br />
<br />
To change ownership of everything that's not already owned by a user<br />
<br />
find /home/rtorrent/ ! -user rtorrent -exec chown rtorrent:rtorrent {} \; &<br />
<br />
==rtl8812AU==<br />
https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git<br />
<br />
remove led-disco<br />
<br />
/etc/modprobe.d/8188eu-blacklist.conf<br />
<br />
options 8812au rtw_led_enable=0<br />
<br />
==LVM==<br />
===[https://blog.raveland.tech/post/rename_vg/ rename Volume Group (VG)]===<br />
<br />
==mdadm==<br />
for dev in $( lsblk | awk '/sd[a-z].*1,8T/ { print }' ); do echo =============================== $dev ============================ ; smartctl -a /dev/$dev ; done | pastebinit<br />
<br />
<br />
<br />
mdadm --remove /dev/md0 failed # all failed devices<br />
<br />
mdadm --remove /dev/md0 detached # failed ones that aren't in /dev anymore<br />
<br />
ip addr add 192.168.0.101/24 dev eth0 ; ip route add default via 192.168.0.1 dev eth0<br />
<br />
<br />
<br />
Mulig rekkefølge med forbehold om at et ikke stemmer, for å endre vg navn på vg med root-partisjon<br />
vgchange gammel-vg ny-vg<br />
vgchange -ay<br />
<br />
endre i /etc/fstab<br />
<br />
grub-install /dev/XxX<br />
<br />
update-initramfs -k all -u<br />
<br />
reboot<br />
<br />
=Crossflash Dell PERC H200 from ir to it-mode=<br />
<br />
==The short answer== <br />
I slightly followed this guide:<br />
<br />
https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/<br />
<br />
The longer answer is. I followed the guide, this way, but did it a little different<br />
<br />
==The longer answer==<br />
<br />
Prepare a usb memory stick formatted as fat32 with two folders called P07 and P20<br />
<br />
===Step 1 download old firmware===<br />
<br />
1. Download this zip archive from dell and unzip it: https://downloads.dell.com/FOLDER02950081M/1/Y2R1T_9211_FW.zip?uid=f06bb69a-8c88-4a54-ac7b-ee8826244140&fn=Y2R1T_9211_FW.zip<br />
<br />
2. Extract 6GBPSAS.FW from Y2R1T_9211_FW/Firmware/6GbpsSASHBA_07.03.06.00_A10<br />
<br />
3. Extract 2118it.bin from FY2R1T_9211_FW/Firmware/9211-8i_P7/<br />
<br />
4. Extract sas2flash.efi from Y2R1T_9211_FW/sas2flash/p05/efi/<br />
<br />
5. Place the three extracted files in the P07 folder<br />
<br />
===Step 2 download current firmware===<br />
<br />
1. Extract 2118it.bin from Y2R1T_9211_FW/Firmware/9211-8i/P20/<br />
<br />
2. Download this zip https://docs.broadcom.com/docs-and-downloads/host-bus-adapters/host-bus-adapters-common-files/sas_sata_6g_p20/Installer_P20_for_UEFI.zip<br />
<br />
3. Extract sas2flash.efi from Installer_P20_for_UEFI/sas2flash_efi_ebc_rel/<br />
<br />
4. Place this to extracted files in the P20 folder<br />
<br />
===Step 3 download uefi shell===<br />
1. Download an uefi shell: [https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Obtaining_UEFI_Shell x86_64 UEFI SHELL] I choosed version 1 as it worked for the person in the guide [https://github.com/tianocore/edk2/raw/UDK2018/EdkShellBinPkg/FullShell/X64/Shell_Full.efi Direct download link]<br />
<br />
2. Extract Shell_Full.efi to the root of the memory stick. I had to rename it to Shellx64.efi to use it with my motherboard, asus P8H67_M_EVO. Check with you motherboard vendor to determine how to use efi-shell<br />
<br />
===Step 4 flashing===<br />
<br />
1. boot computer to efi shell<br />
<br />
2. If not present with a list with devices, type <pre>map -b</pre><br />
<br />
2. On my computer the memory stick is called fs0 so I typed fs0: to change prompt to the memory stick<br />
<br />
3. <pre>cd P07</pre><br />
<br />
4. <pre>sas2flash -listall</pre>will show the controller. If not, check if it is installed to a pci-e port<br />
<br />
5. <pre>sas2flash.efi -c 0 -list</pre> will show controller details and take a note of the sas address number<br />
<br />
6. <pre>sas2flash.efi -o -e 6</pre> will erase the old firmware and boot rom<br />
<br />
7. <pre>sas2flash.efi -o -f 6GBPSAS.FW</pre> writes the dell 6gbs firmware<br />
<br />
8. <pre>sas2flash.efi -o -f 2118it.bin</pre> writes the P07 firmware<br />
<br />
9. Then I rebooted<br />
<br />
10. boot into efi again<br />
<br />
11. <pre>cd P20</pre><br />
<br />
12. <pre>sas2flash.efi -o -f 2118it.bin writes the P20 firmware</pre><br />
<br />
===Notes===<br />
Directly copied from the source, step number changed to fit my tutorial:<br />
<br />
1. Step 6 showed “Erasing Flash Region” and then after a while “ERROR: Erase Flash Operation Failed!”. I simply proceeded and the error did not appear to affect anything.<br />
<br />
2. Visit [https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/ source] to get screenshots vit the error messages<br />
<br />
=Compile rtorrent libtorrent and xmlrpc-c=<br />
==libtorrent==<br />
==rtorrent==<br />
./configure --prefix=/usr --with-xmlrpc-c |tee /tmp/conf.log<br />
<br />
=vim=<br />
<br />
# Merk Noe Og Trykk U For Å Få Det I Lowercase, U For Uppercase ;)<br />
# stor v for visual line eller liten for visual der du må merke noe manuelt<br />
# ok. jeg glemte å markere først :p<br />
# oki :)<br />
<br />
# iT'S cAPS lOCK DAY!<br />
<br />
# trykk ~ for å endre fra stor til liten bokstav ;)<br />
<br />
=grub=<br />
<br />
==Repair GRUB from Windows==<br />
<br />
To repair efi bootloader/grub from windows<br />
<br />
Open powershell as admin and execute the following command<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\{distro}\grubx64.efi</pre><br />
<br />
if you are running debian, it will look like this:<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\debian\grubx64.efi</pre><br />
<br />
==Repair/install GRUB on EFI from live-usb==<br />
<br />
source=https://askubuntu.com/questions/831216/how-can-i-reinstall-grub-to-the-efi-partition/831241#831241<br />
<br />
<pre>mount /dev/sdXY /mnt</pre><br />
<br />
If you have seperatate boot-partition:<br />
<br />
<pre>mount /dev/sdXX /mnt/boot</pre><br />
<br />
and finally mount the efi-partition under boot:<br />
<br />
<pre>mount /dev/sdXZ /mnt/boot/efi/</pre><br />
<br />
Bind-mount some system partitions from the live-system:<br />
<br />
<pre>for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done </pre><br />
<br />
<pre>chroot /mnt</pre><br />
<br />
grub-install --target=x86_64-efi --efi-root=/dev/sdXZ<br />
grub-mkconfig -o /boot/grub/grub.cfg</pre><br />
<br />
NOTE: Note : sdX = disk | sdXX = boot partition | sdXY = system partition | sdXZ = efi partition<br />
<br />
<br />
===Troubleshooting===<br />
<br />
EFI variables are not supported on this system.<br />
<br />
source:https://bbs.archlinux.org/viewtopic.php?pid=1349414#p1349414<br />
<br />
From outside chroot:<br />
<br />
<pre>modprobe efivarfs</pre><br />
<br />
From inside chroot:<br />
<br />
<pre> mount -t efivarfs efivarfs /sys/firmware/efi/efivars</pre><br />
<br />
=libvirt=<br />
<br />
==setup new vm from a template==<br />
<br />
If you have a qcow2 vm template, clone it.:<br />
<br />
If you clone a qcow2 in use, stop the vm first:<br />
<br />
<pre>virsh stop {domain-vm-name}</pre><br />
<br />
Then clone the qcow2<br />
<br />
<pre>virt-clone --original {Domain-Vm-Name-Here} --name {New-Domain-Vm-Name-Here} --auto-clone</pre><br />
<br />
Configure your VM to your likings either by virt-manager (gui) or by cli<br />
<br />
Start the new vm and log in, either by ssh, or via virt-manager<br />
<br />
Change hostname to match the new name of the VM<br />
<br />
<pre>sudo -i<br />
vi /etc/hostname</pre><br />
<br />
<br />
<pre>vi /etc/hosts</pre> to match the name of the new VM<br />
<br />
Example. change:<br />
<br />
<pre>127.0.1.1 debian-stretch-mal.debian-stretch-mal.local debian-stretch-mal</pre><br />
<br />
to<br />
<pre>127.0.1.1 new-name-vm.new-name-vm.local new-name-vm</pre><br />
<br />
Also add a line for the ip to the server who runs the VM and for the backup server if you have one, like this<br />
<br />
<pre>192.168.X.X hostname.domain.xx hostname</pre><br />
<br />
<br />
change local ip to a free address<br />
<br />
<pre> vi /etc/network/interfaces</pre><br />
<br />
and add the new ip in on the host <br />
<pre>/etc/hosts</pre><br />
<br />
Make ssh keys:<br />
<br />
<pre>ssh-keygen</pre><br />
go with the defaults by hit enter, when prompted for questions<br />
<br />
copy the the public key from <pre>.ssh/id_rsa.pub</pre><br />
<br />
If bareos is setup on the qcow2 vm template you also need to change the following line in bareos filedaemon config to match your new vm<br />
<br />
<pre>vi /etc/bareos/bareos-fd.conf<br />
<br />
FileDaemon {<br />
Name = new-name-vm.domain.xx-fd </pre><br />
<br />
*sources<br />
https://www.cyberciti.biz/faq/how-to-clone-existing-kvm-virtual-machine-images-on-linux/<br />
<br />
=add bareos client=<br />
<br />
If you already have a bareos backup server<br />
<br />
on the new vm or computer you want to backup to bareos<br />
<br />
Install bareos-filedaemon on the client if it's not already installed<br />
<pre> apt install bareos-filedaemon<br />
systemctl enable bareos-filedaemon.service</pre><br />
<br />
<br />
Then log into the bareos server and run bconsole<br />
<br />
<pre>configure add client name=new-name-vm address=192.168.X.X password=SOME_PASSWORD</pre><br />
<br />
Then the config is saved to<br />
<pre>/etc/bareos/bareos-dir-export/client/svennd/bareos-fd.d/director/bareos-dir.conf</pre><br />
<br />
Copy it to the client in:<br />
<pre>/etc/bareos/bareos-fd.d/directory/bareos-dir.conf</pre><br />
<br />
<br />
*sources<br />
https://www.svennd.be/adding-a-linux-client-to-bareos/<br />
<br />
<br />
=IRC=<br />
==Renew ssl cert==<br />
source= https://github.com/ubergeek42/weechat-android/wiki/Using-SSL-with-WeeChat#generating-a-self-signed-certificate=<br />
To create a certificate with a domain:<br />
<br />
<pre>export HOSTNAME=example.org</pre><br />
<br />
From within ~/.weechat/ssl do:<br />
<pre>openssl req -x509 -nodes -newkey rsa:2048 -keyout relay.pem -extensions san_env \<br />
-subj "/O=WeeChat/CN=$HOSTNAME" \<br />
-config <(cat /etc/ssl/openssl.cnf <(printf "\n[ san_env ]\nsubjectAltName=DNS:\${ENV::HOSTNAME}")) \<br />
-days 365 -out relay.pem</pre><br />
<br />
Then within weechat, reload to the new certificate<br />
<br />
<pre>/relay sslcertkey</pre><br />
<br />
=DNS with rndc=<br />
<br />
==Manipulating dns with rndc==<br />
<br />
login to the computer/vm that takes care of DNS<br />
<br />
ZONE=<domain>.<countrycode> ; rndc freeze $ZONE && vi /etc/bind/$ZONE.zone ; rndc thaw $ZONE ; tail -f /var/log/daemon.log<br />
<br />
Do it like this:<br />
<br />
<pre>rndc freeze domain.no</pre><br />
<br />
Edit stuff in open and you can add stuff:<br />
<br />
<pre><text-editor> /etc/bind/domain.no.zone</pre><br />
<br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Example</strong><br />
|-<br />
| If you use the text editor nano it will look like this: <br />
<pre>nano /etc/bind/domain.no.zone</pre><br />
|}<br />
<br />
Edit the file according to this:<br />
<br />
<pre><vm-domain-name-vm> AAAA ipv6-adr<br />
<vm-domain-name-vm> A ipv4-adr<br />
<br />
<vm-domain-name> CNAME <vm-domain-name></pre><br />
<br />
example:<br />
<br />
<pre>test-vm AAAA ipv6-adr<br />
test-vm A ipv4-adr<br />
<br />
test CNAME test-vm</pre><br />
<br />
Don't have same domain on both A/AAAA and CNAME<br />
<br />
Before you save and exit, add serial number to zone-file format: YYYYMMDDxx<br />
<br />
Oneliner to run. change domain.no to your domain<br />
<br />
<pre>rndc freeze domain.no && vi /etc/bind/karlsbakk.net.zone ; rndc thaw domain.no ; tail -f /var/log/daemon.log</pre><br />
<br />
==Local script to run==<br />
<br />
Open the local [https://github.com/rkarlsba/ymse/blob/master/ddns/ddns-update.sh ddns-update.sh] script and add test-vm to VM= variabel if not already present<br />
<br />
If you don't want to wait for the script to run automatically from cron, run it with the force flag<br />
<br />
<pre>ddns-update.sh --force</pre><br />
<br />
==Troubleshooting==<br />
<br />
Ipv4 not updated when address changes<br />
<br />
check if you remembered to thaw the zone<br />
<br />
=SSH=<br />
<br />
==TAB-complete==<br />
<br />
<pre>vi .ssh/config</pre><br />
<br />
Then add lines like this:<br />
<br />
<pre><br />
Host <name> # space between multiple names<br />
user admin # optional if you want to add username to log in with<br />
Hostname <ipaddress>/<domain/hostname><br />
Port 2022 # optional add if port is other than default 22<br />
</pre><br />
<br />
Example <br />
<pre><br />
Host test-vm test<br />
Hostname test-vm.test.no<br />
<br />
</pre><br />
<br />
== postgres ==<br />
https://stackoverflow.com/questions/32439167/psql-could-not-connect-to-server-connection-refused-error-when-connecting-to</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Malin%27s_notes&diff=407Malin's notes2022-11-16T11:50:36Z<p>Wiki.malinux.no: /* grub */</p>
<hr />
<div>==gnu/linux==<br />
<br />
To change ownership of everything that's not already owned by a user<br />
<br />
find /home/rtorrent/ ! -user rtorrent -exec chown rtorrent:rtorrent {} \; &<br />
<br />
==rtl8812AU==<br />
https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git<br />
<br />
remove led-disco<br />
<br />
/etc/modprobe.d/8188eu-blacklist.conf<br />
<br />
options 8812au rtw_led_enable=0<br />
<br />
==LVM==<br />
===[https://blog.raveland.tech/post/rename_vg/ rename Volume Group (VG)]===<br />
<br />
==mdadm==<br />
for dev in $( lsblk | awk '/sd[a-z].*1,8T/ { print }' ); do echo =============================== $dev ============================ ; smartctl -a /dev/$dev ; done | pastebinit<br />
<br />
<br />
<br />
mdadm --remove /dev/md0 failed # all failed devices<br />
<br />
mdadm --remove /dev/md0 detached # failed ones that aren't in /dev anymore<br />
<br />
ip addr add 192.168.0.101/24 dev eth0 ; ip route add default via 192.168.0.1 dev eth0<br />
<br />
<br />
<br />
Mulig rekkefølge med forbehold om at et ikke stemmer, for å endre vg navn på vg med root-partisjon<br />
vgchange gammel-vg ny-vg<br />
vgchange -ay<br />
<br />
endre i /etc/fstab<br />
<br />
grub-install /dev/XxX<br />
<br />
update-initramfs -k all -u<br />
<br />
reboot<br />
<br />
=Crossflash Dell PERC H200 from ir to it-mode=<br />
<br />
==The short answer== <br />
I slightly followed this guide:<br />
<br />
https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/<br />
<br />
The longer answer is. I followed the guide, this way, but did it a little different<br />
<br />
==The longer answer==<br />
<br />
Prepare a usb memory stick formatted as fat32 with two folders called P07 and P20<br />
<br />
===Step 1 download old firmware===<br />
<br />
1. Download this zip archive from dell and unzip it: https://downloads.dell.com/FOLDER02950081M/1/Y2R1T_9211_FW.zip?uid=f06bb69a-8c88-4a54-ac7b-ee8826244140&fn=Y2R1T_9211_FW.zip<br />
<br />
2. Extract 6GBPSAS.FW from Y2R1T_9211_FW/Firmware/6GbpsSASHBA_07.03.06.00_A10<br />
<br />
3. Extract 2118it.bin from FY2R1T_9211_FW/Firmware/9211-8i_P7/<br />
<br />
4. Extract sas2flash.efi from Y2R1T_9211_FW/sas2flash/p05/efi/<br />
<br />
5. Place the three extracted files in the P07 folder<br />
<br />
===Step 2 download current firmware===<br />
<br />
1. Extract 2118it.bin from Y2R1T_9211_FW/Firmware/9211-8i/P20/<br />
<br />
2. Download this zip https://docs.broadcom.com/docs-and-downloads/host-bus-adapters/host-bus-adapters-common-files/sas_sata_6g_p20/Installer_P20_for_UEFI.zip<br />
<br />
3. Extract sas2flash.efi from Installer_P20_for_UEFI/sas2flash_efi_ebc_rel/<br />
<br />
4. Place this to extracted files in the P20 folder<br />
<br />
===Step 3 download uefi shell===<br />
1. Download an uefi shell: [https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Obtaining_UEFI_Shell x86_64 UEFI SHELL] I choosed version 1 as it worked for the person in the guide [https://github.com/tianocore/edk2/raw/UDK2018/EdkShellBinPkg/FullShell/X64/Shell_Full.efi Direct download link]<br />
<br />
2. Extract Shell_Full.efi to the root of the memory stick. I had to rename it to Shellx64.efi to use it with my motherboard, asus P8H67_M_EVO. Check with you motherboard vendor to determine how to use efi-shell<br />
<br />
===Step 4 flashing===<br />
<br />
1. boot computer to efi shell<br />
<br />
2. If not present with a list with devices, type <pre>map -b</pre><br />
<br />
2. On my computer the memory stick is called fs0 so I typed fs0: to change prompt to the memory stick<br />
<br />
3. <pre>cd P07</pre><br />
<br />
4. <pre>sas2flash -listall</pre>will show the controller. If not, check if it is installed to a pci-e port<br />
<br />
5. <pre>sas2flash.efi -c 0 -list</pre> will show controller details and take a note of the sas address number<br />
<br />
6. <pre>sas2flash.efi -o -e 6</pre> will erase the old firmware and boot rom<br />
<br />
7. <pre>sas2flash.efi -o -f 6GBPSAS.FW</pre> writes the dell 6gbs firmware<br />
<br />
8. <pre>sas2flash.efi -o -f 2118it.bin</pre> writes the P07 firmware<br />
<br />
9. Then I rebooted<br />
<br />
10. boot into efi again<br />
<br />
11. <pre>cd P20</pre><br />
<br />
12. <pre>sas2flash.efi -o -f 2118it.bin writes the P20 firmware</pre><br />
<br />
===Notes===<br />
Directly copied from the source, step number changed to fit my tutorial:<br />
<br />
1. Step 6 showed “Erasing Flash Region” and then after a while “ERROR: Erase Flash Operation Failed!”. I simply proceeded and the error did not appear to affect anything.<br />
<br />
2. Visit [https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/ source] to get screenshots vit the error messages<br />
<br />
=Compile rtorrent libtorrent and xmlrpc-c=<br />
==libtorrent==<br />
==rtorrent==<br />
./configure --prefix=/usr --with-xmlrpc-c |tee /tmp/conf.log<br />
<br />
=vim=<br />
<br />
# Merk Noe Og Trykk U For Å Få Det I Lowercase, U For Uppercase ;)<br />
# stor v for visual line eller liten for visual der du må merke noe manuelt<br />
# ok. jeg glemte å markere først :p<br />
# oki :)<br />
<br />
# iT'S cAPS lOCK DAY!<br />
<br />
# trykk ~ for å endre fra stor til liten bokstav ;)<br />
<br />
=grub=<br />
<br />
==Repair GRUB from Windows==<br />
<br />
To repair efi bootloader/grub from windows<br />
<br />
Open powershell as admin and execute the following command<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\{distro}\grubx64.efi</pre><br />
<br />
if you are running debian, it will look like this:<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\debian\grubx64.efi</pre><br />
<br />
==Repair/install GRUB on EFI from live-usb==<br />
<br />
source=https://askubuntu.com/questions/831216/how-can-i-reinstall-grub-to-the-efi-partition/831241#831241<br />
<br />
<pre>mount /dev/sdXY /mnt</pre><br />
<br />
If you have seperatate boot-partition:<br />
<br />
<pre>mount /dev/sdXX /mnt/boot</pre><br />
<br />
and finally mount the efi-partition under boot:<br />
<br />
<pre>mount /dev/sdXZ /mnt/boot/efi/</pre><br />
<br />
bind-mount some system partitions from the live-system:<br />
<br />
<pre>for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done </pre><br />
<br />
<pre>chroot /mnt</pre><br />
<br />
<pre>grub-install --target=x86_64-efi --efi-root=/dev/sdXZ</pre><br />
<pre>grub-mkconfig -o /boot/grub/grub.cfg</pre><br />
<br />
NOTE: Note : sdX = disk | sdXX = boot partition | sdXY = system partition | sdXZ = efi partition<br />
<pre><br />
<br />
===Troubleshooting===<br />
<br />
EFI variables are not supported on this system.<br />
<br />
source:https://bbs.archlinux.org/viewtopic.php?pid=1349414#p1349414<br />
<br />
From outside chroot:<br />
<br />
<pre>modprobe efivarfs</pre><br />
<br />
From inside chroot:<br />
<br />
<pre> mount -t efivarfs efivarfs /sys/firmware/efi/efivars</pre><br />
<br />
=libvirt=<br />
<br />
==setup new vm from a template==<br />
<br />
If you have a qcow2 vm template, clone it.:<br />
<br />
If you clone a qcow2 in use, stop the vm first:<br />
<br />
<pre>virsh stop {domain-vm-name}</pre><br />
<br />
Then clone the qcow2<br />
<br />
<pre>virt-clone --original {Domain-Vm-Name-Here} --name {New-Domain-Vm-Name-Here} --auto-clone</pre><br />
<br />
Configure your VM to your likings either by virt-manager (gui) or by cli<br />
<br />
Start the new vm and log in, either by ssh, or via virt-manager<br />
<br />
Change hostname to match the new name of the VM<br />
<br />
<pre>sudo -i<br />
vi /etc/hostname</pre><br />
<br />
<br />
<pre>vi /etc/hosts</pre> to match the name of the new VM<br />
<br />
Example. change:<br />
<br />
<pre>127.0.1.1 debian-stretch-mal.debian-stretch-mal.local debian-stretch-mal</pre><br />
<br />
to<br />
<pre>127.0.1.1 new-name-vm.new-name-vm.local new-name-vm</pre><br />
<br />
Also add a line for the ip to the server who runs the VM and for the backup server if you have one, like this<br />
<br />
<pre>192.168.X.X hostname.domain.xx hostname</pre><br />
<br />
<br />
change local ip to a free address<br />
<br />
<pre> vi /etc/network/interfaces</pre><br />
<br />
and add the new ip in on the host <br />
<pre>/etc/hosts</pre><br />
<br />
Make ssh keys:<br />
<br />
<pre>ssh-keygen</pre><br />
go with the defaults by hit enter, when prompted for questions<br />
<br />
copy the the public key from <pre>.ssh/id_rsa.pub</pre><br />
<br />
If bareos is setup on the qcow2 vm template you also need to change the following line in bareos filedaemon config to match your new vm<br />
<br />
<pre>vi /etc/bareos/bareos-fd.conf<br />
<br />
FileDaemon {<br />
Name = new-name-vm.domain.xx-fd </pre><br />
<br />
*sources<br />
https://www.cyberciti.biz/faq/how-to-clone-existing-kvm-virtual-machine-images-on-linux/<br />
<br />
=add bareos client=<br />
<br />
If you already have a bareos backup server<br />
<br />
on the new vm or computer you want to backup to bareos<br />
<br />
Install bareos-filedaemon on the client if it's not already installed<br />
<pre> apt install bareos-filedaemon<br />
systemctl enable bareos-filedaemon.service</pre><br />
<br />
<br />
Then log into the bareos server and run bconsole<br />
<br />
<pre>configure add client name=new-name-vm address=192.168.X.X password=SOME_PASSWORD</pre><br />
<br />
Then the config is saved to<br />
<pre>/etc/bareos/bareos-dir-export/client/svennd/bareos-fd.d/director/bareos-dir.conf</pre><br />
<br />
Copy it to the client in:<br />
<pre>/etc/bareos/bareos-fd.d/directory/bareos-dir.conf</pre><br />
<br />
<br />
*sources<br />
https://www.svennd.be/adding-a-linux-client-to-bareos/<br />
<br />
<br />
=IRC=<br />
==Renew ssl cert==<br />
source= https://github.com/ubergeek42/weechat-android/wiki/Using-SSL-with-WeeChat#generating-a-self-signed-certificate=<br />
To create a certificate with a domain:<br />
<br />
<pre>export HOSTNAME=example.org</pre><br />
<br />
From within ~/.weechat/ssl do:<br />
<pre>openssl req -x509 -nodes -newkey rsa:2048 -keyout relay.pem -extensions san_env \<br />
-subj "/O=WeeChat/CN=$HOSTNAME" \<br />
-config <(cat /etc/ssl/openssl.cnf <(printf "\n[ san_env ]\nsubjectAltName=DNS:\${ENV::HOSTNAME}")) \<br />
-days 365 -out relay.pem</pre><br />
<br />
Then within weechat, reload to the new certificate<br />
<br />
<pre>/relay sslcertkey</pre><br />
<br />
=DNS with rndc=<br />
<br />
==Manipulating dns with rndc==<br />
<br />
login to the computer/vm that takes care of DNS<br />
<br />
ZONE=<domain>.<countrycode> ; rndc freeze $ZONE && vi /etc/bind/$ZONE.zone ; rndc thaw $ZONE ; tail -f /var/log/daemon.log<br />
<br />
Do it like this:<br />
<br />
<pre>rndc freeze domain.no</pre><br />
<br />
Edit stuff in open and you can add stuff:<br />
<br />
<pre><text-editor> /etc/bind/domain.no.zone</pre><br />
<br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Example</strong><br />
|-<br />
| If you use the text editor nano it will look like this: <br />
<pre>nano /etc/bind/domain.no.zone</pre><br />
|}<br />
<br />
Edit the file according to this:<br />
<br />
<pre><vm-domain-name-vm> AAAA ipv6-adr<br />
<vm-domain-name-vm> A ipv4-adr<br />
<br />
<vm-domain-name> CNAME <vm-domain-name></pre><br />
<br />
example:<br />
<br />
<pre>test-vm AAAA ipv6-adr<br />
test-vm A ipv4-adr<br />
<br />
test CNAME test-vm</pre><br />
<br />
Don't have same domain on both A/AAAA and CNAME<br />
<br />
Before you save and exit, add serial number to zone-file format: YYYYMMDDxx<br />
<br />
Oneliner to run. change domain.no to your domain<br />
<br />
<pre>rndc freeze domain.no && vi /etc/bind/karlsbakk.net.zone ; rndc thaw domain.no ; tail -f /var/log/daemon.log</pre><br />
<br />
==Local script to run==<br />
<br />
Open the local [https://github.com/rkarlsba/ymse/blob/master/ddns/ddns-update.sh ddns-update.sh] script and add test-vm to VM= variabel if not already present<br />
<br />
If you don't want to wait for the script to run automatically from cron, run it with the force flag<br />
<br />
<pre>ddns-update.sh --force</pre><br />
<br />
==Troubleshooting==<br />
<br />
Ipv4 not updated when address changes<br />
<br />
check if you remembered to thaw the zone<br />
<br />
=SSH=<br />
<br />
==TAB-complete==<br />
<br />
<pre>vi .ssh/config</pre><br />
<br />
Then add lines like this:<br />
<br />
<pre><br />
Host <name> # space between multiple names<br />
user admin # optional if you want to add username to log in with<br />
Hostname <ipaddress>/<domain/hostname><br />
Port 2022 # optional add if port is other than default 22<br />
</pre><br />
<br />
Example <br />
<pre><br />
Host test-vm test<br />
Hostname test-vm.test.no<br />
<br />
</pre><br />
<br />
== postgres ==<br />
https://stackoverflow.com/questions/32439167/psql-could-not-connect-to-server-connection-refused-error-when-connecting-to</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Malin%27s_notes&diff=406Malin's notes2022-10-25T21:59:15Z<p>Wiki.malinux.no: /* DNS with rndc */</p>
<hr />
<div>==gnu/linux==<br />
<br />
To change ownership of everything that's not already owned by a user<br />
<br />
find /home/rtorrent/ ! -user rtorrent -exec chown rtorrent:rtorrent {} \; &<br />
<br />
==rtl8812AU==<br />
https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git<br />
<br />
remove led-disco<br />
<br />
/etc/modprobe.d/8188eu-blacklist.conf<br />
<br />
options 8812au rtw_led_enable=0<br />
<br />
==LVM==<br />
===[https://blog.raveland.tech/post/rename_vg/ rename Volume Group (VG)]===<br />
<br />
==mdadm==<br />
for dev in $( lsblk | awk '/sd[a-z].*1,8T/ { print }' ); do echo =============================== $dev ============================ ; smartctl -a /dev/$dev ; done | pastebinit<br />
<br />
<br />
<br />
mdadm --remove /dev/md0 failed # all failed devices<br />
<br />
mdadm --remove /dev/md0 detached # failed ones that aren't in /dev anymore<br />
<br />
ip addr add 192.168.0.101/24 dev eth0 ; ip route add default via 192.168.0.1 dev eth0<br />
<br />
<br />
<br />
Mulig rekkefølge med forbehold om at et ikke stemmer, for å endre vg navn på vg med root-partisjon<br />
vgchange gammel-vg ny-vg<br />
vgchange -ay<br />
<br />
endre i /etc/fstab<br />
<br />
grub-install /dev/XxX<br />
<br />
update-initramfs -k all -u<br />
<br />
reboot<br />
<br />
=Crossflash Dell PERC H200 from ir to it-mode=<br />
<br />
==The short answer== <br />
I slightly followed this guide:<br />
<br />
https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/<br />
<br />
The longer answer is. I followed the guide, this way, but did it a little different<br />
<br />
==The longer answer==<br />
<br />
Prepare a usb memory stick formatted as fat32 with two folders called P07 and P20<br />
<br />
===Step 1 download old firmware===<br />
<br />
1. Download this zip archive from dell and unzip it: https://downloads.dell.com/FOLDER02950081M/1/Y2R1T_9211_FW.zip?uid=f06bb69a-8c88-4a54-ac7b-ee8826244140&fn=Y2R1T_9211_FW.zip<br />
<br />
2. Extract 6GBPSAS.FW from Y2R1T_9211_FW/Firmware/6GbpsSASHBA_07.03.06.00_A10<br />
<br />
3. Extract 2118it.bin from FY2R1T_9211_FW/Firmware/9211-8i_P7/<br />
<br />
4. Extract sas2flash.efi from Y2R1T_9211_FW/sas2flash/p05/efi/<br />
<br />
5. Place the three extracted files in the P07 folder<br />
<br />
===Step 2 download current firmware===<br />
<br />
1. Extract 2118it.bin from Y2R1T_9211_FW/Firmware/9211-8i/P20/<br />
<br />
2. Download this zip https://docs.broadcom.com/docs-and-downloads/host-bus-adapters/host-bus-adapters-common-files/sas_sata_6g_p20/Installer_P20_for_UEFI.zip<br />
<br />
3. Extract sas2flash.efi from Installer_P20_for_UEFI/sas2flash_efi_ebc_rel/<br />
<br />
4. Place this to extracted files in the P20 folder<br />
<br />
===Step 3 download uefi shell===<br />
1. Download an uefi shell: [https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Obtaining_UEFI_Shell x86_64 UEFI SHELL] I choosed version 1 as it worked for the person in the guide [https://github.com/tianocore/edk2/raw/UDK2018/EdkShellBinPkg/FullShell/X64/Shell_Full.efi Direct download link]<br />
<br />
2. Extract Shell_Full.efi to the root of the memory stick. I had to rename it to Shellx64.efi to use it with my motherboard, asus P8H67_M_EVO. Check with you motherboard vendor to determine how to use efi-shell<br />
<br />
===Step 4 flashing===<br />
<br />
1. boot computer to efi shell<br />
<br />
2. If not present with a list with devices, type <pre>map -b</pre><br />
<br />
2. On my computer the memory stick is called fs0 so I typed fs0: to change prompt to the memory stick<br />
<br />
3. <pre>cd P07</pre><br />
<br />
4. <pre>sas2flash -listall</pre>will show the controller. If not, check if it is installed to a pci-e port<br />
<br />
5. <pre>sas2flash.efi -c 0 -list</pre> will show controller details and take a note of the sas address number<br />
<br />
6. <pre>sas2flash.efi -o -e 6</pre> will erase the old firmware and boot rom<br />
<br />
7. <pre>sas2flash.efi -o -f 6GBPSAS.FW</pre> writes the dell 6gbs firmware<br />
<br />
8. <pre>sas2flash.efi -o -f 2118it.bin</pre> writes the P07 firmware<br />
<br />
9. Then I rebooted<br />
<br />
10. boot into efi again<br />
<br />
11. <pre>cd P20</pre><br />
<br />
12. <pre>sas2flash.efi -o -f 2118it.bin writes the P20 firmware</pre><br />
<br />
===Notes===<br />
Directly copied from the source, step number changed to fit my tutorial:<br />
<br />
1. Step 6 showed “Erasing Flash Region” and then after a while “ERROR: Erase Flash Operation Failed!”. I simply proceeded and the error did not appear to affect anything.<br />
<br />
2. Visit [https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/ source] to get screenshots vit the error messages<br />
<br />
=Compile rtorrent libtorrent and xmlrpc-c=<br />
==libtorrent==<br />
==rtorrent==<br />
./configure --prefix=/usr --with-xmlrpc-c |tee /tmp/conf.log<br />
<br />
=vim=<br />
<br />
# Merk Noe Og Trykk U For Å Få Det I Lowercase, U For Uppercase ;)<br />
# stor v for visual line eller liten for visual der du må merke noe manuelt<br />
# ok. jeg glemte å markere først :p<br />
# oki :)<br />
<br />
# iT'S cAPS lOCK DAY!<br />
<br />
# trykk ~ for å endre fra stor til liten bokstav ;)<br />
<br />
=grub=<br />
<br />
==Repair GRUB from Windows==<br />
<br />
To repair efi bootloader/grub from windows<br />
<br />
Open powershell as admin and execute the following command<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\{distro}\grubx64.efi</pre><br />
<br />
if you are running debian, it will look like this:<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\debian\grubx64.efi</pre><br />
<br />
=libvirt=<br />
<br />
==setup new vm from a template==<br />
<br />
If you have a qcow2 vm template, clone it.:<br />
<br />
If you clone a qcow2 in use, stop the vm first:<br />
<br />
<pre>virsh stop {domain-vm-name}</pre><br />
<br />
Then clone the qcow2<br />
<br />
<pre>virt-clone --original {Domain-Vm-Name-Here} --name {New-Domain-Vm-Name-Here} --auto-clone</pre><br />
<br />
Configure your VM to your likings either by virt-manager (gui) or by cli<br />
<br />
Start the new vm and log in, either by ssh, or via virt-manager<br />
<br />
Change hostname to match the new name of the VM<br />
<br />
<pre>sudo -i<br />
vi /etc/hostname</pre><br />
<br />
<br />
<pre>vi /etc/hosts</pre> to match the name of the new VM<br />
<br />
Example. change:<br />
<br />
<pre>127.0.1.1 debian-stretch-mal.debian-stretch-mal.local debian-stretch-mal</pre><br />
<br />
to<br />
<pre>127.0.1.1 new-name-vm.new-name-vm.local new-name-vm</pre><br />
<br />
Also add a line for the ip to the server who runs the VM and for the backup server if you have one, like this<br />
<br />
<pre>192.168.X.X hostname.domain.xx hostname</pre><br />
<br />
<br />
change local ip to a free address<br />
<br />
<pre> vi /etc/network/interfaces</pre><br />
<br />
and add the new ip in on the host <br />
<pre>/etc/hosts</pre><br />
<br />
Make ssh keys:<br />
<br />
<pre>ssh-keygen</pre><br />
go with the defaults by hit enter, when prompted for questions<br />
<br />
copy the the public key from <pre>.ssh/id_rsa.pub</pre><br />
<br />
If bareos is setup on the qcow2 vm template you also need to change the following line in bareos filedaemon config to match your new vm<br />
<br />
<pre>vi /etc/bareos/bareos-fd.conf<br />
<br />
FileDaemon {<br />
Name = new-name-vm.domain.xx-fd </pre><br />
<br />
*sources<br />
https://www.cyberciti.biz/faq/how-to-clone-existing-kvm-virtual-machine-images-on-linux/<br />
<br />
=add bareos client=<br />
<br />
If you already have a bareos backup server<br />
<br />
on the new vm or computer you want to backup to bareos<br />
<br />
Install bareos-filedaemon on the client if it's not already installed<br />
<pre> apt install bareos-filedaemon<br />
systemctl enable bareos-filedaemon.service</pre><br />
<br />
<br />
Then log into the bareos server and run bconsole<br />
<br />
<pre>configure add client name=new-name-vm address=192.168.X.X password=SOME_PASSWORD</pre><br />
<br />
Then the config is saved to<br />
<pre>/etc/bareos/bareos-dir-export/client/svennd/bareos-fd.d/director/bareos-dir.conf</pre><br />
<br />
Copy it to the client in:<br />
<pre>/etc/bareos/bareos-fd.d/directory/bareos-dir.conf</pre><br />
<br />
<br />
*sources<br />
https://www.svennd.be/adding-a-linux-client-to-bareos/<br />
<br />
<br />
=IRC=<br />
==Renew ssl cert==<br />
source= https://github.com/ubergeek42/weechat-android/wiki/Using-SSL-with-WeeChat#generating-a-self-signed-certificate=<br />
To create a certificate with a domain:<br />
<br />
<pre>export HOSTNAME=example.org</pre><br />
<br />
From within ~/.weechat/ssl do:<br />
<pre>openssl req -x509 -nodes -newkey rsa:2048 -keyout relay.pem -extensions san_env \<br />
-subj "/O=WeeChat/CN=$HOSTNAME" \<br />
-config <(cat /etc/ssl/openssl.cnf <(printf "\n[ san_env ]\nsubjectAltName=DNS:\${ENV::HOSTNAME}")) \<br />
-days 365 -out relay.pem</pre><br />
<br />
Then within weechat, reload to the new certificate<br />
<br />
<pre>/relay sslcertkey</pre><br />
<br />
=DNS with rndc=<br />
<br />
==Manipulating dns with rndc==<br />
<br />
login to the computer/vm that takes care of DNS<br />
<br />
ZONE=<domain>.<countrycode> ; rndc freeze $ZONE && vi /etc/bind/$ZONE.zone ; rndc thaw $ZONE ; tail -f /var/log/daemon.log<br />
<br />
Do it like this:<br />
<br />
<pre>rndc freeze domain.no</pre><br />
<br />
Edit stuff in open and you can add stuff:<br />
<br />
<pre><text-editor> /etc/bind/domain.no.zone</pre><br />
<br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Example</strong><br />
|-<br />
| If you use the text editor nano it will look like this: <br />
<pre>nano /etc/bind/domain.no.zone</pre><br />
|}<br />
<br />
Edit the file according to this:<br />
<br />
<pre><vm-domain-name-vm> AAAA ipv6-adr<br />
<vm-domain-name-vm> A ipv4-adr<br />
<br />
<vm-domain-name> CNAME <vm-domain-name></pre><br />
<br />
example:<br />
<br />
<pre>test-vm AAAA ipv6-adr<br />
test-vm A ipv4-adr<br />
<br />
test CNAME test-vm</pre><br />
<br />
Don't have same domain on both A/AAAA and CNAME<br />
<br />
Before you save and exit, add serial number to zone-file format: YYYYMMDDxx<br />
<br />
Oneliner to run. change domain.no to your domain<br />
<br />
<pre>rndc freeze domain.no && vi /etc/bind/karlsbakk.net.zone ; rndc thaw domain.no ; tail -f /var/log/daemon.log</pre><br />
<br />
==Local script to run==<br />
<br />
Open the local [https://github.com/rkarlsba/ymse/blob/master/ddns/ddns-update.sh ddns-update.sh] script and add test-vm to VM= variabel if not already present<br />
<br />
If you don't want to wait for the script to run automatically from cron, run it with the force flag<br />
<br />
<pre>ddns-update.sh --force</pre><br />
<br />
==Troubleshooting==<br />
<br />
Ipv4 not updated when address changes<br />
<br />
check if you remembered to thaw the zone<br />
<br />
=SSH=<br />
<br />
==TAB-complete==<br />
<br />
<pre>vi .ssh/config</pre><br />
<br />
Then add lines like this:<br />
<br />
<pre><br />
Host <name> # space between multiple names<br />
user admin # optional if you want to add username to log in with<br />
Hostname <ipaddress>/<domain/hostname><br />
Port 2022 # optional add if port is other than default 22<br />
</pre><br />
<br />
Example <br />
<pre><br />
Host test-vm test<br />
Hostname test-vm.test.no<br />
<br />
</pre><br />
<br />
== postgres ==<br />
https://stackoverflow.com/questions/32439167/psql-could-not-connect-to-server-connection-refused-error-when-connecting-to</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Malin%27s_notes&diff=405Malin's notes2022-10-25T13:05:30Z<p>Wiki.malinux.no: /* Manipulating dns with rndc */</p>
<hr />
<div>==gnu/linux==<br />
<br />
To change ownership of everything that's not already owned by a user<br />
<br />
find /home/rtorrent/ ! -user rtorrent -exec chown rtorrent:rtorrent {} \; &<br />
<br />
==rtl8812AU==<br />
https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git<br />
<br />
remove led-disco<br />
<br />
/etc/modprobe.d/8188eu-blacklist.conf<br />
<br />
options 8812au rtw_led_enable=0<br />
<br />
==LVM==<br />
===[https://blog.raveland.tech/post/rename_vg/ rename Volume Group (VG)]===<br />
<br />
==mdadm==<br />
for dev in $( lsblk | awk '/sd[a-z].*1,8T/ { print }' ); do echo =============================== $dev ============================ ; smartctl -a /dev/$dev ; done | pastebinit<br />
<br />
<br />
<br />
mdadm --remove /dev/md0 failed # all failed devices<br />
<br />
mdadm --remove /dev/md0 detached # failed ones that aren't in /dev anymore<br />
<br />
ip addr add 192.168.0.101/24 dev eth0 ; ip route add default via 192.168.0.1 dev eth0<br />
<br />
<br />
<br />
Mulig rekkefølge med forbehold om at et ikke stemmer, for å endre vg navn på vg med root-partisjon<br />
vgchange gammel-vg ny-vg<br />
vgchange -ay<br />
<br />
endre i /etc/fstab<br />
<br />
grub-install /dev/XxX<br />
<br />
update-initramfs -k all -u<br />
<br />
reboot<br />
<br />
=Crossflash Dell PERC H200 from ir to it-mode=<br />
<br />
==The short answer== <br />
I slightly followed this guide:<br />
<br />
https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/<br />
<br />
The longer answer is. I followed the guide, this way, but did it a little different<br />
<br />
==The longer answer==<br />
<br />
Prepare a usb memory stick formatted as fat32 with two folders called P07 and P20<br />
<br />
===Step 1 download old firmware===<br />
<br />
1. Download this zip archive from dell and unzip it: https://downloads.dell.com/FOLDER02950081M/1/Y2R1T_9211_FW.zip?uid=f06bb69a-8c88-4a54-ac7b-ee8826244140&fn=Y2R1T_9211_FW.zip<br />
<br />
2. Extract 6GBPSAS.FW from Y2R1T_9211_FW/Firmware/6GbpsSASHBA_07.03.06.00_A10<br />
<br />
3. Extract 2118it.bin from FY2R1T_9211_FW/Firmware/9211-8i_P7/<br />
<br />
4. Extract sas2flash.efi from Y2R1T_9211_FW/sas2flash/p05/efi/<br />
<br />
5. Place the three extracted files in the P07 folder<br />
<br />
===Step 2 download current firmware===<br />
<br />
1. Extract 2118it.bin from Y2R1T_9211_FW/Firmware/9211-8i/P20/<br />
<br />
2. Download this zip https://docs.broadcom.com/docs-and-downloads/host-bus-adapters/host-bus-adapters-common-files/sas_sata_6g_p20/Installer_P20_for_UEFI.zip<br />
<br />
3. Extract sas2flash.efi from Installer_P20_for_UEFI/sas2flash_efi_ebc_rel/<br />
<br />
4. Place this to extracted files in the P20 folder<br />
<br />
===Step 3 download uefi shell===<br />
1. Download an uefi shell: [https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Obtaining_UEFI_Shell x86_64 UEFI SHELL] I choosed version 1 as it worked for the person in the guide [https://github.com/tianocore/edk2/raw/UDK2018/EdkShellBinPkg/FullShell/X64/Shell_Full.efi Direct download link]<br />
<br />
2. Extract Shell_Full.efi to the root of the memory stick. I had to rename it to Shellx64.efi to use it with my motherboard, asus P8H67_M_EVO. Check with you motherboard vendor to determine how to use efi-shell<br />
<br />
===Step 4 flashing===<br />
<br />
1. boot computer to efi shell<br />
<br />
2. If not present with a list with devices, type <pre>map -b</pre><br />
<br />
2. On my computer the memory stick is called fs0 so I typed fs0: to change prompt to the memory stick<br />
<br />
3. <pre>cd P07</pre><br />
<br />
4. <pre>sas2flash -listall</pre>will show the controller. If not, check if it is installed to a pci-e port<br />
<br />
5. <pre>sas2flash.efi -c 0 -list</pre> will show controller details and take a note of the sas address number<br />
<br />
6. <pre>sas2flash.efi -o -e 6</pre> will erase the old firmware and boot rom<br />
<br />
7. <pre>sas2flash.efi -o -f 6GBPSAS.FW</pre> writes the dell 6gbs firmware<br />
<br />
8. <pre>sas2flash.efi -o -f 2118it.bin</pre> writes the P07 firmware<br />
<br />
9. Then I rebooted<br />
<br />
10. boot into efi again<br />
<br />
11. <pre>cd P20</pre><br />
<br />
12. <pre>sas2flash.efi -o -f 2118it.bin writes the P20 firmware</pre><br />
<br />
===Notes===<br />
Directly copied from the source, step number changed to fit my tutorial:<br />
<br />
1. Step 6 showed “Erasing Flash Region” and then after a while “ERROR: Erase Flash Operation Failed!”. I simply proceeded and the error did not appear to affect anything.<br />
<br />
2. Visit [https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/ source] to get screenshots vit the error messages<br />
<br />
=Compile rtorrent libtorrent and xmlrpc-c=<br />
==libtorrent==<br />
==rtorrent==<br />
./configure --prefix=/usr --with-xmlrpc-c |tee /tmp/conf.log<br />
<br />
=vim=<br />
<br />
# Merk Noe Og Trykk U For Å Få Det I Lowercase, U For Uppercase ;)<br />
# stor v for visual line eller liten for visual der du må merke noe manuelt<br />
# ok. jeg glemte å markere først :p<br />
# oki :)<br />
<br />
# iT'S cAPS lOCK DAY!<br />
<br />
# trykk ~ for å endre fra stor til liten bokstav ;)<br />
<br />
=grub=<br />
<br />
==Repair GRUB from Windows==<br />
<br />
To repair efi bootloader/grub from windows<br />
<br />
Open powershell as admin and execute the following command<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\{distro}\grubx64.efi</pre><br />
<br />
if you are running debian, it will look like this:<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\debian\grubx64.efi</pre><br />
<br />
=libvirt=<br />
<br />
==setup new vm from a template==<br />
<br />
If you have a qcow2 vm template, clone it.:<br />
<br />
If you clone a qcow2 in use, stop the vm first:<br />
<br />
<pre>virsh stop {domain-vm-name}</pre><br />
<br />
Then clone the qcow2<br />
<br />
<pre>virt-clone --original {Domain-Vm-Name-Here} --name {New-Domain-Vm-Name-Here} --auto-clone</pre><br />
<br />
Configure your VM to your likings either by virt-manager (gui) or by cli<br />
<br />
Start the new vm and log in, either by ssh, or via virt-manager<br />
<br />
Change hostname to match the new name of the VM<br />
<br />
<pre>sudo -i<br />
vi /etc/hostname</pre><br />
<br />
<br />
<pre>vi /etc/hosts</pre> to match the name of the new VM<br />
<br />
Example. change:<br />
<br />
<pre>127.0.1.1 debian-stretch-mal.debian-stretch-mal.local debian-stretch-mal</pre><br />
<br />
to<br />
<pre>127.0.1.1 new-name-vm.new-name-vm.local new-name-vm</pre><br />
<br />
Also add a line for the ip to the server who runs the VM and for the backup server if you have one, like this<br />
<br />
<pre>192.168.X.X hostname.domain.xx hostname</pre><br />
<br />
<br />
change local ip to a free address<br />
<br />
<pre> vi /etc/network/interfaces</pre><br />
<br />
and add the new ip in on the host <br />
<pre>/etc/hosts</pre><br />
<br />
Make ssh keys:<br />
<br />
<pre>ssh-keygen</pre><br />
go with the defaults by hit enter, when prompted for questions<br />
<br />
copy the the public key from <pre>.ssh/id_rsa.pub</pre><br />
<br />
If bareos is setup on the qcow2 vm template you also need to change the following line in bareos filedaemon config to match your new vm<br />
<br />
<pre>vi /etc/bareos/bareos-fd.conf<br />
<br />
FileDaemon {<br />
Name = new-name-vm.domain.xx-fd </pre><br />
<br />
*sources<br />
https://www.cyberciti.biz/faq/how-to-clone-existing-kvm-virtual-machine-images-on-linux/<br />
<br />
=add bareos client=<br />
<br />
If you already have a bareos backup server<br />
<br />
on the new vm or computer you want to backup to bareos<br />
<br />
Install bareos-filedaemon on the client if it's not already installed<br />
<pre> apt install bareos-filedaemon<br />
systemctl enable bareos-filedaemon.service</pre><br />
<br />
<br />
Then log into the bareos server and run bconsole<br />
<br />
<pre>configure add client name=new-name-vm address=192.168.X.X password=SOME_PASSWORD</pre><br />
<br />
Then the config is saved to<br />
<pre>/etc/bareos/bareos-dir-export/client/svennd/bareos-fd.d/director/bareos-dir.conf</pre><br />
<br />
Copy it to the client in:<br />
<pre>/etc/bareos/bareos-fd.d/directory/bareos-dir.conf</pre><br />
<br />
<br />
*sources<br />
https://www.svennd.be/adding-a-linux-client-to-bareos/<br />
<br />
<br />
=IRC=<br />
==Renew ssl cert==<br />
source= https://github.com/ubergeek42/weechat-android/wiki/Using-SSL-with-WeeChat#generating-a-self-signed-certificate=<br />
To create a certificate with a domain:<br />
<br />
<pre>export HOSTNAME=example.org</pre><br />
<br />
From within ~/.weechat/ssl do:<br />
<pre>openssl req -x509 -nodes -newkey rsa:2048 -keyout relay.pem -extensions san_env \<br />
-subj "/O=WeeChat/CN=$HOSTNAME" \<br />
-config <(cat /etc/ssl/openssl.cnf <(printf "\n[ san_env ]\nsubjectAltName=DNS:\${ENV::HOSTNAME}")) \<br />
-days 365 -out relay.pem</pre><br />
<br />
Then within weechat, reload to the new certificate<br />
<br />
<pre>/relay sslcertkey</pre><br />
<br />
=DNS with rndc=<br />
<br />
==Manipulating dns with rndc==<br />
<br />
login to the computer/vm that takes care of DNS<br />
<br />
ZONE=<domain>.<countrycode> ; rndc freeze $ZONE && vi /etc/bind/$ZONE.zone ; rndc thaw $ZONE ; tail -f /var/log/daemon.log<br />
<br />
Do it like this:<br />
<br />
<pre>rndc freeze domain.no</pre><br />
<br />
Edit stuff in open and you can add stuff:<br />
<br />
<pre><text-editor> /etc/bind/domain.no.zone</pre><br />
<br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Example</strong><br />
|-<br />
| If you use the text editor nano it will look like this: <br />
<pre>nano /etc/bind/domain.no.zone</pre><br />
|}<br />
<br />
Edit the file according to this:<br />
<br />
<pre><vm-domain-name-vm> AAAA ipv6-adr<br />
<vm-domain-name-vm> A ipv4-adr<br />
<br />
<vm-domain-name> CNAME <vm-domain-name></pre><br />
<br />
example:<br />
<br />
<pre>test-vm AAAA ipv6-adr<br />
test-vm A ipv4-adr<br />
<br />
test CNAME test-vm</pre><br />
<br />
Don't have same domain on both A/AAAA and CNAME<br />
<br />
Before you save and exit, add serial number to zone-file format: YYYYMMDDxx<br />
<br />
Oneliner to run. change domain.no to your domain<br />
<br />
<pre>rndc freeze domain.no && vi /etc/bind/karlsbakk.net.zone ; rndc thaw domain.no ; tail -f /var/log/daemon.log</pre><br />
<br />
==Local script to run==<br />
<br />
Open the local [https://github.com/rkarlsba/ymse/blob/master/ddns/ddns-update.sh ddns-update.sh] script and add test-vm to VM= variabel if not already present<br />
<br />
If you don't want to wait for the script to run automatically from cron, run it with the force flag<br />
<br />
<pre>ddns-update.sh --force</pre><br />
<br />
=SSH=<br />
<br />
==TAB-complete==<br />
<br />
<pre>vi .ssh/config</pre><br />
<br />
Then add lines like this:<br />
<br />
<pre><br />
Host <name> # space between multiple names<br />
user admin # optional if you want to add username to log in with<br />
Hostname <ipaddress>/<domain/hostname><br />
Port 2022 # optional add if port is other than default 22<br />
</pre><br />
<br />
Example <br />
<pre><br />
Host test-vm test<br />
Hostname test-vm.test.no<br />
<br />
</pre><br />
<br />
== postgres ==<br />
https://stackoverflow.com/questions/32439167/psql-could-not-connect-to-server-connection-refused-error-when-connecting-to</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Malin%27s_notes&diff=404Malin's notes2022-10-25T13:05:03Z<p>Wiki.malinux.no: /* Manipulating dns with rndc */</p>
<hr />
<div>==gnu/linux==<br />
<br />
To change ownership of everything that's not already owned by a user<br />
<br />
find /home/rtorrent/ ! -user rtorrent -exec chown rtorrent:rtorrent {} \; &<br />
<br />
==rtl8812AU==<br />
https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git<br />
<br />
remove led-disco<br />
<br />
/etc/modprobe.d/8188eu-blacklist.conf<br />
<br />
options 8812au rtw_led_enable=0<br />
<br />
==LVM==<br />
===[https://blog.raveland.tech/post/rename_vg/ rename Volume Group (VG)]===<br />
<br />
==mdadm==<br />
for dev in $( lsblk | awk '/sd[a-z].*1,8T/ { print }' ); do echo =============================== $dev ============================ ; smartctl -a /dev/$dev ; done | pastebinit<br />
<br />
<br />
<br />
mdadm --remove /dev/md0 failed # all failed devices<br />
<br />
mdadm --remove /dev/md0 detached # failed ones that aren't in /dev anymore<br />
<br />
ip addr add 192.168.0.101/24 dev eth0 ; ip route add default via 192.168.0.1 dev eth0<br />
<br />
<br />
<br />
Mulig rekkefølge med forbehold om at et ikke stemmer, for å endre vg navn på vg med root-partisjon<br />
vgchange gammel-vg ny-vg<br />
vgchange -ay<br />
<br />
endre i /etc/fstab<br />
<br />
grub-install /dev/XxX<br />
<br />
update-initramfs -k all -u<br />
<br />
reboot<br />
<br />
=Crossflash Dell PERC H200 from ir to it-mode=<br />
<br />
==The short answer== <br />
I slightly followed this guide:<br />
<br />
https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/<br />
<br />
The longer answer is. I followed the guide, this way, but did it a little different<br />
<br />
==The longer answer==<br />
<br />
Prepare a usb memory stick formatted as fat32 with two folders called P07 and P20<br />
<br />
===Step 1 download old firmware===<br />
<br />
1. Download this zip archive from dell and unzip it: https://downloads.dell.com/FOLDER02950081M/1/Y2R1T_9211_FW.zip?uid=f06bb69a-8c88-4a54-ac7b-ee8826244140&fn=Y2R1T_9211_FW.zip<br />
<br />
2. Extract 6GBPSAS.FW from Y2R1T_9211_FW/Firmware/6GbpsSASHBA_07.03.06.00_A10<br />
<br />
3. Extract 2118it.bin from FY2R1T_9211_FW/Firmware/9211-8i_P7/<br />
<br />
4. Extract sas2flash.efi from Y2R1T_9211_FW/sas2flash/p05/efi/<br />
<br />
5. Place the three extracted files in the P07 folder<br />
<br />
===Step 2 download current firmware===<br />
<br />
1. Extract 2118it.bin from Y2R1T_9211_FW/Firmware/9211-8i/P20/<br />
<br />
2. Download this zip https://docs.broadcom.com/docs-and-downloads/host-bus-adapters/host-bus-adapters-common-files/sas_sata_6g_p20/Installer_P20_for_UEFI.zip<br />
<br />
3. Extract sas2flash.efi from Installer_P20_for_UEFI/sas2flash_efi_ebc_rel/<br />
<br />
4. Place this to extracted files in the P20 folder<br />
<br />
===Step 3 download uefi shell===<br />
1. Download an uefi shell: [https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Obtaining_UEFI_Shell x86_64 UEFI SHELL] I choosed version 1 as it worked for the person in the guide [https://github.com/tianocore/edk2/raw/UDK2018/EdkShellBinPkg/FullShell/X64/Shell_Full.efi Direct download link]<br />
<br />
2. Extract Shell_Full.efi to the root of the memory stick. I had to rename it to Shellx64.efi to use it with my motherboard, asus P8H67_M_EVO. Check with you motherboard vendor to determine how to use efi-shell<br />
<br />
===Step 4 flashing===<br />
<br />
1. boot computer to efi shell<br />
<br />
2. If not present with a list with devices, type <pre>map -b</pre><br />
<br />
2. On my computer the memory stick is called fs0 so I typed fs0: to change prompt to the memory stick<br />
<br />
3. <pre>cd P07</pre><br />
<br />
4. <pre>sas2flash -listall</pre>will show the controller. If not, check if it is installed to a pci-e port<br />
<br />
5. <pre>sas2flash.efi -c 0 -list</pre> will show controller details and take a note of the sas address number<br />
<br />
6. <pre>sas2flash.efi -o -e 6</pre> will erase the old firmware and boot rom<br />
<br />
7. <pre>sas2flash.efi -o -f 6GBPSAS.FW</pre> writes the dell 6gbs firmware<br />
<br />
8. <pre>sas2flash.efi -o -f 2118it.bin</pre> writes the P07 firmware<br />
<br />
9. Then I rebooted<br />
<br />
10. boot into efi again<br />
<br />
11. <pre>cd P20</pre><br />
<br />
12. <pre>sas2flash.efi -o -f 2118it.bin writes the P20 firmware</pre><br />
<br />
===Notes===<br />
Directly copied from the source, step number changed to fit my tutorial:<br />
<br />
1. Step 6 showed “Erasing Flash Region” and then after a while “ERROR: Erase Flash Operation Failed!”. I simply proceeded and the error did not appear to affect anything.<br />
<br />
2. Visit [https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/ source] to get screenshots vit the error messages<br />
<br />
=Compile rtorrent libtorrent and xmlrpc-c=<br />
==libtorrent==<br />
==rtorrent==<br />
./configure --prefix=/usr --with-xmlrpc-c |tee /tmp/conf.log<br />
<br />
=vim=<br />
<br />
# Merk Noe Og Trykk U For Å Få Det I Lowercase, U For Uppercase ;)<br />
# stor v for visual line eller liten for visual der du må merke noe manuelt<br />
# ok. jeg glemte å markere først :p<br />
# oki :)<br />
<br />
# iT'S cAPS lOCK DAY!<br />
<br />
# trykk ~ for å endre fra stor til liten bokstav ;)<br />
<br />
=grub=<br />
<br />
==Repair GRUB from Windows==<br />
<br />
To repair efi bootloader/grub from windows<br />
<br />
Open powershell as admin and execute the following command<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\{distro}\grubx64.efi</pre><br />
<br />
if you are running debian, it will look like this:<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\debian\grubx64.efi</pre><br />
<br />
=libvirt=<br />
<br />
==setup new vm from a template==<br />
<br />
If you have a qcow2 vm template, clone it.:<br />
<br />
If you clone a qcow2 in use, stop the vm first:<br />
<br />
<pre>virsh stop {domain-vm-name}</pre><br />
<br />
Then clone the qcow2<br />
<br />
<pre>virt-clone --original {Domain-Vm-Name-Here} --name {New-Domain-Vm-Name-Here} --auto-clone</pre><br />
<br />
Configure your VM to your likings either by virt-manager (gui) or by cli<br />
<br />
Start the new vm and log in, either by ssh, or via virt-manager<br />
<br />
Change hostname to match the new name of the VM<br />
<br />
<pre>sudo -i<br />
vi /etc/hostname</pre><br />
<br />
<br />
<pre>vi /etc/hosts</pre> to match the name of the new VM<br />
<br />
Example. change:<br />
<br />
<pre>127.0.1.1 debian-stretch-mal.debian-stretch-mal.local debian-stretch-mal</pre><br />
<br />
to<br />
<pre>127.0.1.1 new-name-vm.new-name-vm.local new-name-vm</pre><br />
<br />
Also add a line for the ip to the server who runs the VM and for the backup server if you have one, like this<br />
<br />
<pre>192.168.X.X hostname.domain.xx hostname</pre><br />
<br />
<br />
change local ip to a free address<br />
<br />
<pre> vi /etc/network/interfaces</pre><br />
<br />
and add the new ip in on the host <br />
<pre>/etc/hosts</pre><br />
<br />
Make ssh keys:<br />
<br />
<pre>ssh-keygen</pre><br />
go with the defaults by hit enter, when prompted for questions<br />
<br />
copy the the public key from <pre>.ssh/id_rsa.pub</pre><br />
<br />
If bareos is setup on the qcow2 vm template you also need to change the following line in bareos filedaemon config to match your new vm<br />
<br />
<pre>vi /etc/bareos/bareos-fd.conf<br />
<br />
FileDaemon {<br />
Name = new-name-vm.domain.xx-fd </pre><br />
<br />
*sources<br />
https://www.cyberciti.biz/faq/how-to-clone-existing-kvm-virtual-machine-images-on-linux/<br />
<br />
=add bareos client=<br />
<br />
If you already have a bareos backup server<br />
<br />
on the new vm or computer you want to backup to bareos<br />
<br />
Install bareos-filedaemon on the client if it's not already installed<br />
<pre> apt install bareos-filedaemon<br />
systemctl enable bareos-filedaemon.service</pre><br />
<br />
<br />
Then log into the bareos server and run bconsole<br />
<br />
<pre>configure add client name=new-name-vm address=192.168.X.X password=SOME_PASSWORD</pre><br />
<br />
Then the config is saved to<br />
<pre>/etc/bareos/bareos-dir-export/client/svennd/bareos-fd.d/director/bareos-dir.conf</pre><br />
<br />
Copy it to the client in:<br />
<pre>/etc/bareos/bareos-fd.d/directory/bareos-dir.conf</pre><br />
<br />
<br />
*sources<br />
https://www.svennd.be/adding-a-linux-client-to-bareos/<br />
<br />
<br />
=IRC=<br />
==Renew ssl cert==<br />
source= https://github.com/ubergeek42/weechat-android/wiki/Using-SSL-with-WeeChat#generating-a-self-signed-certificate=<br />
To create a certificate with a domain:<br />
<br />
<pre>export HOSTNAME=example.org</pre><br />
<br />
From within ~/.weechat/ssl do:<br />
<pre>openssl req -x509 -nodes -newkey rsa:2048 -keyout relay.pem -extensions san_env \<br />
-subj "/O=WeeChat/CN=$HOSTNAME" \<br />
-config <(cat /etc/ssl/openssl.cnf <(printf "\n[ san_env ]\nsubjectAltName=DNS:\${ENV::HOSTNAME}")) \<br />
-days 365 -out relay.pem</pre><br />
<br />
Then within weechat, reload to the new certificate<br />
<br />
<pre>/relay sslcertkey</pre><br />
<br />
=DNS with rndc=<br />
<br />
==Manipulating dns with rndc==<br />
<br />
login to the computer/vm that takes care of DNS<br />
<br />
ZONE=<domain>.<countrycode> ; rndc freeze $ZONE && vi /etc/bind/$ZONE.zone ; rndc thaw $ZONE ; tail -f /var/log/daemon.log<br />
<br />
Do it like this:<br />
<br />
<pre>rndc freeze domain.no</pre><br />
<br />
Edit stuff in open and you can add stuff:<br />
<br />
<pre><text-editor> /etc/bind/domain.no.zone</pre><br />
<br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Example</strong><br />
|-<br />
| If you use the text editor nano it will look like this: <br />
<pre>nano /etc/bind/domain.no.zone</pre><br />
|}<br />
<br />
Edit the file according to this:<br />
<br />
<pre><vm-domain-name-vm> AAAA ipv6-adr<br />
<vm-domain-name-vm> A ipv4-adr<br />
<br />
<vm-domain-name> CNAME <vm-domain-name></pre><br />
<br />
example:<br />
<br />
<pre>test-vm AAAA ipv6-adr<br />
test-vm A ipv4-adr<br />
<br />
test CNAME test-vm</pre><br />
<br />
Don't have same domain on both A/AAAA and CNAME<br />
<br />
Before you save and exit, add serial number to zone-file format: YYYYMMDDxx<br />
<br />
Oneliner to run<br />
<br />
<pre>rndc freeze domain.no && vi /etc/bind/karlsbakk.net.zone ; rndc thaw karlsbakk.net ; tail -f /var/log/daemon.log</pre><br />
<br />
==Local script to run==<br />
<br />
Open the local [https://github.com/rkarlsba/ymse/blob/master/ddns/ddns-update.sh ddns-update.sh] script and add test-vm to VM= variabel if not already present<br />
<br />
If you don't want to wait for the script to run automatically from cron, run it with the force flag<br />
<br />
<pre>ddns-update.sh --force</pre><br />
<br />
=SSH=<br />
<br />
==TAB-complete==<br />
<br />
<pre>vi .ssh/config</pre><br />
<br />
Then add lines like this:<br />
<br />
<pre><br />
Host <name> # space between multiple names<br />
user admin # optional if you want to add username to log in with<br />
Hostname <ipaddress>/<domain/hostname><br />
Port 2022 # optional add if port is other than default 22<br />
</pre><br />
<br />
Example <br />
<pre><br />
Host test-vm test<br />
Hostname test-vm.test.no<br />
<br />
</pre><br />
<br />
== postgres ==<br />
https://stackoverflow.com/questions/32439167/psql-could-not-connect-to-server-connection-refused-error-when-connecting-to</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Malin%27s_notes&diff=403Malin's notes2022-10-25T13:04:25Z<p>Wiki.malinux.no: /* Manipulating dns with rndc */</p>
<hr />
<div>==gnu/linux==<br />
<br />
To change ownership of everything that's not already owned by a user<br />
<br />
find /home/rtorrent/ ! -user rtorrent -exec chown rtorrent:rtorrent {} \; &<br />
<br />
==rtl8812AU==<br />
https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git<br />
<br />
remove led-disco<br />
<br />
/etc/modprobe.d/8188eu-blacklist.conf<br />
<br />
options 8812au rtw_led_enable=0<br />
<br />
==LVM==<br />
===[https://blog.raveland.tech/post/rename_vg/ rename Volume Group (VG)]===<br />
<br />
==mdadm==<br />
for dev in $( lsblk | awk '/sd[a-z].*1,8T/ { print }' ); do echo =============================== $dev ============================ ; smartctl -a /dev/$dev ; done | pastebinit<br />
<br />
<br />
<br />
mdadm --remove /dev/md0 failed # all failed devices<br />
<br />
mdadm --remove /dev/md0 detached # failed ones that aren't in /dev anymore<br />
<br />
ip addr add 192.168.0.101/24 dev eth0 ; ip route add default via 192.168.0.1 dev eth0<br />
<br />
<br />
<br />
Mulig rekkefølge med forbehold om at et ikke stemmer, for å endre vg navn på vg med root-partisjon<br />
vgchange gammel-vg ny-vg<br />
vgchange -ay<br />
<br />
endre i /etc/fstab<br />
<br />
grub-install /dev/XxX<br />
<br />
update-initramfs -k all -u<br />
<br />
reboot<br />
<br />
=Crossflash Dell PERC H200 from ir to it-mode=<br />
<br />
==The short answer== <br />
I slightly followed this guide:<br />
<br />
https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/<br />
<br />
The longer answer is. I followed the guide, this way, but did it a little different<br />
<br />
==The longer answer==<br />
<br />
Prepare a usb memory stick formatted as fat32 with two folders called P07 and P20<br />
<br />
===Step 1 download old firmware===<br />
<br />
1. Download this zip archive from dell and unzip it: https://downloads.dell.com/FOLDER02950081M/1/Y2R1T_9211_FW.zip?uid=f06bb69a-8c88-4a54-ac7b-ee8826244140&fn=Y2R1T_9211_FW.zip<br />
<br />
2. Extract 6GBPSAS.FW from Y2R1T_9211_FW/Firmware/6GbpsSASHBA_07.03.06.00_A10<br />
<br />
3. Extract 2118it.bin from FY2R1T_9211_FW/Firmware/9211-8i_P7/<br />
<br />
4. Extract sas2flash.efi from Y2R1T_9211_FW/sas2flash/p05/efi/<br />
<br />
5. Place the three extracted files in the P07 folder<br />
<br />
===Step 2 download current firmware===<br />
<br />
1. Extract 2118it.bin from Y2R1T_9211_FW/Firmware/9211-8i/P20/<br />
<br />
2. Download this zip https://docs.broadcom.com/docs-and-downloads/host-bus-adapters/host-bus-adapters-common-files/sas_sata_6g_p20/Installer_P20_for_UEFI.zip<br />
<br />
3. Extract sas2flash.efi from Installer_P20_for_UEFI/sas2flash_efi_ebc_rel/<br />
<br />
4. Place this to extracted files in the P20 folder<br />
<br />
===Step 3 download uefi shell===<br />
1. Download an uefi shell: [https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Obtaining_UEFI_Shell x86_64 UEFI SHELL] I choosed version 1 as it worked for the person in the guide [https://github.com/tianocore/edk2/raw/UDK2018/EdkShellBinPkg/FullShell/X64/Shell_Full.efi Direct download link]<br />
<br />
2. Extract Shell_Full.efi to the root of the memory stick. I had to rename it to Shellx64.efi to use it with my motherboard, asus P8H67_M_EVO. Check with you motherboard vendor to determine how to use efi-shell<br />
<br />
===Step 4 flashing===<br />
<br />
1. boot computer to efi shell<br />
<br />
2. If not present with a list with devices, type <pre>map -b</pre><br />
<br />
2. On my computer the memory stick is called fs0 so I typed fs0: to change prompt to the memory stick<br />
<br />
3. <pre>cd P07</pre><br />
<br />
4. <pre>sas2flash -listall</pre>will show the controller. If not, check if it is installed to a pci-e port<br />
<br />
5. <pre>sas2flash.efi -c 0 -list</pre> will show controller details and take a note of the sas address number<br />
<br />
6. <pre>sas2flash.efi -o -e 6</pre> will erase the old firmware and boot rom<br />
<br />
7. <pre>sas2flash.efi -o -f 6GBPSAS.FW</pre> writes the dell 6gbs firmware<br />
<br />
8. <pre>sas2flash.efi -o -f 2118it.bin</pre> writes the P07 firmware<br />
<br />
9. Then I rebooted<br />
<br />
10. boot into efi again<br />
<br />
11. <pre>cd P20</pre><br />
<br />
12. <pre>sas2flash.efi -o -f 2118it.bin writes the P20 firmware</pre><br />
<br />
===Notes===<br />
Directly copied from the source, step number changed to fit my tutorial:<br />
<br />
1. Step 6 showed “Erasing Flash Region” and then after a while “ERROR: Erase Flash Operation Failed!”. I simply proceeded and the error did not appear to affect anything.<br />
<br />
2. Visit [https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/ source] to get screenshots vit the error messages<br />
<br />
=Compile rtorrent libtorrent and xmlrpc-c=<br />
==libtorrent==<br />
==rtorrent==<br />
./configure --prefix=/usr --with-xmlrpc-c |tee /tmp/conf.log<br />
<br />
=vim=<br />
<br />
# Merk Noe Og Trykk U For Å Få Det I Lowercase, U For Uppercase ;)<br />
# stor v for visual line eller liten for visual der du må merke noe manuelt<br />
# ok. jeg glemte å markere først :p<br />
# oki :)<br />
<br />
# iT'S cAPS lOCK DAY!<br />
<br />
# trykk ~ for å endre fra stor til liten bokstav ;)<br />
<br />
=grub=<br />
<br />
==Repair GRUB from Windows==<br />
<br />
To repair efi bootloader/grub from windows<br />
<br />
Open powershell as admin and execute the following command<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\{distro}\grubx64.efi</pre><br />
<br />
if you are running debian, it will look like this:<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\debian\grubx64.efi</pre><br />
<br />
=libvirt=<br />
<br />
==setup new vm from a template==<br />
<br />
If you have a qcow2 vm template, clone it.:<br />
<br />
If you clone a qcow2 in use, stop the vm first:<br />
<br />
<pre>virsh stop {domain-vm-name}</pre><br />
<br />
Then clone the qcow2<br />
<br />
<pre>virt-clone --original {Domain-Vm-Name-Here} --name {New-Domain-Vm-Name-Here} --auto-clone</pre><br />
<br />
Configure your VM to your likings either by virt-manager (gui) or by cli<br />
<br />
Start the new vm and log in, either by ssh, or via virt-manager<br />
<br />
Change hostname to match the new name of the VM<br />
<br />
<pre>sudo -i<br />
vi /etc/hostname</pre><br />
<br />
<br />
<pre>vi /etc/hosts</pre> to match the name of the new VM<br />
<br />
Example. change:<br />
<br />
<pre>127.0.1.1 debian-stretch-mal.debian-stretch-mal.local debian-stretch-mal</pre><br />
<br />
to<br />
<pre>127.0.1.1 new-name-vm.new-name-vm.local new-name-vm</pre><br />
<br />
Also add a line for the ip to the server who runs the VM and for the backup server if you have one, like this<br />
<br />
<pre>192.168.X.X hostname.domain.xx hostname</pre><br />
<br />
<br />
change local ip to a free address<br />
<br />
<pre> vi /etc/network/interfaces</pre><br />
<br />
and add the new ip in on the host <br />
<pre>/etc/hosts</pre><br />
<br />
Make ssh keys:<br />
<br />
<pre>ssh-keygen</pre><br />
go with the defaults by hit enter, when prompted for questions<br />
<br />
copy the the public key from <pre>.ssh/id_rsa.pub</pre><br />
<br />
If bareos is setup on the qcow2 vm template you also need to change the following line in bareos filedaemon config to match your new vm<br />
<br />
<pre>vi /etc/bareos/bareos-fd.conf<br />
<br />
FileDaemon {<br />
Name = new-name-vm.domain.xx-fd </pre><br />
<br />
*sources<br />
https://www.cyberciti.biz/faq/how-to-clone-existing-kvm-virtual-machine-images-on-linux/<br />
<br />
=add bareos client=<br />
<br />
If you already have a bareos backup server<br />
<br />
on the new vm or computer you want to backup to bareos<br />
<br />
Install bareos-filedaemon on the client if it's not already installed<br />
<pre> apt install bareos-filedaemon<br />
systemctl enable bareos-filedaemon.service</pre><br />
<br />
<br />
Then log into the bareos server and run bconsole<br />
<br />
<pre>configure add client name=new-name-vm address=192.168.X.X password=SOME_PASSWORD</pre><br />
<br />
Then the config is saved to<br />
<pre>/etc/bareos/bareos-dir-export/client/svennd/bareos-fd.d/director/bareos-dir.conf</pre><br />
<br />
Copy it to the client in:<br />
<pre>/etc/bareos/bareos-fd.d/directory/bareos-dir.conf</pre><br />
<br />
<br />
*sources<br />
https://www.svennd.be/adding-a-linux-client-to-bareos/<br />
<br />
<br />
=IRC=<br />
==Renew ssl cert==<br />
source= https://github.com/ubergeek42/weechat-android/wiki/Using-SSL-with-WeeChat#generating-a-self-signed-certificate=<br />
To create a certificate with a domain:<br />
<br />
<pre>export HOSTNAME=example.org</pre><br />
<br />
From within ~/.weechat/ssl do:<br />
<pre>openssl req -x509 -nodes -newkey rsa:2048 -keyout relay.pem -extensions san_env \<br />
-subj "/O=WeeChat/CN=$HOSTNAME" \<br />
-config <(cat /etc/ssl/openssl.cnf <(printf "\n[ san_env ]\nsubjectAltName=DNS:\${ENV::HOSTNAME}")) \<br />
-days 365 -out relay.pem</pre><br />
<br />
Then within weechat, reload to the new certificate<br />
<br />
<pre>/relay sslcertkey</pre><br />
<br />
=DNS with rndc=<br />
<br />
==Manipulating dns with rndc==<br />
<br />
login to the computer/vm that takes care of DNS<br />
<br />
ZONE=<domain>.<countrycode> ; rndc freeze $ZONE && vi /etc/bind/$ZONE.zone ; rndc thaw $ZONE ; tail -f /var/log/daemon.log<br />
<br />
Do it like this:<br />
<br />
<pre>rndc freeze domain.no</pre><br />
<br />
Edit stuff in open and you can add stuff:<br />
<br />
<pre><text-editor> /etc/bind/domain.no.zone</pre><br />
<br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Example</strong><br />
|-<br />
| If you use the text editor nano it will look like this: <br />
<pre>nano /etc/bind/domain.no.zone</pre><br />
|}<br />
<br />
Edit the file according to this:<br />
<br />
<pre><vm-domain-name-vm> AAAA ipv6-adr<br />
<vm-domain-name-vm> A ipv4-adr<br />
<br />
<vm-domain-name> CNAME <vm-domain-name></pre><br />
<br />
example:<br />
<br />
<pre>test-vm AAAA ipv6-adr<br />
test-vm A ipv4-adr<br />
<br />
test CNAME test-vm</pre><br />
<br />
Don't have same domain on both A/AAAA and CNAME<br />
<br />
Before you save and exit, add serial number to zone-file format: YYYYMMDDxx<br />
<br />
Oneliner to run<br />
<br />
<pre>rndc freeze karlsbakk.net && vi /etc/bind/karlsbakk.net.zone ; rndc thaw karlsbakk.net ; tail -f /var/log/daemon.log</pre><br />
<br />
==Local script to run==<br />
<br />
Open the local [https://github.com/rkarlsba/ymse/blob/master/ddns/ddns-update.sh ddns-update.sh] script and add test-vm to VM= variabel if not already present<br />
<br />
If you don't want to wait for the script to run automatically from cron, run it with the force flag<br />
<br />
<pre>ddns-update.sh --force</pre><br />
<br />
=SSH=<br />
<br />
==TAB-complete==<br />
<br />
<pre>vi .ssh/config</pre><br />
<br />
Then add lines like this:<br />
<br />
<pre><br />
Host <name> # space between multiple names<br />
user admin # optional if you want to add username to log in with<br />
Hostname <ipaddress>/<domain/hostname><br />
Port 2022 # optional add if port is other than default 22<br />
</pre><br />
<br />
Example <br />
<pre><br />
Host test-vm test<br />
Hostname test-vm.test.no<br />
<br />
</pre><br />
<br />
== postgres ==<br />
https://stackoverflow.com/questions/32439167/psql-could-not-connect-to-server-connection-refused-error-when-connecting-to</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Main_Page&diff=402Main Page2022-10-22T12:24:36Z<p>Wiki.malinux.no: </p>
<hr />
<div>Malin's wise words always come close to insanity…<br />
<br />
* [[libvirt TRIM/UNMAP]]<br />
* [[Malin's_notes]]<br />
* [[Roy's notes]]<br />
* [[Gaming]]<br />
* [[NUUG]]<br />
* [[green-mamba]] A gaming server in planning<br />
* [[norge-wiki]] wiki for irc-kanalen #norge</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Main_Page&diff=401Main Page2022-10-22T12:24:12Z<p>Wiki.malinux.no: </p>
<hr />
<div>Malin's wise words always come close to insanity…<br />
<br />
* [[libvirt TRIM/UNMAP]]<br />
* [[Malin's_notes]]<br />
* [[Roy's notes]]<br />
* [[Gaming]]<br />
* [[NUUG]]<br />
* [[green-mamba]] A gaming server in planning<br />
* [[#norge-wiki]] wiki for irc-kanalen #norge</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Nintendo_Switch&diff=400Nintendo Switch2022-10-18T21:12:47Z<p>Wiki.malinux.no: /* Install Yumu Emulator */</p>
<hr />
<div>=Yuzu-emulator=<br />
<br />
==Install Yumu Emulator==<br />
<br />
===Windows:===<br />
<br />
Visit this url and download the windows installer<br />
https://yuzu-emu.org/downloads/<br />
<br />
===Arch Linux:===<br />
yay -S yuzu<br />
<br />
===Flatpak:===<br />
flatpak install yuzu<br />
<br />
==Add keys==<br />
<br />
Download latest keys from:<br />
https://raw.githubusercontent.com/HiDe-Techno-Tips/Nintendo-Switch-Files/main/prod.keys<br />
<br />
Add them to a file called prod.keys like this:<br />
<br />
===In windows:===<br />
<pre>Appdata\Roaming\yuzu\keys\prod.keys</pre><br />
<br />
===In Arch Linux:===<br />
<br />
<pre> cd /home/$USER/.local/share/yuzu/keys<br />
wget https://raw.githubusercontent.com/HiDe-Techno-Tips/Nintendo-Switch-Files/main/prod.keys<br />
</pre><br />
<br />
===Flatpak I don't know atm:===<br />
<br />
<pre> in some folder :p </pre><br />
<br />
==Add firmware===<br />
<br />
Visit https://archive.org/download/yuzu-emulator-firmware-dumps<br />
And download the firmware you like to use. Example the latest<br />
<br />
unzip the zip and extract all the content to the correct folder<br />
<br />
===In Windows:===<br />
<br />
<pre>Appdata\Roaming\yuzu\nand\system\Contents\registered\</pre><br />
<br />
===In Arch:===<br />
<pre>/home/$USER/.local/share/yuzu/nand/system/Contents/registered/<br />
<br />
===With Flatpak I don't know atm===<br />
<br />
<pre>/some/folder/</pre></div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Nintendo_Switch&diff=399Nintendo Switch2022-10-18T21:12:28Z<p>Wiki.malinux.no: </p>
<hr />
<div>=Yuzu-emulator=<br />
<br />
==Install Yumu Emulator==<br />
<br />
===Windows:===<br />
<br />
Visit this url and download the windows installer<br />
https://yuzu-emu.org/downloads/<br />
<br />
===Arch Linux===<br />
yay -S yuzu<br />
<br />
===Flatpak===<br />
flatpak install yuzu<br />
<br />
==Add keys==<br />
<br />
Download latest keys from:<br />
https://raw.githubusercontent.com/HiDe-Techno-Tips/Nintendo-Switch-Files/main/prod.keys<br />
<br />
Add them to a file called prod.keys like this:<br />
<br />
===In windows:===<br />
<pre>Appdata\Roaming\yuzu\keys\prod.keys</pre><br />
<br />
===In Arch Linux:===<br />
<br />
<pre> cd /home/$USER/.local/share/yuzu/keys<br />
wget https://raw.githubusercontent.com/HiDe-Techno-Tips/Nintendo-Switch-Files/main/prod.keys<br />
</pre><br />
<br />
===Flatpak I don't know atm:===<br />
<br />
<pre> in some folder :p </pre><br />
<br />
==Add firmware===<br />
<br />
Visit https://archive.org/download/yuzu-emulator-firmware-dumps<br />
And download the firmware you like to use. Example the latest<br />
<br />
unzip the zip and extract all the content to the correct folder<br />
<br />
===In Windows:===<br />
<br />
<pre>Appdata\Roaming\yuzu\nand\system\Contents\registered\</pre><br />
<br />
===In Arch:===<br />
<pre>/home/$USER/.local/share/yuzu/nand/system/Contents/registered/<br />
<br />
===With Flatpak I don't know atm===<br />
<br />
<pre>/some/folder/</pre></div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Nintendo_Switch&diff=398Nintendo Switch2022-10-18T21:07:47Z<p>Wiki.malinux.no: /* Add keys */</p>
<hr />
<div>=Yuzu-emulator=<br />
<br />
==Install Yumu Emulator==<br />
<br />
===Windows:===<br />
<br />
Visit this url and download the windows installer<br />
https://yuzu-emu.org/downloads/<br />
<br />
===Arch Linux===<br />
yay -S yuzu<br />
<br />
===Flatpak===<br />
flatpak install yuzu<br />
<br />
==Add keys==<br />
<br />
Download latest keys from:<br />
https://raw.githubusercontent.com/HiDe-Techno-Tips/Nintendo-Switch-Files/main/prod.keys<br />
<br />
Add them to a file called prod.keys like this:<br />
<br />
===In windows:===<br />
<pre>Appdata\Roaming\yuzu\keys\prod.keys</pre><br />
<br />
===In Arch Linux:===<br />
<br />
<pre> cd /home/$USER/.local/share/yuzu/keys<br />
wget https://raw.githubusercontent.com/HiDe-Techno-Tips/Nintendo-Switch-Files/main/prod.keys<br />
</pre><br />
<br />
===Flatpak I don't know atm:===<br />
<br />
<pre> in some folder :p </pre></div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Nintendo_Switch&diff=397Nintendo Switch2022-10-18T21:05:51Z<p>Wiki.malinux.no: Created page with "=Yuzu-emulator= ==Install Yumu Emulator== ===Windows:=== Visit this url and download the windows installer https://yuzu-emu.org/downloads/ ===Arch Linux=== yay -S yuzu ==..."</p>
<hr />
<div>=Yuzu-emulator=<br />
<br />
==Install Yumu Emulator==<br />
<br />
===Windows:===<br />
<br />
Visit this url and download the windows installer<br />
https://yuzu-emu.org/downloads/<br />
<br />
===Arch Linux===<br />
yay -S yuzu<br />
<br />
===Flatpak===<br />
flatpak install yuzu<br />
<br />
=Add keys=<br />
<br />
Download latest keys from:<br />
https://raw.githubusercontent.com/HiDe-Techno-Tips/Nintendo-Switch-Files/main/prod.keys<br />
<br />
Add them to a file called prod.keys like this:<br />
<br />
In windows:<br />
<pre>Appdata\Roaming\yuzu\keys\prod.keys</pre><br />
<br />
In Arch Linux:<br />
<br />
<pre>/home/$USER/.local/share/yuzu/keys</pre><br />
<br />
With flatpak I don't know atm:<br />
<br />
<pre> in some folder :p </pre></div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Emulating&diff=396Emulating2022-10-18T20:54:17Z<p>Wiki.malinux.no: Created page with "Nintendo Switch"</p>
<hr />
<div>[[Nintendo Switch]]</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Gaming&diff=395Gaming2022-10-18T20:53:54Z<p>Wiki.malinux.no: </p>
<hr />
<div>* [[Vrising Dedicated Debian 11 Server WINE]]<br />
* [[ARK: Survival Evolved]]<br />
* [[Emulating]]</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Malin%27s_notes&diff=394Malin's notes2022-10-17T12:16:17Z<p>Wiki.malinux.no: /* Manipulating dns with rndc */</p>
<hr />
<div>==gnu/linux==<br />
<br />
To change ownership of everything that's not already owned by a user<br />
<br />
find /home/rtorrent/ ! -user rtorrent -exec chown rtorrent:rtorrent {} \; &<br />
<br />
==rtl8812AU==<br />
https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git<br />
<br />
remove led-disco<br />
<br />
/etc/modprobe.d/8188eu-blacklist.conf<br />
<br />
options 8812au rtw_led_enable=0<br />
<br />
==LVM==<br />
===[https://blog.raveland.tech/post/rename_vg/ rename Volume Group (VG)]===<br />
<br />
==mdadm==<br />
for dev in $( lsblk | awk '/sd[a-z].*1,8T/ { print }' ); do echo =============================== $dev ============================ ; smartctl -a /dev/$dev ; done | pastebinit<br />
<br />
<br />
<br />
mdadm --remove /dev/md0 failed # all failed devices<br />
<br />
mdadm --remove /dev/md0 detached # failed ones that aren't in /dev anymore<br />
<br />
ip addr add 192.168.0.101/24 dev eth0 ; ip route add default via 192.168.0.1 dev eth0<br />
<br />
<br />
<br />
Mulig rekkefølge med forbehold om at et ikke stemmer, for å endre vg navn på vg med root-partisjon<br />
vgchange gammel-vg ny-vg<br />
vgchange -ay<br />
<br />
endre i /etc/fstab<br />
<br />
grub-install /dev/XxX<br />
<br />
update-initramfs -k all -u<br />
<br />
reboot<br />
<br />
=Crossflash Dell PERC H200 from ir to it-mode=<br />
<br />
==The short answer== <br />
I slightly followed this guide:<br />
<br />
https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/<br />
<br />
The longer answer is. I followed the guide, this way, but did it a little different<br />
<br />
==The longer answer==<br />
<br />
Prepare a usb memory stick formatted as fat32 with two folders called P07 and P20<br />
<br />
===Step 1 download old firmware===<br />
<br />
1. Download this zip archive from dell and unzip it: https://downloads.dell.com/FOLDER02950081M/1/Y2R1T_9211_FW.zip?uid=f06bb69a-8c88-4a54-ac7b-ee8826244140&fn=Y2R1T_9211_FW.zip<br />
<br />
2. Extract 6GBPSAS.FW from Y2R1T_9211_FW/Firmware/6GbpsSASHBA_07.03.06.00_A10<br />
<br />
3. Extract 2118it.bin from FY2R1T_9211_FW/Firmware/9211-8i_P7/<br />
<br />
4. Extract sas2flash.efi from Y2R1T_9211_FW/sas2flash/p05/efi/<br />
<br />
5. Place the three extracted files in the P07 folder<br />
<br />
===Step 2 download current firmware===<br />
<br />
1. Extract 2118it.bin from Y2R1T_9211_FW/Firmware/9211-8i/P20/<br />
<br />
2. Download this zip https://docs.broadcom.com/docs-and-downloads/host-bus-adapters/host-bus-adapters-common-files/sas_sata_6g_p20/Installer_P20_for_UEFI.zip<br />
<br />
3. Extract sas2flash.efi from Installer_P20_for_UEFI/sas2flash_efi_ebc_rel/<br />
<br />
4. Place this to extracted files in the P20 folder<br />
<br />
===Step 3 download uefi shell===<br />
1. Download an uefi shell: [https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Obtaining_UEFI_Shell x86_64 UEFI SHELL] I choosed version 1 as it worked for the person in the guide [https://github.com/tianocore/edk2/raw/UDK2018/EdkShellBinPkg/FullShell/X64/Shell_Full.efi Direct download link]<br />
<br />
2. Extract Shell_Full.efi to the root of the memory stick. I had to rename it to Shellx64.efi to use it with my motherboard, asus P8H67_M_EVO. Check with you motherboard vendor to determine how to use efi-shell<br />
<br />
===Step 4 flashing===<br />
<br />
1. boot computer to efi shell<br />
<br />
2. If not present with a list with devices, type <pre>map -b</pre><br />
<br />
2. On my computer the memory stick is called fs0 so I typed fs0: to change prompt to the memory stick<br />
<br />
3. <pre>cd P07</pre><br />
<br />
4. <pre>sas2flash -listall</pre>will show the controller. If not, check if it is installed to a pci-e port<br />
<br />
5. <pre>sas2flash.efi -c 0 -list</pre> will show controller details and take a note of the sas address number<br />
<br />
6. <pre>sas2flash.efi -o -e 6</pre> will erase the old firmware and boot rom<br />
<br />
7. <pre>sas2flash.efi -o -f 6GBPSAS.FW</pre> writes the dell 6gbs firmware<br />
<br />
8. <pre>sas2flash.efi -o -f 2118it.bin</pre> writes the P07 firmware<br />
<br />
9. Then I rebooted<br />
<br />
10. boot into efi again<br />
<br />
11. <pre>cd P20</pre><br />
<br />
12. <pre>sas2flash.efi -o -f 2118it.bin writes the P20 firmware</pre><br />
<br />
===Notes===<br />
Directly copied from the source, step number changed to fit my tutorial:<br />
<br />
1. Step 6 showed “Erasing Flash Region” and then after a while “ERROR: Erase Flash Operation Failed!”. I simply proceeded and the error did not appear to affect anything.<br />
<br />
2. Visit [https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/ source] to get screenshots vit the error messages<br />
<br />
=Compile rtorrent libtorrent and xmlrpc-c=<br />
==libtorrent==<br />
==rtorrent==<br />
./configure --prefix=/usr --with-xmlrpc-c |tee /tmp/conf.log<br />
<br />
=vim=<br />
<br />
# Merk Noe Og Trykk U For Å Få Det I Lowercase, U For Uppercase ;)<br />
# stor v for visual line eller liten for visual der du må merke noe manuelt<br />
# ok. jeg glemte å markere først :p<br />
# oki :)<br />
<br />
# iT'S cAPS lOCK DAY!<br />
<br />
# trykk ~ for å endre fra stor til liten bokstav ;)<br />
<br />
=grub=<br />
<br />
==Repair GRUB from Windows==<br />
<br />
To repair efi bootloader/grub from windows<br />
<br />
Open powershell as admin and execute the following command<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\{distro}\grubx64.efi</pre><br />
<br />
if you are running debian, it will look like this:<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\debian\grubx64.efi</pre><br />
<br />
=libvirt=<br />
<br />
==setup new vm from a template==<br />
<br />
If you have a qcow2 vm template, clone it.:<br />
<br />
If you clone a qcow2 in use, stop the vm first:<br />
<br />
<pre>virsh stop {domain-vm-name}</pre><br />
<br />
Then clone the qcow2<br />
<br />
<pre>virt-clone --original {Domain-Vm-Name-Here} --name {New-Domain-Vm-Name-Here} --auto-clone</pre><br />
<br />
Configure your VM to your likings either by virt-manager (gui) or by cli<br />
<br />
Start the new vm and log in, either by ssh, or via virt-manager<br />
<br />
Change hostname to match the new name of the VM<br />
<br />
<pre>sudo -i<br />
vi /etc/hostname</pre><br />
<br />
<br />
<pre>vi /etc/hosts</pre> to match the name of the new VM<br />
<br />
Example. change:<br />
<br />
<pre>127.0.1.1 debian-stretch-mal.debian-stretch-mal.local debian-stretch-mal</pre><br />
<br />
to<br />
<pre>127.0.1.1 new-name-vm.new-name-vm.local new-name-vm</pre><br />
<br />
Also add a line for the ip to the server who runs the VM and for the backup server if you have one, like this<br />
<br />
<pre>192.168.X.X hostname.domain.xx hostname</pre><br />
<br />
<br />
change local ip to a free address<br />
<br />
<pre> vi /etc/network/interfaces</pre><br />
<br />
and add the new ip in on the host <br />
<pre>/etc/hosts</pre><br />
<br />
Make ssh keys:<br />
<br />
<pre>ssh-keygen</pre><br />
go with the defaults by hit enter, when prompted for questions<br />
<br />
copy the the public key from <pre>.ssh/id_rsa.pub</pre><br />
<br />
If bareos is setup on the qcow2 vm template you also need to change the following line in bareos filedaemon config to match your new vm<br />
<br />
<pre>vi /etc/bareos/bareos-fd.conf<br />
<br />
FileDaemon {<br />
Name = new-name-vm.domain.xx-fd </pre><br />
<br />
*sources<br />
https://www.cyberciti.biz/faq/how-to-clone-existing-kvm-virtual-machine-images-on-linux/<br />
<br />
=add bareos client=<br />
<br />
If you already have a bareos backup server<br />
<br />
on the new vm or computer you want to backup to bareos<br />
<br />
Install bareos-filedaemon on the client if it's not already installed<br />
<pre> apt install bareos-filedaemon<br />
systemctl enable bareos-filedaemon.service</pre><br />
<br />
<br />
Then log into the bareos server and run bconsole<br />
<br />
<pre>configure add client name=new-name-vm address=192.168.X.X password=SOME_PASSWORD</pre><br />
<br />
Then the config is saved to<br />
<pre>/etc/bareos/bareos-dir-export/client/svennd/bareos-fd.d/director/bareos-dir.conf</pre><br />
<br />
Copy it to the client in:<br />
<pre>/etc/bareos/bareos-fd.d/directory/bareos-dir.conf</pre><br />
<br />
<br />
*sources<br />
https://www.svennd.be/adding-a-linux-client-to-bareos/<br />
<br />
<br />
=IRC=<br />
==Renew ssl cert==<br />
source= https://github.com/ubergeek42/weechat-android/wiki/Using-SSL-with-WeeChat#generating-a-self-signed-certificate=<br />
To create a certificate with a domain:<br />
<br />
<pre>export HOSTNAME=example.org</pre><br />
<br />
From within ~/.weechat/ssl do:<br />
<pre>openssl req -x509 -nodes -newkey rsa:2048 -keyout relay.pem -extensions san_env \<br />
-subj "/O=WeeChat/CN=$HOSTNAME" \<br />
-config <(cat /etc/ssl/openssl.cnf <(printf "\n[ san_env ]\nsubjectAltName=DNS:\${ENV::HOSTNAME}")) \<br />
-days 365 -out relay.pem</pre><br />
<br />
Then within weechat, reload to the new certificate<br />
<br />
<pre>/relay sslcertkey</pre><br />
<br />
=DNS with rndc=<br />
<br />
==Manipulating dns with rndc==<br />
<br />
login to the computer/vm that takes care of DNS<br />
<br />
ZONE=<domain>.<countrycode> ; rndc freeze $ZONE && vi /etc/bind/$ZONE.zone ; rndc thaw $ZONE ; tail -f /var/log/daemon.log<br />
<br />
Do it like this:<br />
<br />
<pre>rndc freeze domain.no</pre><br />
<br />
Edit stuff in open and you can add stuff:<br />
<br />
<pre><text-editor> /etc/bind/domain.no.zone</pre><br />
<br />
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"<br />
| <strong>Example</strong><br />
|-<br />
| If you use the text editor nano it will look like this: <br />
<pre>nano /etc/bind/domain.no.zone</pre><br />
|}<br />
<br />
Edit the file according to this:<br />
<br />
<pre><vm-domain-name-vm> AAAA ipv6-adr<br />
<vm-domain-name-vm> A ipv4-adr<br />
<br />
<vm-domain-name> CNAME <vm-domain-name></pre><br />
<br />
example:<br />
<br />
<pre>test-vm AAAA ipv6-adr<br />
test-vm A ipv4-adr<br />
<br />
test CNAME test-vm</pre><br />
<br />
Before you save and exit, add serial number to zone-file format: YYYYMMDDxx<br />
<br />
==Local script to run==<br />
<br />
Open the local [https://github.com/rkarlsba/ymse/blob/master/ddns/ddns-update.sh ddns-update.sh] script and add test-vm to VM= variabel if not already present<br />
<br />
If you don't want to wait for the script to run automatically from cron, run it with the force flag<br />
<br />
<pre>ddns-update.sh --force</pre><br />
<br />
=SSH=<br />
<br />
==TAB-complete==<br />
<br />
<pre>vi .ssh/config</pre><br />
<br />
Then add lines like this:<br />
<br />
<pre><br />
Host <name> # space between multiple names<br />
user admin # optional if you want to add username to log in with<br />
Hostname <ipaddress>/<domain/hostname><br />
Port 2022 # optional add if port is other than default 22<br />
</pre><br />
<br />
Example <br />
<pre><br />
Host test-vm test<br />
Hostname test-vm.test.no<br />
<br />
</pre><br />
<br />
== postgres ==<br />
https://stackoverflow.com/questions/32439167/psql-could-not-connect-to-server-connection-refused-error-when-connecting-to</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Malin%27s_notes&diff=393Malin's notes2022-09-29T10:12:56Z<p>Wiki.malinux.no: </p>
<hr />
<div>==gnu/linux==<br />
<br />
To change ownership of everything that's not already owned by a user<br />
<br />
find /home/rtorrent/ ! -user rtorrent -exec chown rtorrent:rtorrent {} \; &<br />
<br />
==rtl8812AU==<br />
https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git<br />
<br />
remove led-disco<br />
<br />
/etc/modprobe.d/8188eu-blacklist.conf<br />
<br />
options 8812au rtw_led_enable=0<br />
<br />
==LVM==<br />
===[https://blog.raveland.tech/post/rename_vg/ rename Volume Group (VG)]===<br />
<br />
==mdadm==<br />
for dev in $( lsblk | awk '/sd[a-z].*1,8T/ { print }' ); do echo =============================== $dev ============================ ; smartctl -a /dev/$dev ; done | pastebinit<br />
<br />
<br />
<br />
mdadm --remove /dev/md0 failed # all failed devices<br />
<br />
mdadm --remove /dev/md0 detached # failed ones that aren't in /dev anymore<br />
<br />
ip addr add 192.168.0.101/24 dev eth0 ; ip route add default via 192.168.0.1 dev eth0<br />
<br />
<br />
<br />
Mulig rekkefølge med forbehold om at et ikke stemmer, for å endre vg navn på vg med root-partisjon<br />
vgchange gammel-vg ny-vg<br />
vgchange -ay<br />
<br />
endre i /etc/fstab<br />
<br />
grub-install /dev/XxX<br />
<br />
update-initramfs -k all -u<br />
<br />
reboot<br />
<br />
=Crossflash Dell PERC H200 from ir to it-mode=<br />
<br />
==The short answer== <br />
I slightly followed this guide:<br />
<br />
https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/<br />
<br />
The longer answer is. I followed the guide, this way, but did it a little different<br />
<br />
==The longer answer==<br />
<br />
Prepare a usb memory stick formatted as fat32 with two folders called P07 and P20<br />
<br />
===Step 1 download old firmware===<br />
<br />
1. Download this zip archive from dell and unzip it: https://downloads.dell.com/FOLDER02950081M/1/Y2R1T_9211_FW.zip?uid=f06bb69a-8c88-4a54-ac7b-ee8826244140&fn=Y2R1T_9211_FW.zip<br />
<br />
2. Extract 6GBPSAS.FW from Y2R1T_9211_FW/Firmware/6GbpsSASHBA_07.03.06.00_A10<br />
<br />
3. Extract 2118it.bin from FY2R1T_9211_FW/Firmware/9211-8i_P7/<br />
<br />
4. Extract sas2flash.efi from Y2R1T_9211_FW/sas2flash/p05/efi/<br />
<br />
5. Place the three extracted files in the P07 folder<br />
<br />
===Step 2 download current firmware===<br />
<br />
1. Extract 2118it.bin from Y2R1T_9211_FW/Firmware/9211-8i/P20/<br />
<br />
2. Download this zip https://docs.broadcom.com/docs-and-downloads/host-bus-adapters/host-bus-adapters-common-files/sas_sata_6g_p20/Installer_P20_for_UEFI.zip<br />
<br />
3. Extract sas2flash.efi from Installer_P20_for_UEFI/sas2flash_efi_ebc_rel/<br />
<br />
4. Place this to extracted files in the P20 folder<br />
<br />
===Step 3 download uefi shell===<br />
1. Download an uefi shell: [https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Obtaining_UEFI_Shell x86_64 UEFI SHELL] I choosed version 1 as it worked for the person in the guide [https://github.com/tianocore/edk2/raw/UDK2018/EdkShellBinPkg/FullShell/X64/Shell_Full.efi Direct download link]<br />
<br />
2. Extract Shell_Full.efi to the root of the memory stick. I had to rename it to Shellx64.efi to use it with my motherboard, asus P8H67_M_EVO. Check with you motherboard vendor to determine how to use efi-shell<br />
<br />
===Step 4 flashing===<br />
<br />
1. boot computer to efi shell<br />
<br />
2. If not present with a list with devices, type <pre>map -b</pre><br />
<br />
2. On my computer the memory stick is called fs0 so I typed fs0: to change prompt to the memory stick<br />
<br />
3. <pre>cd P07</pre><br />
<br />
4. <pre>sas2flash -listall</pre>will show the controller. If not, check if it is installed to a pci-e port<br />
<br />
5. <pre>sas2flash.efi -c 0 -list</pre> will show controller details and take a note of the sas address number<br />
<br />
6. <pre>sas2flash.efi -o -e 6</pre> will erase the old firmware and boot rom<br />
<br />
7. <pre>sas2flash.efi -o -f 6GBPSAS.FW</pre> writes the dell 6gbs firmware<br />
<br />
8. <pre>sas2flash.efi -o -f 2118it.bin</pre> writes the P07 firmware<br />
<br />
9. Then I rebooted<br />
<br />
10. boot into efi again<br />
<br />
11. <pre>cd P20</pre><br />
<br />
12. <pre>sas2flash.efi -o -f 2118it.bin writes the P20 firmware</pre><br />
<br />
===Notes===<br />
Directly copied from the source, step number changed to fit my tutorial:<br />
<br />
1. Step 6 showed “Erasing Flash Region” and then after a while “ERROR: Erase Flash Operation Failed!”. I simply proceeded and the error did not appear to affect anything.<br />
<br />
2. Visit [https://blog.michael.kuron-germany.de/2014/11/crossflashing-dell-perc-h200-to-lsi-9211-8i/comment-page-1/ source] to get screenshots vit the error messages<br />
<br />
=Compile rtorrent libtorrent and xmlrpc-c=<br />
==libtorrent==<br />
==rtorrent==<br />
./configure --prefix=/usr --with-xmlrpc-c |tee /tmp/conf.log<br />
<br />
=vim=<br />
<br />
# Merk Noe Og Trykk U For Å Få Det I Lowercase, U For Uppercase ;)<br />
# stor v for visual line eller liten for visual der du må merke noe manuelt<br />
# ok. jeg glemte å markere først :p<br />
# oki :)<br />
<br />
# iT'S cAPS lOCK DAY!<br />
<br />
# trykk ~ for å endre fra stor til liten bokstav ;)<br />
<br />
=grub=<br />
<br />
==Repair GRUB from Windows==<br />
<br />
To repair efi bootloader/grub from windows<br />
<br />
Open powershell as admin and execute the following command<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\{distro}\grubx64.efi</pre><br />
<br />
if you are running debian, it will look like this:<br />
<br />
<pre>bcdedit.exe /set "{bootmgr}" path \EFI\debian\grubx64.efi</pre><br />
<br />
=libvirt=<br />
<br />
==setup new vm from a template==<br />
<br />
If you have a qcow2 vm template, clone it.:<br />
<br />
If you clone a qcow2 in use, stop the vm first:<br />
<br />
<pre>virsh stop {domain-vm-name}</pre><br />
<br />
Then clone the qcow2<br />
<br />
<pre>virt-clone --original {Domain-Vm-Name-Here} --name {New-Domain-Vm-Name-Here} --auto-clone</pre><br />
<br />
Configure your VM to your likings either by virt-manager (gui) or by cli<br />
<br />
Start the new vm and log in, either by ssh, or via virt-manager<br />
<br />
Change hostname to match the new name of the VM<br />
<br />
<pre>sudo -i<br />
vi /etc/hostname</pre><br />
<br />
<br />
<pre>vi /etc/hosts</pre> to match the name of the new VM<br />
<br />
Example. change:<br />
<br />
<pre>127.0.1.1 debian-stretch-mal.debian-stretch-mal.local debian-stretch-mal</pre><br />
<br />
to<br />
<pre>127.0.1.1 new-name-vm.new-name-vm.local new-name-vm</pre><br />
<br />
Also add a line for the ip to the server who runs the VM and for the backup server if you have one, like this<br />
<br />
<pre>192.168.X.X hostname.domain.xx hostname</pre><br />
<br />
<br />
change local ip to a free address<br />
<br />
<pre> vi /etc/network/interfaces</pre><br />
<br />
and add the new ip in on the host <br />
<pre>/etc/hosts</pre><br />
<br />
Make ssh keys:<br />
<br />
<pre>ssh-keygen</pre><br />
go with the defaults by hit enter, when prompted for questions<br />
<br />
copy the the public key from <pre>.ssh/id_rsa.pub</pre><br />
<br />
If bareos is setup on the qcow2 vm template you also need to change the following line in bareos filedaemon config to match your new vm<br />
<br />
<pre>vi /etc/bareos/bareos-fd.conf<br />
<br />
FileDaemon {<br />
Name = new-name-vm.domain.xx-fd </pre><br />
<br />
*sources<br />
https://www.cyberciti.biz/faq/how-to-clone-existing-kvm-virtual-machine-images-on-linux/<br />
<br />
=add bareos client=<br />
<br />
If you already have a bareos backup server<br />
<br />
on the new vm or computer you want to backup to bareos<br />
<br />
Install bareos-filedaemon on the client if it's not already installed<br />
<pre> apt install bareos-filedaemon<br />
systemctl enable bareos-filedaemon.service</pre><br />
<br />
<br />
Then log into the bareos server and run bconsole<br />
<br />
<pre>configure add client name=new-name-vm address=192.168.X.X password=SOME_PASSWORD</pre><br />
<br />
Then the config is saved to<br />
<pre>/etc/bareos/bareos-dir-export/client/svennd/bareos-fd.d/director/bareos-dir.conf</pre><br />
<br />
Copy it to the client in:<br />
<pre>/etc/bareos/bareos-fd.d/directory/bareos-dir.conf</pre><br />
<br />
<br />
*sources<br />
https://www.svennd.be/adding-a-linux-client-to-bareos/<br />
<br />
<br />
=IRC=<br />
==Renew ssl cert==<br />
source= https://github.com/ubergeek42/weechat-android/wiki/Using-SSL-with-WeeChat#generating-a-self-signed-certificate=<br />
To create a certificate with a domain:<br />
<br />
<pre>export HOSTNAME=example.org</pre><br />
<br />
From within ~/.weechat/ssl do:<br />
<pre>openssl req -x509 -nodes -newkey rsa:2048 -keyout relay.pem -extensions san_env \<br />
-subj "/O=WeeChat/CN=$HOSTNAME" \<br />
-config <(cat /etc/ssl/openssl.cnf <(printf "\n[ san_env ]\nsubjectAltName=DNS:\${ENV::HOSTNAME}")) \<br />
-days 365 -out relay.pem</pre><br />
<br />
Then within weechat, reload to the new certificate<br />
<br />
<pre>/relay sslcertkey</pre><br />
<br />
=DNS with rndc=<br />
<br />
==Manipulating dns with rndc==<br />
<br />
login to the computer/vm that takes care of DNS<br />
<br />
ZONE=<domain>.<countrycode> ; rndc freeze $ZONE && vi /etc/bind/$ZONE.zone ; rndc thaw $ZONE ; tail -f /var/log/daemon.log<br />
<br />
Do it like this:<br />
<br />
<pre>rndc freeze domain.no</pre><br />
<br />
Edit stuff in open and you can add stuff:<br />
<br />
<pre><text-editor> /etc/bind/domain.no.zone</pre><br />
<br />
Edit the file according to this:<br />
<br />
<pre><vm-domain-name-vm> AAAA ipv6-adr<br />
<vm-domain-name-vm> A ipv4-adr<br />
<br />
<vm-domain-name> CNAME <vm-domain-name></pre><br />
<br />
example:<br />
<br />
<pre>test-vm AAAA ipv6-adr<br />
test-vm A ipv4-adr<br />
<br />
test CNAME test-vm</pre><br />
<br />
Before you save and exit, add serial number to zone-file format: YYYYMMDDxx<br />
<br />
==Local script to run==<br />
<br />
Open the local [https://github.com/rkarlsba/ymse/blob/master/ddns/ddns-update.sh ddns-update.sh] script and add test-vm to VM= variabel if not already present<br />
<br />
If you don't want to wait for the script to run automatically from cron, run it with the force flag<br />
<br />
<pre>ddns-update.sh --force</pre><br />
<br />
=SSH=<br />
<br />
==TAB-complete==<br />
<br />
<pre>vi .ssh/config</pre><br />
<br />
Then add lines like this:<br />
<br />
<pre><br />
Host <name> # space between multiple names<br />
user admin # optional if you want to add username to log in with<br />
Hostname <ipaddress>/<domain/hostname><br />
Port 2022 # optional add if port is other than default 22<br />
</pre><br />
<br />
Example <br />
<pre><br />
Host test-vm test<br />
Hostname test-vm.test.no<br />
<br />
</pre><br />
<br />
== postgres ==<br />
https://stackoverflow.com/questions/32439167/psql-could-not-connect-to-server-connection-refused-error-when-connecting-to</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=ARK:_Survival_Evolved&diff=392ARK: Survival Evolved2022-09-26T22:01:21Z<p>Wiki.malinux.no: </p>
<hr />
<div><br />
== validate and update ==<br />
<br />
steamcmd +force_install_dir /home/steam/arkserver/ +login anonymous +app_update 376030 validate +quit<br />
<br />
== setup ports, etc ==<br />
<br />
https://ark.wiki.gg/wiki/Dedicated_server_setup<br />
<br />
== ark-server-tools ==<br />
<br />
https://github.com/arkmanager/ark-server-tools</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=ARK:_Survival_Evolved&diff=391ARK: Survival Evolved2022-09-26T20:29:39Z<p>Wiki.malinux.no: </p>
<hr />
<div><br />
== validate and update ==<br />
<br />
steamcmd +force_install_dir /home/steam/arkserver/ +login anonymous +app_update 376030 validate +quit<br />
<br />
== setup ports, etc ==<br />
<br />
https://ark.wiki.gg/wiki/Dedicated_server_setup</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=ARK:_Survival_Evolved&diff=390ARK: Survival Evolved2022-09-26T17:56:32Z<p>Wiki.malinux.no: Created page with " == validate and update == steamcmd +force_install_dir /home/steam/arkserver/ +login anonymous +app_update 376030 validate +quit"</p>
<hr />
<div><br />
== validate and update ==<br />
<br />
steamcmd +force_install_dir /home/steam/arkserver/ +login anonymous +app_update 376030 validate +quit</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Gaming&diff=389Gaming2022-09-26T17:56:02Z<p>Wiki.malinux.no: </p>
<hr />
<div>* [[Vrising Dedicated Debian 11 Server WINE]]<br />
* [[ARK: Survival Evolved]]</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Green-mamba&diff=388Green-mamba2022-06-30T13:48:34Z<p>Wiki.malinux.no: </p>
<hr />
<div>Suggestions on how the storage layout might look like<br />
<br />
=Storage Layout=<br />
<br />
==SSD - Root - Raid-1 - 2x120GB== <br />
2 SSD-s<br />
<br />
Root, where the OS (Debian) is running<br />
<br />
* 2*120GB-SSD's<br />
<br />
===SSD - VM Storage - Raid-10 - 2*1TB===<br />
<br />
* 2 x 1TB-SSD's or 2TB-SSD's or more ssd's<br />
<br />
====HDD - Server Software installation - Raid-10 - 2x2TB====<br />
<br />
Place to install the software the server-vm need to run<br />
<br />
Reuse 2TB HDD's from black-mamba 2 discs or more<br />
<br />
* 2TB-HDD's<br />
<br />
======SSD - lvm-caching - 1xSSD======<br />
<br />
Speed up the Server Software Install Raid<br />
lvm as we're gonna use LVM [https://en.wikipedia.org/wiki/Logical_Volume_Manager_%28Linux%29 Logical Volume Manager]<br />
for all storage<br />
<br />
* 1 * 120GB or 250GB of size or lager<br />
to speed up the HDD-Raid</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Green-mamba&diff=387Green-mamba2022-06-30T13:48:06Z<p>Wiki.malinux.no: </p>
<hr />
<div>Suggestions on how the storage layout might look like<br />
<br />
=Storage Layout=<br />
<br />
==SSD - Root - Raid-1 - 2x120GB== <br />
2 SSD-s<br />
<br />
Root, where the OS (Debian) is running<br />
<br />
* 2*120GB-SSD's<br />
<br />
===SSD - VM Storage - Raid-10 - 2*===<br />
<br />
* 2 x 1TB-SSD's or 2TB-SSD's or more ssd's<br />
<br />
====HDD - Server Software installation - Raid-10 - 2x2TB====<br />
<br />
Place to install the software the server-vm need to run<br />
<br />
Reuse 2TB HDD's from black-mamba 2 discs or more<br />
<br />
* 2TB-HDD's<br />
<br />
======SSD - lvm-caching - 1xSSD======<br />
<br />
Speed up the Server Software Install Raid<br />
lvm as we're gonna use LVM [https://en.wikipedia.org/wiki/Logical_Volume_Manager_%28Linux%29 Logical Volume Manager]<br />
for all storage<br />
<br />
* 1 * 120GB or 250GB of size or lager<br />
to speed up the HDD-Raid</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Green-mamba&diff=386Green-mamba2022-06-30T13:47:53Z<p>Wiki.malinux.no: </p>
<hr />
<div>Suggestions on how the storage layout might look like<br />
<br />
=Storage Layout=<br />
<br />
==SSD - Root - Raid-1 - 2x120GB== <br />
2 SSD-s<br />
<br />
Root, where the OS (Debian) is running<br />
<br />
* 2*120GB-SSD's<br />
<br />
===SSD - VM Storage - Raid-10 - 2*===<br />
<br />
* 2 x 1TB-SSD's or 2TB-SSD's or more ssd's<br />
<br />
====HDD - Server Software installation - Raid-10 - 2x2TB =====<br />
<br />
Place to install the software the server-vm need to run<br />
<br />
Reuse 2TB HDD's from black-mamba 2 discs or more<br />
<br />
* 2TB-HDD's<br />
<br />
======SSD - lvm-caching - 1xSSD======<br />
<br />
Speed up the Server Software Install Raid<br />
lvm as we're gonna use LVM [https://en.wikipedia.org/wiki/Logical_Volume_Manager_%28Linux%29 Logical Volume Manager]<br />
for all storage<br />
<br />
* 1 * 120GB or 250GB of size or lager<br />
to speed up the HDD-Raid</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Green-mamba&diff=385Green-mamba2022-06-30T13:45:11Z<p>Wiki.malinux.no: </p>
<hr />
<div>Suggestions on how the storage layout might look like<br />
<br />
=Storage Layout=<br />
<br />
==SSD - Root - Raid-1== <br />
2 SSD-s<br />
<br />
Root, where the OS (Debian) is running<br />
<br />
* 2*120GB-SSD's<br />
<br />
===SSD - VM Storage - Raid-10===<br />
<br />
* 2 x 1TB-SSD's or 2TB-SSD's or more ssd's<br />
<br />
====HDD - Server Software installation - Raid-10=====<br />
<br />
Place to install the software the server-vm need to run<br />
<br />
Reuse 2TB HDD's from black-mamba 2 discs or more<br />
<br />
* 2TB-HDD's<br />
<br />
======SSD - lvm-caching======<br />
<br />
Speed up the Server Software Install Raid<br />
lvm as we're gonna use LVM [https://en.wikipedia.org/wiki/Logical_Volume_Manager_%28Linux%29 Logical Volume Manager]<br />
for all storage<br />
<br />
* 1 * 120GB or 250GB of size or lager<br />
to speed up the HDD-Raid</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Green-mamba&diff=384Green-mamba2022-06-30T13:44:59Z<p>Wiki.malinux.no: </p>
<hr />
<div>Suggestions on how the storage layout might look like<br />
<br />
=Storage Layout=<br />
<br />
==SSD - Root - Raid-1== <br />
2 SSD-s<br />
<br />
Root, where the OS (Debian) is running<br />
<br />
* 2*120GB-SSD's<br />
<br />
===SSD - VM Storage - Raid-10===<br />
<br />
* 2 x 1TB-SSD's or 2TB-SSD's or more ssd's<br />
<br />
====HDD - Server Software installation - Raid-10=====<br />
<br />
Place to install the software the server-vm need to run<br />
<br />
Reuse 2TB HDD's from black-mamba 2 discs or more<br />
<br />
* 2TB-HDD's<br />
<br />
=======SSD - lvm-caching=======<br />
<br />
Speed up the Server Software Install Raid<br />
lvm as we're gonna use LVM [https://en.wikipedia.org/wiki/Logical_Volume_Manager_%28Linux%29 Logical Volume Manager]<br />
for all storage<br />
<br />
* 1 * 120GB or 250GB of size or lager<br />
to speed up the HDD-Raid</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Green-mamba&diff=383Green-mamba2022-06-30T13:44:32Z<p>Wiki.malinux.no: </p>
<hr />
<div>Suggestions on how the storage layout might look like<br />
<br />
=Storage Layout=<br />
<br />
==SSD - Root - Raid-1== <br />
2 SSD-s<br />
<br />
Root, where the OS (Debian) is running<br />
<br />
* 2*120GB-SSD's<br />
<br />
===SSD - VM Storage - Raid-10===<br />
<br />
* 2 x 1TB-SSD's or 2TB-SSD's or more ssd's<br />
<br />
===HDD - Server Software installation - Raid-10====<br />
<br />
Place to install the software the server-vm need to run<br />
<br />
Reuse 2TB HDD's from black-mamba 2 discs or more<br />
<br />
* 2TB-HDD's<br />
<br />
======SSD - lvm-caching======<br />
<br />
Speed up the Server Software Install Raid<br />
lvm as we're gonna use LVM [https://en.wikipedia.org/wiki/Logical_Volume_Manager_%28Linux%29 Logical Volume Manager]<br />
for all storage<br />
<br />
* 1 * 120GB or 250GB of size or lager<br />
to speed up the HDD-Raid</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Green-mamba&diff=382Green-mamba2022-06-30T13:44:04Z<p>Wiki.malinux.no: </p>
<hr />
<div>Suggestions on how the storage layout might look like<br />
<br />
=Storage Layout=<br />
<br />
==SSD - Root - Raid-1== <br />
2 SSD-s<br />
<br />
Root, where the OS (Debian) is running<br />
<br />
* 2*120GB-SSD's<br />
<br />
==SSD - VM Storage - Raid-10==<br />
<br />
* 2 x 1TB-SSD's or 2TB-SSD's or more ssd's<br />
<br />
==HDD - Server Software installation - Raid-10=== <br />
<br />
Place to install the software the server-vm need to run<br />
<br />
Reuse 2TB HDD's from black-mamba 2 discs or more<br />
<br />
* 2TB-HDD's<br />
<br />
=====SSD - lvm-caching===== <br />
<br />
Speed up the Server Software Install Raid<br />
lvm as we're gonna use LVM [https://en.wikipedia.org/wiki/Logical_Volume_Manager_%28Linux%29 Logical Volume Manager]<br />
for all storage<br />
<br />
* 1 * 120GB or 250GB of size or lager<br />
to speed up the HDD-Raid</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Green-mamba&diff=381Green-mamba2022-06-30T13:43:43Z<p>Wiki.malinux.no: </p>
<hr />
<div>Suggestions on how the storage layout might look like<br />
<br />
=Storage Layout=<br />
<br />
==SSD - Root - Raid-1== <br />
2 SSD-s<br />
<br />
Root, where the OS (Debian) is running<br />
<br />
* 2*120GB-SSD's<br />
<br />
==SSD - VM Storage - Raid-10==<br />
<br />
* 2 x 1TB-SSD's or 2TB-SSD's or more ssd's<br />
<br />
==HDD Server Software installation - Raid-10=== <br />
<br />
Place to install the software the server-vm need to run<br />
<br />
Reuse 2TB HDD's from black-mamba 2 discs or more<br />
<br />
* 2TB-HDD's<br />
<br />
=====SSD - lvm-caching===== <br />
<br />
Speed up the Server Software Install Raid<br />
lvm as we're gonna use LVM [https://en.wikipedia.org/wiki/Logical_Volume_Manager_%28Linux%29 Logical Volume Manager]<br />
for all storage<br />
<br />
* 1 * 120GB or 250GB of size or lager<br />
to speed up the HDD-Raid</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Green-mamba&diff=380Green-mamba2022-06-30T13:41:46Z<p>Wiki.malinux.no: </p>
<hr />
<div>Suggestions on how the storage layout might look like<br />
<br />
=Storage Layout=<br />
<br />
==Root - Raid-1== <br />
2 SSD-s<br />
<br />
Root, where the OS (Debian) is running<br />
<br />
* 2*120GB-SSD's<br />
<br />
==VM Storage - Raid-10==<br />
<br />
* 2 x 1TB-SSD's or 2TB-SSD's or more ssd's<br />
<br />
==Server Software installation - Raid-10=== <br />
<br />
Place to install the software the server-vm need to run<br />
<br />
Reuse 2TB HDD's from black-mamba 2 discs or more<br />
<br />
* 2TB-HDD's<br />
<br />
=====lvm-caching===== <br />
<br />
Speed up the Server Software Install Raid<br />
<br />
* 1 * 120GB or 250GB of size or lager<br />
to speed up the HDD-Raid</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Green-mamba&diff=379Green-mamba2022-06-30T13:37:28Z<p>Wiki.malinux.no: </p>
<hr />
<div>Suggestions on how the storage layout might look like<br />
<br />
=Storage Layout=<br />
<br />
==Root - Raid-1== <br />
2 SSD-s<br />
<br />
Root, where the OS (Debian) is running<br />
<br />
At least 120GB-SSD's<br />
<br />
==Raid-10== Running gaming-vm's from 2 or more SSD's <br />
<br />
1TB-SSD's or larger<br />
<br />
====Raid-10=== Reuse 2TB HDD's from black-mamba 2 discs or more<br />
<br />
2TB-HDD's<br />
<br />
=====lvm-caching===== speed up the HDD raid-10<br />
<br />
1 SSD about 120GB or 250GB of size<br />
to speed up the</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Green-mamba&diff=378Green-mamba2022-06-30T13:37:13Z<p>Wiki.malinux.no: </p>
<hr />
<div>Suggestions on how the storage layout might look like<br />
<br />
=Storage Layout=<br />
<br />
==Raid-1== <br />
2 SSD-s<br />
<br />
Root, where the OS (Debian) is running<br />
<br />
At least 120GB-SSD's<br />
<br />
==Raid-10== Running gaming-vm's from 2 or more SSD's <br />
<br />
1TB-SSD's or larger<br />
<br />
====Raid-10=== Reuse 2TB HDD's from black-mamba 2 discs or more<br />
<br />
2TB-HDD's<br />
<br />
=====lvm-caching===== speed up the HDD raid-10<br />
<br />
1 SSD about 120GB or 250GB of size<br />
to speed up the</div>Wiki.malinux.nohttps://wiki.malinux.no/index.php?title=Green-mamba&diff=377Green-mamba2022-06-30T13:36:28Z<p>Wiki.malinux.no: </p>
<hr />
<div>=Storage Layout=<br />
<br />
==Raid-1== Root with Debian 11 and 2 SSD's<br />
<br />
Root, where the OS (Debian) is running<br />
<br />
At least 120GB-SSD's<br />
<br />
==Raid-10== Running gaming-vm's from 2 or more SSD's <br />
<br />
1TB-SSD's or larger<br />
<br />
====Raid-10=== Reuse 2TB HDD's from black-mamba 2 discs or more<br />
<br />
2TB-HDD's<br />
<br />
=====lvm-caching===== speed up the HDD raid-10<br />
<br />
1 SSD about 120GB or 250GB of size<br />
to speed up the</div>Wiki.malinux.no