ML
    • Register
    • Login
    • Search
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. stacksofplates
    • Profile
    • Following 0
    • Followers 13
    • Topics 145
    • Posts 7899
    • Best 2835
    • Controversial 1
    • Groups 0

    stacksofplates

    @stacksofplates

    I pretend to do stuff with Linux.

    4255
    Reputation
    5391
    Profile views
    7899
    Posts
    13
    Followers
    0
    Following
    Joined Last Online
    Website hooks.technology Age 35

    stacksofplates Unfollow Follow

    Best posts made by stacksofplates

    • KVM Snapshot/Backup Script

      So I posted a snapshot export script on here a long time ago, and it wasn't really correct. It created an overlay disk of a backing store and exported the backing store. Red Hat doesn't include the most up to date version of QEMU, so they can push RHEV. RHEL/CentOS 7 only comes with QEMU 1.5, and for live snapshots you need at least 2.0. So if you ad the oVirt repos you can get the newest version with the package qemu-kvm-rhev, or use Fedora server. Here's a script I wrote to take a live external snapshot and compress it to a location. I used my normal template with the interactive function. vmLocation is the location of your VMs. I usually keep mine in the same area. I should add full paths for everything, but I'm lazy this evening. I'll add them later. I also need to add some error handling but this is a rough start if anyone needs to use it.

      #!/bin/bash
      
      
      vmLocation="/data/VMs"
      
      today=$(date +%m-%d-%Y)
      
      
      
      #Script functions
      function script_help () {
        echo "
            Usage: $(basename $0) [options] dom-name snap-name save-location disk-name
      
                -i   Ineractive mode
      
                -h   this help text
      
                dom-name        Name of domain to take snapshot of
      
                snap-name       Name of snapshot
      
                save-location   location to copy snapshot to
      
                disk-name       Name of disk in VM
      
            Example:
              $(basename $0) bind-server bind-snap01 /export/snaps/ vda"
      
        exit ${1:-0}
      }
      
      function interactive_snap () {
      
        echo "Domain name"
        read name
      
        echo "Snapshot name"
        read snap
      
        echo "Location to save snap"
        read location
      
        echo "Disk name"
        read disk
      
        virsh dumpxml $name > $location/$name.xml
      
        diskPath=$(virsh domblklist $name | grep -i $disk | awk '{ print $2 }')
      
        virsh snapshot-create-as --domain $name $snap --diskspec $disk,file=$vmLocation/$snap.qcow2 --disk-only --atomic
      
        tar -czvf $location/$snap-$today.tar.gz $diskPath
      
        virsh blockcommit $name $disk --active --verbose --pivot
      
        rm -f $vmLocation/$snap.qcow2
      
        virsh snapshot-delete --metadata $name $snap
      
        exit ${1:-0}
      
      }
      
      function argument_snap () {
      
        virsh dumpxml $name > $location/$name.xml
      
        diskPath=$(virsh domblklist $name | grep -i $disk | awk '{ print $2 }')
      
        virsh snapshot-create-as --domain $name $snap --diskspec $disk,file=$vmLocation/$snap.qcow2 --disk-only --atomic
      
        tar -czvf $location/$snap-$today.tar.gz $diskPath
      
        virsh blockcommit $name $disk --active --verbose --pivot
      
        rm -f $vmLocation/$snap.qcow2
      
        virsh snapshot-delete --metadata $name $snap
      
        exit ${1:-0}
      
      
      
      }
      
      #Show help if no arguments or options are passed
      [[ ! "$*" ]] && script_help 1
      OPTIND=1
      
      
      #Read command line options
      while getopts "ih" opt; do
          case "$opt" in
            i) interactive_snap ;;
            h) script_help ;;
            \?) script_help 1 ;;
          esac
      done
      shift $(($OPTIND-1));
      
      #Run argument function
      name=$1
      snap=$2
      location=$3
      disk=$4
      argument_snap
      
      posted in IT Discussion
      stacksofplates
      stacksofplates
    • RE: What Are You Doing Right Now

      Well it's official now. I start on Monday as a senior systems engineer with Curtiss-Wright.

      posted in Water Closet
      stacksofplates
      stacksofplates
    • Dynamic DNS with CloudFlare

      So I have a dynamic DNS service for my ERL, but it's not in my actual domain. So I made a small script that updates my CloudFlare DNS from my ERL with their API. There is a cron job that just runs this script every 5 minutes.

      #!/bin/bash
      
      key="your-api-key"
      zoneID="your-zone-id"
      email="[email protected]"
      recordID="record-id-to-update"
      recordName="newrecord.yourdomain.com"
      ip=$(ifconfig eth0 | grep "inet addr:" | cut -d: -f2 | awk '{ print $1 }')
      
      curl -X PUT "https://api.cloudflare.com/client/v4/zones/$zoneID/dns_records/$recordID" \
           -H "X-Auth-Email: $email" \
           -H "X-Auth-Key: $key" \
           -H "Content-Type: application/json" \
           --data '{"type":"A","name":"'"$recordName"'","content":"'"$ip"'","ttl":120,"proxied":false}' -k
      

      You do have to get the record id from the API. I haven't found a way to get it through the web interface. So that means you have to create the record initially, either through the API or the web interface (or use an existing one). Once you have the ID, just paste it in the variable.

      posted in IT Discussion
      stacksofplates
      stacksofplates
    • RE: What Are You Doing Right Now

      Guys I have a server I'm running to display a slideshow of my cats. It has to run 28/8/368. Downtime is not an option, I can't not see my cat's pictures. I need 40 TB of storage in RAID 0 for ultra redundancy and my budget is some change I found in the parking lot. Can anyone help me?

      posted in Water Closet
      stacksofplates
      stacksofplates
    • KVM Setup

      Ok so it seems there's a bit of confusion for how this is set up. On CentOS and Fedora workstations you don't need to do this because it's installed by default. For the servers it's just as easy.

      On CentOS just choose software and then virtualization host:

      0_1502146188845_software.png
      0_1502146200888_virt-host.png

      On Fedora under software choose headless virtualization:

      0_1502146216302_fedora.png

      That's literally all the steps needed to have a working KVM hypervisor. If you want a GUI to manage with then install Virt-Manager on your workstation:

      dnf install virt-manager
      

      or

      yum install virt-manager
      

      Then connect to your host:

      0_1502146361204_connection.png

      posted in IT Discussion
      stacksofplates
      stacksofplates
    • Re:scam. This is amazing

      Youtube Video

      posted in IT Discussion
      stacksofplates
      stacksofplates
    • RE: Decent budget NAS

      WD MyCloud. I hear they're easy to remote support.

      posted in IT Discussion
      stacksofplates
      stacksofplates
    • RE: Merits of Staying Long Term with a Job or Moving More Rapidly

      @scottalanmiller said in Merits of Staying Long Term with a Job or Moving More Rapidly:

      There are a lot of opinions on this subject. What do people think, what have you found? Should you lean towards sticking with one employer and staying for a long time and working your way up? (Linear job progression.) Or should you lean towards looking for external opportunities and moving to other companies (Lateral job progression?)

      I think both have their place. If you are somewhere where you can stay for a while and move up that's awesome. Just don't get complacent so if you ever have to leave you can.

      posted in IT Careers
      stacksofplates
      stacksofplates
    • RE: What Are You Doing Right Now

      @dafyre said:

      And Suddenly @scottalanmiller disappears for hours. Guess we can go back to the #wheressam feed again?

      Carmen SAMdiego Hehe

      0_1454592445935_carmensamdiego.jpg

      posted in Water Closet
      stacksofplates
      stacksofplates
    • Vagrant Libvirt and Fedora 30

      If any of you use vagrant-libvirt and upgraded to Fedora 30 you might notice something strange. I finally figured it out after reviewing a pull request. Vagrant-libvirt was only using the user-session and not the default session even if you are in the libvirt group. So your networks wouldn't be available to the Vagrant boxes. Here's how to fix it:

      Put the following in ~/.vagrant.d/Vagrantfile

      Vagrant.configure("2") do |config|
        config.vm.provider :libvirt do |libvirt|
          libvirt.qemu_use_session = false
        end
      end
      

      Now it should behave like it used to before Fedora 30.

      posted in IT Discussion
      stacksofplates
      stacksofplates

    Latest posts made by stacksofplates

    • RE: How safe are images on docker hub ?

      It all depends. You can inspect the layers of the images. You can also scan with trivy, snyk, etc.

      You can also do what @IRJ mentioned. There’sa few ways to handle this.

      posted in IT Discussion
      stacksofplates
      stacksofplates
    • RE: Outage - Armstrong in N-Western PA

      Had a blip with Comcast this afternoon also. Wonder if it was related?

      posted in IT Discussion
      stacksofplates
      stacksofplates
    • RE: Scale Computing VS Proxmox

      @Aconboy said in Scale Computing VS Proxmox:

      @stacksofplates Yes, we did in 2019. There are a couple of ways that can be done. When you snapshot a VM, any disk in that snap can be mounted to any other vm, provided that the logged in user is at a permissions level allowing it. That is actually part of the mechanism that several backup vendors (acronis, storware,etc) use to do agentless backups of Scale Computing VM's. If you haven't taken a look since 2018, you should take a look again as there has been so very many things added since then.

      Well I guess I mean more without doing a snapshot. The flow we were looking for at the time was we had an ephemeral VM that would boot, mount the disk for storage, we could unmount the disk, destroy the VM, bring it up a new copy and remount the disk. The data disk wouldn't be in the snapshot since it only holds app state. Think of it like persistent volumes for k8s.

      posted in IT Discussion
      stacksofplates
      stacksofplates
    • RE: Scale Computing VS Proxmox

      Did scale ever add the ability to unmount and remount disks? The last time I used it (2018) you couldn’t unmount a disk and then mount it to a new machine.

      posted in IT Discussion
      stacksofplates
      stacksofplates
    • RE: VNC Replacement solution

      @gjacobse said in VNC Replacement solution:

      It's widely known that after you install software you should - reboot.

      While many application function at one hundred percent right after install, some do not.

      noMachine is like that it would seem. Thanks to @stacksofplates for mentioning this simple but very effective fact.

      While I had installed noMachine, I hadn't performed that task on either the host or viewer.

      Thus far - it's been working as designed and across platforms. I still need to test via the iPad - where I had had so much issue previously.

      Thanks again -

      No problem!

      posted in IT Discussion
      stacksofplates
      stacksofplates
    • RE: VNC Replacement solution

      @gjacobse said in VNC Replacement solution:

      @stacksofplates said in VNC Replacement solution:

      @gjacobse said in VNC Replacement solution:

      RDP is going to be a no go. Set it up today and was getting connected - that shouldn't have been an issue.

      The issues is Audio and COM ports. Seems RDP is re-directing - even with that setting off.

      I feel like we don't have enough I do to help. Is this your machine you are remotely connecting to? Someone else's? Do you need console access or do you just need a session?

      My system. Needs to be GUI - Desktop access. All the programs running are to operate the radio

      I'd just try nomachine then and see how that works for you.

      posted in IT Discussion
      stacksofplates
      stacksofplates
    • RE: VNC Replacement solution

      @gjacobse said in VNC Replacement solution:

      RDP is going to be a no go. Set it up today and was getting connected - that shouldn't have been an issue.

      The issues is Audio and COM ports. Seems RDP is re-directing - even with that setting off.

      I feel like we don't have enough I do to help. Is this your machine you are remotely connecting to? Someone else's? Do you need console access or do you just need a session?

      posted in IT Discussion
      stacksofplates
      stacksofplates
    • RE: VNC Replacement solution

      @Pete-S said in VNC Replacement solution:

      @stacksofplates said in VNC Replacement solution:

      @Pete-S said in VNC Replacement solution:

      @scottalanmiller said in VNC Replacement solution:

      @stacksofplates said in VNC Replacement solution:

      Nomachine works well. It's easy to set up and I've found it to be more performance and easier to set up than VNC. If it's just between windows and Linux, then rdp works also as Pete mentioned (if you don't want straight console access).

      And easier than RDP on some platforms.

      Nomachine is free only for personal use. You have to pay if you're using it for commercial use. It's not exactly straight forward to know what is what but there are some guidance here:
      https://knowledgebase.nomachine.com/AR03P00972

      My interpretation is that you can get away with the free version only for sporadic admin tasks. Anything else in a company requires the enterprise license.

      That sucks. It didn't used to be like that. I really feel like they are just strangling their product over time. The pricing for everything they have is ridiculous.

      Yeah, they've made changes over the years. There is the NX protocol and it's wasn't open source but then it was and then it wasn't. I think open source project such as freenx / x2go uses NX but it's not compatible with the NX version that NoMachine uses. I've run into that problem a couple of years ago. I don't know if freenx exists anymore or what the deal is.

      Yeah I think nomachine uses nx4 and x2go uses the old open source nx3. It's a mess. I know when I did this for the DoD contractor we just ended up using RDP because the whole ecosystem was terrible. X2Go looks like it still can't support anything past GNOME 3.12 which is ridiculous as it's been like 5-6 years since I last looked.

      posted in IT Discussion
      stacksofplates
      stacksofplates
    • RE: VNC Replacement solution

      I haven't used it forever, but I think X2Go also supports Windows as a host.

      posted in IT Discussion
      stacksofplates
      stacksofplates
    • RE: VNC Replacement solution

      @Pete-S said in VNC Replacement solution:

      @scottalanmiller said in VNC Replacement solution:

      @stacksofplates said in VNC Replacement solution:

      Nomachine works well. It's easy to set up and I've found it to be more performance and easier to set up than VNC. If it's just between windows and Linux, then rdp works also as Pete mentioned (if you don't want straight console access).

      And easier than RDP on some platforms.

      Nomachine is free only for personal use. You have to pay if you're using it for commercial use. It's not exactly straight forward to know what is what but there are some guidance here:
      https://knowledgebase.nomachine.com/AR03P00972

      My interpretation is that you can get away with the free version only for sporadic admin tasks. Anything else in a company requires the enterprise license.

      That sucks. It didn't used to be like that. I really feel like they are just strangling their product over time. The pricing for everything they have is ridiculous.

      posted in IT Discussion
      stacksofplates
      stacksofplates