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
JHVH-1
Jun 28, 2002
So I got a server at work that is only running a php script that does a certain job, and I can otherwise take advantage of the resource. I want to have our own monitoring we control, and was thinking about slapping nagios or something on it.

My buddy suggested opsview, which looks cool. The only wrinkle is that php is installed as php53 via EPEL on this RHEL5 machine. I don't want to mess with it if I don't have to, but opsview is looking for php not php53 so it won't install.

There a good work around here, or should I just slap vanilla nagios on?

Adbot
ADBOT LOVES YOU

Hollow Talk
Feb 2, 2014

Experto Crede posted:

I'm trying to generate a single digit random number in bash and assign it to a variable.

I'm using this command:
code:
cat /dev/urandom | tr -dc '0-9' | fold -w 1 | head -n 1
and putting the output in a variable.

That command on its own runs fine in terminal, but seems to fall over with scripting as it's never a single digit, but usually four or five.

Any idea what's up?

Did you have a look at using $RANDOM inside the script? This will allow you to simply give it a lower and upper bound, in your case probably 0 and 10, and bash then generates a random number between $FLOOR and $RANGE. You can find a basic overview here: http://www.tldp.org/LDP/abs/html/randomvar.html

e;fb :argh:

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

You could do it this way too (from a quick Google which turned up the link in the last post combined with my previous answer)
code:
MY_VAR=$[1+ $(head -1 /dev/urandom | od -N 1 | awk '{ print $2 }'| sed s/^0*//) % 10]

Experto Crede
Aug 19, 2008

Keep on Truckin'
Ah, I see the issue now. I was using that command thusly:

RANDOM=$(cat /dev/urandom | tr -dc '0-9' | fold -w 1 | head -n 1)

Didn't know RANDOM was a system variable!

Grumpwagon
May 6, 2007
I am a giant assfuck who needs to harden the fuck up.

I'm planning out a new computer, and I'm wondering how much RAM I should buy.

I don't know how Linux memory management works. Using something like 'free -m' at a terminal on my current computer shows that almost all of my 8gb of physical memory is being used currently, even when it's mostly idle, with just a few programs open. The summary line of 'top' agrees with the total amount of memory used, but if you add up all the processes listed there, it tends to total around 10%-70%, depending on what I'm doing at the time. I know top doesn't show all the programs running at any time, but when my computer is mostly idle, it seems like it would be close to the truth.

I'm wondering if Linux preemptively loads stuff into free RAM, sort of like what Android does. If so, that makes 'free' pretty useless for my purposes. Is there a better way to do what I'm trying to do?

TL;DR: Is 'free' showing very little free memory a good proxy for needing more RAM?

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

Grumpwagon posted:

I'm planning out a new computer, and I'm wondering how much RAM I should buy.

I don't know how Linux memory management works. Using something like 'free -m' at a terminal on my current computer shows that almost all of my 8gb of physical memory is being used currently, even when it's mostly idle, with just a few programs open. The summary line of 'top' agrees with the total amount of memory used, but if you add up all the processes listed there, it tends to total around 10%-70%, depending on what I'm doing at the time. I know top doesn't show all the programs running at any time, but when my computer is mostly idle, it seems like it would be close to the truth.

I'm wondering if Linux preemptively loads stuff into free RAM, sort of like what Android does. If so, that makes 'free' pretty useless for my purposes. Is there a better way to do what I'm trying to do?

TL;DR: Is 'free' showing very little free memory a good proxy for needing more RAM?

It's a terrible metric. Look at the buffers/cache in "free -m" to get an idea.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Cut and paste us the output. What are you using the computer for?

8GB is fine for the majority of people but 16GB is only another what, $75?

thebigcow
Jan 3, 2001

Bully!
http://www.linuxatemyram.com/

htop should show what is actually being used and what is just cache.

Grumpwagon
May 6, 2007
I am a giant assfuck who needs to harden the fuck up.

thebigcow posted:

http://www.linuxatemyram.com/

htop should show what is actually being used and what is just cache.

Thanks! That cleared things up a lot, and is sort of what I was expecting.

Bob Morales posted:

What are you using the computer for?

It's just a normal desktop computer, I just multitask a lot. I always have 20+ chrome tabs open, play games (WINE and native), steam, run a couple of background servers (nothing intense, just a personal subsonic server), and various other things. I usually have 3-5 gnome3 workspaces doing various things.

Yaoi Gagarin
Feb 20, 2014

Grumpwagon posted:

It's just a normal desktop computer, I just multitask a lot. I always have 20+ chrome tabs open, play games (WINE and native), steam, run a couple of background servers (nothing intense, just a personal subsonic server), and various other things. I usually have 3-5 gnome3 workspaces doing various things.

I think 8 GB should be fine for you. I don't play games on Linux, but when I'm programming I'll have lots of Chrome tabs, text editors/IDEs, terminals, etc. across three workspaces, plus a music player and some other crap, and this all runs just fine on 4 GB. Lots of people seem to be able to play games and have Chrome tabs open at the same time with 8 GB on Windows, so unless WINE is using a lot more RAM I can't see it being a problem.

Thermopyle
Jul 1, 2003

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

VostokProgram posted:

I think 8 GB should be fine for you. I don't play games on Linux, but when I'm programming I'll have lots of Chrome tabs, text editors/IDEs, terminals, etc. across three workspaces, plus a music player and some other crap, and this all runs just fine on 4 GB. Lots of people seem to be able to play games and have Chrome tabs open at the same time with 8 GB on Windows, so unless WINE is using a lot more RAM I can't see it being a problem.

He should probably start with 8GB and if he needs more, add it.

My main OS is Windows nowadays (I develop in an Ubuntu VM), but on Windows it's not infrequent that I get Windows warning me about low memory with 16 GB of RAM if I'm playing a game. When that happens it's the game, Chrome, and CrashPlan being the highest RAM hogs by far.

So anyway, start with 8 and add more if needed. Problem solved!

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

Suspicious Dish posted:

Don't rely on it too much. Wayland is going to kill the concept of two independent clipboards.

I thought there are 3 clipboards.

pseudorandom name
May 6, 2007

There's an unlimited number of clipboards, but nobody ever uses any of them besides CLIPBOARD and PRIMARY.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

peepsalot posted:

I thought there are 3 clipboards.

I have never seen a program ever use SECONDARY. Let me know if you find one.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
Regarding the OpenSSL TLS heartbeat read overrun vulnerability, it looks like Ubuntu has the fix now. Do I just do a apt-get install libssl1.0.0 to get the fix? If I compiled nginx myself, do I need to recompile it?

cowboy beepboop
Feb 24, 2001

apt-get update && apt-get upgrade -y

Then you'll need to recompile nginx. For extra safety have your CA reissue your certificate and generate a new CSR once you have updated OpenSSL.

more like dICK
Feb 15, 2010

This is inevitable.
Revocation isn't extra safety, it's mandatory. Your private keys are in the wild.

SYSV Fanfic
Sep 9, 2003

by Pragmatica
Is Fedora still moving ahead with Wayland in its next release? Last I heard Nvidia couldn't write a binary KMS driver due to licensing issues with the API. Does that mean Nvidia users are going to be stuck using Noveu and have to hop through hoops to install X next fedora release?

On a similar note, how is steam going to deal with the transition to Mir?

Riso
Oct 11, 2008

by merry exmarx
Mir will probably have a fallback X render too, so they don't have to do poo poo.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

keyvin posted:

Is Fedora still moving ahead with Wayland in its next release?

Yep.

keyvin posted:

Last I heard Nvidia couldn't write a binary KMS driver due to licensing issues with the API. Does that mean Nvidia users are going to be stuck using Noveu and have to hop through hoops to install X next fedora release?

We'll continue to have X for a long time.

keyvin posted:

On a similar note, how is steam going to deal with the transition to Mir?

Steam is based on Debian, not Ubuntu, so it has nothing to do with Mir.

Grumpwagon
May 6, 2007
I am a giant assfuck who needs to harden the fuck up.

Suspicious Dish posted:

Steam is based on Debian, not Ubuntu, so it has nothing to do with Mir.

I think he meant Steam for Linux, not Steam OS. Steam for Linux targeted (and AFAIK, still targets) Ubuntu 12.04 LTS.

SYSV Fanfic
Sep 9, 2003

by Pragmatica

Suspicious Dish posted:

We'll continue to have X for a long time.

How will the option to use X be presented to the user? From what I know, xwayland will only support 2d acceleration. If a user wants 3d acceleration they would have to run a full x server right? Will it be a configuration option during the install or will it be as simple as checking a box somewhere? It doesn't really affect me because I run Debian stable so I assume this will mostly be worked out by 2025 or whenever Debian incorporates Wayland.

I'm just trying to be more proactive about accepting major changes to the desktop stack after disliking systemd for so long when it turned out to be completely awesome.

Yeah, I meant steam for Linux. I guess they can bump support up to 14.04 and be good for the next five years. It just seems like getting a 3d game to work under Wayland is going to take more effort than just recompiling against the appropriate libraries, but I don't really know.

SYSV Fanfic fucked around with this message at 17:07 on Apr 8, 2014

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

keyvin posted:

How will the option to use X be presented to the user?

I don't know. We might choose automatically if we think you can run a Wayland session.

keyvin posted:

From what I know, xwayland will only support 2d acceleration. If a user wants 3d acceleration they would have to run a full x server right? Will it be a configuration option during the install or will it be as simple as checking a box somewhere? It doesn't really affect me because I run Debian stable so I assume this will mostly be worked out by 2025 or whenever Debian incorporates Wayland.

Xwayland's 2D acceleration depends on the 3D acceleration to start with, so Xwayland supports both. It doesn't right now, as landed, but it's simply because we need a bit more time to get the changes done.

keyvin posted:

I'm just trying to be more proactive about accepting major changes to the desktop stack after disliking systemd for so long when it turned out to be completely awesome.

Yeah, I meant steam for Linux. I guess they can bump support up to 14.04 and be good for the next five years. It just seems like getting a 3d game to work under Wayland is going to take more effort than just recompiling against the appropriate libraries, but I don't really know.

Games using SDL2 (i.e. all of the ones on Steam for Linux IIRC) should work fine with no changes on Wayland. If they use GLX directly, it will be more difficult.

Doctor w-rw-rw-
Jun 24, 2008
Heartbleed.com says OpenSSL 1.0.1 through 1.0.1f (inclusive) are vulnerable.

CentOS's OpenSSL is still vulnerable:
openssl.x86_64 0:1.0.1e-16.el6_5.7

Any idea when an update might be made available?

hifi
Jul 25, 2012

Doctor w-rw-rw- posted:

Heartbleed.com says OpenSSL 1.0.1 through 1.0.1f (inclusive) are vulnerable.

CentOS's OpenSSL is still vulnerable:
openssl.x86_64 0:1.0.1e-16.el6_5.7

Any idea when an update might be made available?

Looks like as soon as your repository updates: http://lwn.net/Articles/593841/

Doctor w-rw-rw-
Jun 24, 2008

hifi posted:

Looks like as soon as your repository updates: http://lwn.net/Articles/593841/

Ah, so it's not vulnerable, it's just a backported patch.

EDIT: yep, recompiled against OpenSSL and tested. CentOS (and of course Red Hat's) packages are patched to be secure against heartbleed.

Doctor w-rw-rw- fucked around with this message at 20:05 on Apr 8, 2014

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

Doctor w-rw-rw- posted:

Ah, so it's not vulnerable, it's just a backported patch.

EDIT: yep, recompiled against OpenSSL and tested. CentOS (and of course Red Hat's) packages are patched to be secure against heartbleed.

What? CentOS/RHEL6 were absolutely vulnerable (on 6.5, but not earlier versions).

hifi
Jul 25, 2012

evol262 posted:

What? CentOS/RHEL6 were absolutely vulnerable (on 6.5, but not earlier versions).

The heartbleed.com site says openssl versions up to 1.01.f were vulnerable, and the patched version is 1.01.e.X

Doctor w-rw-rw-
Jun 24, 2008

evol262 posted:

What? CentOS/RHEL6 were absolutely vulnerable (on 6.5, but not earlier versions).

I mean, as of the updated package's release, whose version letter is in the range of vulnerable OpenSSL versions, CentOS is secured, because the fix was backported.

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

hifi posted:

The heartbleed.com site says openssl versions up to 1.01.f were vulnerable, and the patched version is 1.01.e.X

6.5 rebased to OpenSSL 1.0.1(e) to get TLS 1.2 support. Older versions were OpenSSL 1.0.0 (not vulnerable). The patched version after the CVE is 1.0.1.e.X (not vulnerable). My point was that there's a window of "I'm running EL6.5 but haven't installed the fixed version" that absolutely needs to be patched, because it is vulnerable.

Doctor w-rw-rw-
Jun 24, 2008

evol262 posted:

6.5 rebased to OpenSSL 1.0.1(e) to get TLS 1.2 support. Older versions were OpenSSL 1.0.0 (not vulnerable). The patched version after the CVE is 1.0.1.e.X (not vulnerable). My point was that there's a window of "I'm running EL6.5 but haven't installed the fixed version" that absolutely needs to be patched, because it is vulnerable.

Yes, but it (referring to openssl.x86_64 0:1.0.1e-16.el6_5.7) is not vulnerable.

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

Doctor w-rw-rw- posted:

Yes, but it (referring to openssl.x86_64 0:1.0.1e-16.el6_5.7) is not vulnerable.

Ah, sorry for the confusion.

ArcticZombie
Sep 15, 2010
My mother text me today, flipping out over a warning her XP laptop gave her, alerting her she was "at risk". From the information I got from her, I'm pretty sure the message was basically just a warning about XP being EOL. I completely forgot she was even on XP, she doesn't want a buy a new laptop and I'm not sure how well Windows 7 would run on that thing (also £££). With that, any ideas on a distro/DE for a technologically-handicapped parent? I currently use Gnome 3 on Fedora, but I doubt she'll get along with it.

Vulture Culture
Jul 14, 2003

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

ArcticZombie posted:

My mother text me today, flipping out over a warning her XP laptop gave her, alerting her she was "at risk". From the information I got from her, I'm pretty sure the message was basically just a warning about XP being EOL. I completely forgot she was even on XP, she doesn't want a buy a new laptop and I'm not sure how well Windows 7 would run on that thing (also £££). With that, any ideas on a distro/DE for a technologically-handicapped parent? I currently use Gnome 3 on Fedora, but I doubt she'll get along with it.
How old is the laptop? If it doesn't have good 2D driver support, rendering is going to be dog-poo poo slow and web browsing will be unbearable. Try a few LiveCDs on that before you even pay this too much thought.

That said, Xubuntu or Lubuntu is probably the most reasonable lightweight modern environment you'll find, but it probably won't run much better than Windows 7 these days on what I'm guessing is 10-year-old hardware.

SYSV Fanfic
Sep 9, 2003

by Pragmatica

ArcticZombie posted:

My mother text me today, flipping out over a warning her XP laptop gave her, alerting her she was "at risk". From the information I got from her, I'm pretty sure the message was basically just a warning about XP being EOL. I completely forgot she was even on XP, she doesn't want a buy a new laptop and I'm not sure how well Windows 7 would run on that thing (also £££). With that, any ideas on a distro/DE for a technologically-handicapped parent? I currently use Gnome 3 on Fedora, but I doubt she'll get along with it.

Can't really make a recommendation without the specs of the laptop.

Ubuntu 12.04 runs very well on my parents parents 32 bit 3.4ghz pentium 4 desktop with 512mb of ram. Download a live CD and try it out.

Hell you could download the unity, xubuntu, and lxde live cds and have her try all 3 so she can pick what she thinks is easiest to use.

BoyBlunder
Sep 17, 2008
I'm trying to setup a logrotate on a Debian 7.2 box, and it's not rotating logs.

Here's the logrotate:

code:
root@host:/etc/logrotate.d# cat crashreport
/var/log/crashreport.log {
# rotates daily
    daily
# don't whine if there aren't any logs
    missingok
# add date
    dateext
# keeps 7 days
    rotate 7
# compresses older files
    compress
# don't rotate if empty
    notifempty
#EOF
}
Here's what happens when I run logrotate (nothing):

code:
root@host:/etc/logrotate.d# /usr/sbin/logrotate /etc/logrotate.conf
root@host:/etc/logrotate.d#
Here's the log file, showing it was just touched:
code:
root@host:/etc/logrotate.d# ls -l /var/log | grep crashreport
-rw-r--r-- 1 root  root       46184 Apr 10 07:28 crashreport.log
What am I doing wrong here?

Polygynous
Dec 13, 2006
welp

BoyBlunder posted:

What am I doing wrong here?

My best guess is that logrotate keeps a list of when a file was last rotated (/var/lib/logrotate/status) and it's seeing that your file was already rotated today and skipping it.

You can use -d (debug) to see if that's the case (I assume). There's -f (force) but I think that will rotate everything. Maybe try just 'logrotate -f /etc/logrotate.d/crashreport'.

theultimo
Aug 2, 2004

An RSS feed bot who makes questionable purchasing decisions.
Pillbug
I have a yoga 2 running ubuntu-gnome 14.04. Everything works, except for the wireless, which rfkill considers it hard locked. I got networking working by disabling wifi in bios and using a ralink usb stick. Are the intel 7260 networking cards useable in linux?

JHVH-1
Jun 28, 2002

BoyBlunder posted:

I'm trying to setup a logrotate on a Debian 7.2 box, and it's not rotating logs.

Here's the logrotate:

code:
root@host:/etc/logrotate.d# cat crashreport
/var/log/crashreport.log {
# rotates daily
    daily
# don't whine if there aren't any logs
    missingok
# add date
    dateext
# keeps 7 days
    rotate 7
# compresses older files
    compress
# don't rotate if empty
    notifempty
#EOF
}
Here's what happens when I run logrotate (nothing):

code:
root@host:/etc/logrotate.d# /usr/sbin/logrotate /etc/logrotate.conf
root@host:/etc/logrotate.d#
Here's the log file, showing it was just touched:
code:
root@host:/etc/logrotate.d# ls -l /var/log | grep crashreport
-rw-r--r-- 1 root  root       46184 Apr 10 07:28 crashreport.log
What am I doing wrong here?

Try adding the -f (force) flag and passing just your own conf file not the logrotate.conf unless you wan to rotate everything on your system again. Having daily there can make it not run without force, but after the day changes over it should work.

Adbot
ADBOT LOVES YOU

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

theultimo posted:

I have a yoga 2 running ubuntu-gnome 14.04. Everything works, except for the wireless, which rfkill considers it hard locked. I got networking working by disabling wifi in bios and using a ralink usb stick. Are the intel 7260 networking cards useable in linux?

ideapad_laptop is broken in the kernel. Blacklist it.

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