Skip to content

Instantly share code, notes, and snippets.

@kurtis318
kurtis318 / ssh_to_servers_behind_jump_server.md
Last active September 11, 2018 15:18
ssh to servers behind jump server/host
@kurtis318
kurtis318 / Notes-on-Linux-tuned-service.md
Created August 29, 2018 15:23
Notes on Linux tuned service
@kurtis318
kurtis318 / My-Cockpit-dashboard.md
Last active August 29, 2018 14:30
My Cockpit dashboard

Here are some screenshots of my Cockpit cluster of three servers I personally maintain.

image

image

All servers are running the latest version of Fedora Server and Centos.

Here is the command I used to install all the Cockpit rpms on Fedora:

Here are some miscellaneous virsh commands that I use but seem to forget the syntax.

  virsh list --all                        # show list of all virtual machines/domains
  virsh start win10                       # start a vm/domain
  virsh destroy win10                     # kill (pull the power) a vm, could trash the vm
  virsh dumpxml win10 > win10.xml         # should be same as /etc/libvirt/qemu/win10.xml ??
  virsh define win10.xml                  # used to re-install vm from an xml file
  virsh undefine win10                    # deletes definition of VM
@kurtis318
kurtis318 / Bad-keys-in-known_hosts-file.md
Created August 29, 2018 13:48
Bad keys in known_hosts file

Issue

Every so often the ssh keys of a server is changed usually due to re-installation of the OS. Deleting the offending entries in the .ssh/known_hosts file will fix this. There are multple ways to do this.

Solutions

sed command

The following sed command is what I normally use. The only problem is that there might be more lines in the file than the one at line 22. Doing a grep on the hostname in known_hosts will identify more line.

  sed -ie "22d" .ssh/known_hosts

ssh-keygen command

@kurtis318
kurtis318 / F28-NVIDIA-KDE-SDDM-XPS15.MD
Last active May 10, 2019 15:20
F28+NVIDIA+KDE+SDDM on my Dell XPS 15

Issue

I wanted to run KDE Plasma on my Dell XPS 15 with the NVIDIA drives and use sddm as the display manager at log in. Sounds like an easy task but is was not.

Solution

Here are the steps in the order I did them.

  1. Use these boot parameters when starting the installation.
nouveau.modeset=0 rd.driver.blacklist=nouveau video.use_native_backlight=1 acpi_osi=! acpi_osi=Linuxacpi_osi="Windows 2009"
@kurtis318
kurtis318 / Pinning_CPUs_in_QEMU.txt
Created August 25, 2018 04:37
Pinning CPUs in QEMU
REF: https://lime-technology.com/forums/topic/72333-solved-windows-10-vms-stuttering-during-file-transfers/
<vcpu placement='static'>10</vcpu>
<cputune>
<vcpupin vcpu='0' cpuset='1'/>
<vcpupin vcpu='1' cpuset='13'/>
<vcpupin vcpu='2' cpuset='2'/>
<vcpupin vcpu='3' cpuset='14'/>
<vcpupin vcpu='4' cpuset='3'/>
<vcpupin vcpu='5' cpuset='15'/>
@kurtis318
kurtis318 / Great_place_to_download_centos_rpms.txt
Created August 24, 2018 15:08
Great place to download centos rpms
I needed to find rpms for installing the cockpit packages on my centos 7 server.
The following was a great place to download the. RPMFIND was missing many of the cockpit-* packages.
https://pkgs.org/
This site has a great search bar and it listed all the matching additional packages.
Here were the ones I downloaded and got to install (actually on RHEL 7.5 KVM):
@kurtis318
kurtis318 / NVIDIAonLenovoP50andFedora 28.txt
Last active April 21, 2020 19:57
NVIDIA on Lenovo P50 and Fedora 28
I have a Lenovo P50 ThinkPad that I am issued at work. I run the latest Fedora on my primary laptop for years but
have avoided running the NVIDA graphics drivers because installation was manual and could break with kernel updates.
I updated my personal Dell XPS 15 to use the new NVIDIA drivers that are now supported in Fedora 28 I think these were suppose to come from rpm-fusion but it looks like they are in Fedora 28 tree, I could be wrong. The install was as easy as just installing the nvidia-driver package and reboot. This worked without any issues. I could launch nvidia-settings and glxgears without any issues.
The purpose of this Gist post is to document how I got the NVIDIA drivers from Fedora 28 on the P50. It was not as easy as installing nvidia-driver and rebooting.
For starters, here are the specs for the P50:
[root@kwr50p kurtis] # inxi -SG
@kurtis318
kurtis318 / virsh_command_to_get_URI_of_display.txt
Created August 17, 2018 20:51
virsh command to get URI of display
REF: https://serverfault.com/questions/334199/how-to-find-which-screen-and-thus-port-the-vnc-ui-for-a-kvm-guest-has-or-how
Using the above site, I was able to come up with the following pipe to show URI display for all KVMs:
[root@kwrlinux2 kurtis] # virsh list|tail -n +3|awk '{print $2;}'|xargs -I {} echo "echo \">>> {}\";virsh domdisplay {}">t.sh; sh ./t.sh
>>> oc74
vnc://127.0.0.1:3
>>> win7
spice://localhost:5904