Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
HPL
Aug 28, 2002

Worst case scenario.
I'm installing Bodhi Linux as a VM in virt-manager. Can't get the mouse to work. Am I stupid or something or is Bodhi Linux a special flower?

Adbot
ADBOT LOVES YOU

evol262
Nov 30, 2010
#!/usr/bin/perl
I don't know what distro you're using, but pretty much every package manager also "knows" what the perms should be. Check the documentation for rpm/dpkg/whatever and script it.

rpm (for example) is:

rpm --setperms foo

DeaconBlues
Nov 9, 2011
So I've got ssh key based auth on my home net:

Small Ubuntu server is always on, with sshd running.
Main PC (the beast) is on some of the time with sshd running.
Laptop is on most of the time with sshd running.

I'd previously been using private ssh keys without password protection and then decided to add passwords to my private keys in case I got hacked or did something stupid like let someone got hold of one.

Before I had a password on my key, sending a file to my server was as simple as doing 'rsync <filename> <servername:location>' or the equivalent using scp. The command would execute immediately, as soon as sshd had verified I had the requisite privkey in my .ssh directory.

Now that I have password auth on the privkeys I can't tab to autocomplete when doing scp or rsync, which is annoying.

Is there a way that I can get sshd to remember that I have unlocked my privkey for, say 30 minutes? I don't mind unlocking the key at the start of every session but it gets a bit tiresome entering the ssh privkey password all the time.

Docjowles
Apr 9, 2009

Look into ssh-agent and ssh-add.

DeaconBlues
Nov 9, 2011
Just tried ssh-add and it worked. It didn't preserve over reboot.

Will look into ssh-agent now. Cheers.

DeaconBlues
Nov 9, 2011
I just managed to create a second keypair for my server using seahorse and disabling the original key I was using by removing it from the ./ssh/config file.

When logging in for the first time, seahorse popped up (fedora GNOME) and asked for the ssh passphrase. Once I was logged in I could enter and exit the server at will.

Maybe using the GNOME keyring utility will work better for me in future.

Double Punctuation
Dec 30, 2009

Ships were made for sinking;
Whiskey made for drinking;
If we were made of cellophane
We'd all get stinking drunk much faster!

DeaconBlues posted:

Just tried ssh-add and it worked. It didn't preserve over reboot.

Will look into ssh-agent now. Cheers.

ssh-agent is the backend for ssh-add. If ssh-add worked, that's it.

telcoM
Mar 21, 2009
Fallen Rib

DeaconBlues posted:

Just tried ssh-add and it worked. It didn't preserve over reboot.

dpbjinc posted:

ssh-agent is the backend for ssh-add. If ssh-add worked, that's it.

Some distributions start ssh-agent for you as part of a default X11 login session, in one way or another. Looks like yours is one of them.

There are also optional PAM modules that can automatically decrypt your SSH key and feed it to the SSH agent, if your SSH key passphrase is the same as your login password.

Or, if (**and only if**) your SSH key is stored on a computer you consider plenty secure, you could store your SSH key without a passphrase, so that it can be used automatically.

wargames
Mar 16, 2008

official yospos cat censor
What is a good back up manager, i have a linux vps at a good spot before doing weird crap with rocket chat, and I want to make pre-rocket chat vps a backup point because i am terrible with npm/mongodb stuff.

Horse Clocks
Dec 14, 2004


wargames posted:

What is a good back up manager, i have a linux vps at a good spot before doing weird crap with rocket chat, and I want to make pre-rocket chat vps a backup point because i am terrible with npm/mongodb stuff.
you could potentially:

Save an image of the VPS on your vps's control panel.

Take a lvm snapshot if the OS is installed on lvm, and doesn't use all the disk.

Use btrfs snapshots if your root filesystem is btrfs (or any other filesystem with snapshot support)

Learn docker and do everything you might want to revert in a container.

mike12345
Jul 14, 2008

"Whether the Earth was created in 7 days, or 7 actual eras, I'm not sure we'll ever be able to answer that. It's one of the great mysteries."





I have a very old laptop whose CMOS battery has run dry, so now I'm contemplating if there's a way to ignore the BIOS date/time on startup and directly sync it from a server? Replacing is of course an option, but since there's always net access, why not ignore it and get it from the net instead.

DeaconBlues
Nov 9, 2011
Dunno. Is there a possibility that it might confuse kernel messages and boot up sequence timings before the network is initiated and correct system time and date is retrieved?

mike12345
Jul 14, 2008

"Whether the Earth was created in 7 days, or 7 actual eras, I'm not sure we'll ever be able to answer that. It's one of the great mysteries."





DeaconBlues posted:

Dunno. Is there a possibility that it might confuse kernel messages and boot up sequence timings before the network is initiated and correct system time and date is retrieved?

yeah that's what I'm wondering

mystes
May 31, 2006

mike12345 posted:

I have a very old laptop whose CMOS battery has run dry, so now I'm contemplating if there's a way to ignore the BIOS date/time on startup and directly sync it from a server? Replacing is of course an option, but since there's always net access, why not ignore it and get it from the net instead.
It's weird that this doesn't seem to be a solved problem. You'd think at least for network booting that PXE would have a way to update the time if provided by DHCP but this doesn't seem to be the case. I guess nobody considers it worth the effort just to get correct timestamps on the logs before the system gets to the point where it can just use NTP normally.

DeaconBlues
Nov 9, 2011
As far as I'm aware the Raspberry Pi distro's must work the same way, with initial logs dated 1970 or something, until it gets a network time from ntp, since there's no retained information when you remove power from the Pi.

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

mike12345 posted:

I have a very old laptop whose CMOS battery has run dry, so now I'm contemplating if there's a way to ignore the BIOS date/time on startup and directly sync it from a server? Replacing is of course an option, but since there's always net access, why not ignore it and get it from the net instead.
It's a $2 battery

mystes
May 31, 2006

DeaconBlues posted:

As far as I'm aware the Raspberry Pi distro's must work the same way, with initial logs dated 1970 or something, until it gets a network time from ntp, since there's no retained information when you remove power from the Pi.
Yeah, this is indeed the case. It's not too problematic, but it makes the logs harder to understand and some programs give weird warnings. In pretty much every case where knowing the actual time matters (e.g. SSL certificate expiration dates), you would already have a network connection, however, allowing the use of NTP. If you're trying to do encryption on a raspberry Pi that doesn't have an internet connection or something like that it might be a pain (you would probably have to hardcode a new starting date in an init script.)

mystes fucked around with this message at 16:01 on Jul 3, 2016

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.
Today's dumb, uncharted-territory question: can I force access to efivars on a system that isn't currently booted through EFI? I've got a weirdo PXE use case.

mike12345
Jul 14, 2008

"Whether the Earth was created in 7 days, or 7 actual eras, I'm not sure we'll ever be able to answer that. It's one of the great mysteries."





Vulture Culture posted:

It's a $2 battery

nah it's a bunch of outdated ones connected in parallel. but I've googled for a single battery with the same voltage/ma, so I'm gonna try that.

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

mike12345 posted:

nah it's a bunch of outdated ones connected in parallel. but I've googled for a single battery with the same voltage/ma, so I'm gonna try that.
Graaaaar, laptops are the worst :(

wargames
Mar 16, 2008

official yospos cat censor

Horse Clocks posted:

you could potentially:

Save an image of the VPS on your vps's control panel.

Take a lvm snapshot if the OS is installed on lvm, and doesn't use all the disk.

Use btrfs snapshots if your root filesystem is btrfs (or any other filesystem with snapshot support)

Learn docker and do everything you might want to revert in a container.

Sadly my vps provider doesn't have this as an option.

Odette
Mar 19, 2011

Vulture Culture posted:

Graaaaar, laptops are the worst :(

I'm kind of glad there are official/unofficial standards now when it comes to hardware, but laptops are the worst.

Friend bought an xps13 and he's been bitching about the adaptive/dynamic contrast/brightness. If he waited a few more months for the hardware refresh, the new model comes with that setting disabled by default. As is, he can't turn it off (no firmware/BIOS setting to turn off) and is probably going to return the laptop.

Lum
Aug 13, 2003

Speaking of laptops, any idea how to get the Fn+F7 brightness controls working on my Clevo N170RD. Someone wrote a driver for the airplane mode key, and all the other keys work fine. Volume keys even trigger the KDE popup, but the brightness keys do nothing.

Running evtest gives me nothing.

I think that the brightness keys use WMI, but no idea how to get that working.

evol262
Nov 30, 2010
#!/usr/bin/perl

Vulture Culture posted:

Today's dumb, uncharted-territory question: can I force access to efivars on a system that isn't currently booted through EFI? I've got a weirdo PXE use case.

Can you efipxe? It's not too complex (grub2 can get loaded), and makes this a lot easier.

AFAIK, systems booted with int19h give the efi memory map back, and you can't get variables. You might be able to do some really hacky legacy int15 interrupt before the kernel takes the memory space (since legacy booting is an EFI extension which doesn't disable EFI, just hands the memory space back and invokes legacy boot vectors), but that's probably way more effort than just setting up an EFI PXE environment

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

evol262 posted:

Can you efipxe? It's not too complex (grub2 can get loaded), and makes this a lot easier.

AFAIK, systems booted with int19h give the efi memory map back, and you can't get variables. You might be able to do some really hacky legacy int15 interrupt before the kernel takes the memory space (since legacy booting is an EFI extension which doesn't disable EFI, just hands the memory space back and invokes legacy boot vectors), but that's probably way more effort than just setting up an EFI PXE environment
The systems I'm working on only have a legacy boot ROM for PXE, unfortunately, but it turns out that I can't swing the changes I want through efivars anyway. Thanks for the explanation!

evol262
Nov 30, 2010
#!/usr/bin/perl
If you just want to pull info, it might be in DMI. Or there may be another way to do whatever you're thinking of

General_Failure
Apr 17, 2005
Hi. I need some insight. xubuntu (apparently. Not sure when that happened) 16.04 x64. Nvidia somethingorother with proprietary driver.

Not a fan of a recent behaviour. Unplugging a monitor causes the X session to collapse back to a single monitor.

I'm using a two monitor setup. One landscape and one portrait. The one set up as portrait has two DVI connectors whereas the better landscape one only has one.

I've been using the portrait one to toggle between the PC and a Raspberry Pi. Trouble is the Pi does some weird things graphically when it's set up to run with a rotated screen, so I decided to shift it over to the landscape screen via one of those 4 way HDMI switches and some adapters.
The problem is that when I switch away from the PC using the HDMI switch now, the PC detects it and drops back to one monitor like I said. I have to re-enable it in the nVidia settings thing when I'm done. Any ideas on how I can tell the driver to sit down and shut up? Besides this lovely issue it works fine.

telcoM
Mar 21, 2009
Fallen Rib

General_Failure posted:

The problem is that when I switch away from the PC using the HDMI switch now, the PC detects it and drops back to one monitor like I said. I have to re-enable it in the nVidia settings thing when I'm done. Any ideas on how I can tell the driver to sit down and shut up? Besides this lovely issue it works fine.

The Appendix B of the Nvidia proprietary driver README describes all the options you can use with the driver.

Nvidia driver README posted:

Option "ConnectedMonitor" "string"

Allows you to override what the NVIDIA kernel module detects is connected to your graphics card. This may be useful, for example, if you use a KVM (keyboard, video, mouse) switch and you are switched away when X is started. In such a situation, the NVIDIA kernel module cannot detect which display devices are connected, and the NVIDIA X driver assumes you have a single CRT.
[...more details...]

Your HDMI switch is similar to a KVM, so it sounds like this should be the right thing for your situation. However, check the details from the README of *your* driver, as the specific details may have changed depending on driver version.

dpkg chopra
Jun 9, 2007

Fast Food Fight

Grimey Drawer
I have a home server that's basically turned into a host for a couple of VMs I use (nothing critical that can't stand a bit of downtime).

I use VirtualBox + phpvirtualbox on an Ubuntu Server 14.04 LTS machine I have which is not as reliable as I would like (occasionally dependencies break, VMs won't start on boot, etc.)

Is there a more elegant/dependable solution? Even another Linux distribution is fine.

Caveat, my Linux knowledge basically comes down to googling stuff, but I have enough sense to not randomly open ports, use SSH keys, not give everything 777 permissions, etc.

dpkg chopra fucked around with this message at 18:01 on Jul 4, 2016

RFC2324
Jun 7, 2012

http 418

Ur Getting Fatter posted:

I have a home server that's basically turned into a host for a couple of VMs I use (nothing critical that can't stand a bit of downtime).

I use VirtualBox + phpvirtualbox on an Ubuntu Server 14.04 LTS machine I have which is not as reliable as I would like (occasionally dependencies break, VMs won't start on boot, etc.)

Is there a more elegant/dependable solution? Even another Linux distribution is fine.

Caveat, my Linux knowledge basically comes down to googling stuff, but I have enough sense to not randomly open ports, use SSH keys, not give everything 777 permissions, etc.

Use KVM instead of vbox. It works WAY better for this kind of setup, and it isn't all that difficult to migrate your vbox disk images over.

You will want to uninstall the vbox guest additions first tho.

SamDabbers
May 26, 2003



KVM remotely controlled with virt-manager will basically give you everything VBox does except 3D acceleration, but in my experience it's more stable.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

I've been really impressed with KVM and virt-manager.

6 or so months ago I set up a Windows XP 32 bit virtual machine on a headless server to run some old 16 bit windows 3.1 era software while this company was implementing a plan to transition off this stupid old as hell software. Well, the company hasn't even started a plan to transition off because of course they haven't, but this thing is just purring along with basically no maintenance on my part.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Double post like I just don't care...


What's the correct and bestest way of making a python script installable and usable as a service/daemon across common Linux distributions?

If there is not a good cross-distribution way of doing this, I'll settle for Ubuntu for now.

Maybe I should make deb's/rpm's? I don't know anything about that.

The script requires pip-installable libraries as well as requiring phantomjs to be installed...

dpkg chopra
Jun 9, 2007

Fast Food Fight

Grimey Drawer
Thanks for the suggestion! I'll take a look into KVM. I was going to clone the whole Ubuntu install to an SSD so I guess I'll just install KVM to the new disk instead and get everything running before transitioning over.

Thermopyle posted:

I've been really impressed with KVM and virt-manager.

6 or so months ago I set up a Windows XP 32 bit virtual machine on a headless server to run some old 16 bit windows 3.1 era software while this company was implementing a plan to transition off this stupid old as hell software. Well, the company hasn't even started a plan to transition off because of course they haven't, but this thing is just purring along with basically no maintenance on my part.

Do I still technically need a key for WinXP now that it's been EOLed? One of my VMs is basically a Lubuntu install + Wine to run some legacy Windows software. Works ok but still has some crashes that I'm pretty sure wouldn't happen in an actual Windows environment.

RFC2324
Jun 7, 2012

http 418

Thermopyle posted:

Double post like I just don't care...


What's the correct and bestest way of making a python script installable and usable as a service/daemon across common Linux distributions?

If there is not a good cross-distribution way of doing this, I'll settle for Ubuntu for now.

Maybe I should make deb's/rpm's? I don't know anything about that.

The script requires pip-installable libraries as well as requiring phantomjs to be installed...

Yeah, you would want to package it. For ubuntu, you should be able to follow this: http://ubuntuforums.org/showthread.php?t=910717

And here is the full documentation, I think. http://packaging.ubuntu.com/html/

dpkg chopra
Jun 9, 2007

Fast Food Fight

Grimey Drawer
Follow-up question to the KVM advice. I only now realize that KVM isn't some sort of Linux distribution but is an actual program/feature that gets installed within the OS itself.

Is it fairly platform agnostic or should I go for some specific flavor of Linux?

RFC2324
Jun 7, 2012

http 418

Ur Getting Fatter posted:

Follow-up question to the KVM advice. I only now realize that KVM isn't some sort of Linux distribution but is an actual program/feature that gets installed within the OS itself.

Is it fairly platform agnostic or should I go for some specific flavor of Linux?

It's platform agnostic, I still recommend running it on CentOS tho, just because it is easier to find help in my experience.

dpkg chopra
Jun 9, 2007

Fast Food Fight

Grimey Drawer

RFC2324 posted:

It's platform agnostic, I still recommend running it on CentOS tho, just because it is easier to find help in my experience.

I've been meaning to give CentOS a try, thanks!

HPL
Aug 28, 2002

Worst case scenario.
If you want an out-of-the-box Linux hypervisor, Proxmox is great. It runs like a regular headless box, but it's easy to install a desktop environment on it if you want to use it more as a workstation.

Adbot
ADBOT LOVES YOU

evol262
Nov 30, 2010
#!/usr/bin/perl
KVM (through libvirt) also runs perfectly fine headless. If you use centos, enable virt-preview if you can. Otherwise, KVM is mainline, so basically every distro should just have it. libvirt is pretty agnostic. Newer libvirt (and qemu) is nice for some things.

If you want a web frontend on plain libvirt, kimchi is really reasonable. No need for Proxmox here.

Re: packaging -- just use fpm unless you have a strong need not to. It makes using eggs and npm packages stupidly simple (probably including phantom, though that still requires native code, I think), and there's no good reason to go down the rabbit hole of "real" packaging for what it sounds like your use case is (especially if you need to distribute for multiple distros).

Or just shove it in a container.

It's better to use repo-provided packages rather than pip, but you can jam the whole thing into one package pretty easily if you want to.

evol262 fucked around with this message at 22:50 on Jul 4, 2016

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply