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
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!

Is there a command that will give you x bytes from a file starting at offset n?

Adbot
ADBOT LOVES YOU

Ninja Rope
Oct 22, 2005

Wee.

Bob Morales posted:

Is there a command that will give you x bytes from a file starting at offset n?

dd

waffle iron
Jan 16, 2004

Bob Morales posted:

Is there a command that will give you x bytes from a file starting at offset n?
dd if=FILENAME bs=1 skip=N count=X

kyuss
Nov 6, 2004

Alright I've had it.

I again spent too much time trying to get Evernote for Windows running in wine, but it just won't login to evernote.com on the very first screen.

It says that the servers cannot be reached, but testing with IE from the same prefix tells me there is internet connectivity available. However, wine's IE is crashing when switching from HTTP to HTTPS, which tells me there is something wrong with wine's SSL implementation.


I've come up with the following hack idea:

  • "arpspoof" on the wine host, thereby making wine route its traffic through it
  • "sslsniff" running to strip out https redirects
  • "iptables" to redirect every HTTP traffic on my local machine through "sslsniff"'s listening ports

This should circumvent the whole ugly SSL mess on "Evernote for Windows"'s side, right?

vvvvvv I have, and even sent a report to the app maintainer days ago but haven't heard anything back yet.

kyuss fucked around with this message at 22:05 on Apr 29, 2012

other people
Jun 27, 2004
Associate Christ

kyuss posted:

Alright I've had it.

I again spent too much time trying to get Evernote for Windows running in wine, but it just won't login to evernote.com on the very first screen.

It says that the servers cannot be reached, but testing with IE from the same prefix tells me there is internet connectivity available. However, wine's IE is crashing when switching from HTTP to HTTPS, which tells me there is something wrong with wine's SSL implementation.


I've come up with the following hack idea:

  • "arpspoof" on the wine host, thereby making wine route its traffic through it
  • "sslsniff" running to strip out https redirects
  • "iptables" to redirect every HTTP traffic on my local machine through "sslsniff"'s listening ports

This should circumvent the whole ugly SSL mess on "Evernote for Windows"'s side, right?

Have you checked the app db on winehq? http://appdb.winehq.org/objectManager.php?sClass=version&iId=24253

Crush
Jan 18, 2004
jot bought me this account, I now have to suck him off.
I've got some sed questions:

How does $ represent the end of a line and the last line? What distinction is there to make it represent one or the other? (e.g., sed '$d' filename.ext and sed 's/^$//g' filename.ext)

I know you can refer to a tab with \t, but are there any other things that are represented by a backslash and a character?

Also, and this doesn't have to be done using sed, but is there a way to (preferably using a one liner) replace a specified instance of a string within a file (as opposed to a line)? For example, the first instance of a string within a file or the fiftieth instance within the file.

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!

Our web server is having a case of the Mondays:
code:
top - 09:48:57 up 216 days,  9:17, 16 users,  load average: 247.95, 165.16, 99.97
Tasks: 851 total, 178 running, 672 sleeping,   0 stopped,   1 zombie
Cpu(s): 38.9%us, 59.9%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.3%hi,  0.8%si,  0.0%st
Mem:  14368196k total, 14297172k used,    71024k free,    19068k buffers
Swap:  2096472k total,  2096472k used,        0k free,   107300k cached

some kinda jackal
Feb 25, 2003

 
 
Well if you have 42 6-core Xeons in that box then you're doing just fine :haw:

Otherwise :stonk:

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!

Martytoof posted:

Well if you have 42 6-core Xeons in that box then you're doing just fine :haw:

Otherwise :stonk:

8 vCPU's, so basically a single quad-core Xeon 5520 (2.25GHz or something, it's fairly old)

The bad thing was that we ran out of RAM and once we start paging we're dead. We had it setup where each web app could launch x amount of instances, and we added two more sites over the weekend and didn't change the configuration at all. We had it setup so it would run right up close to the limit of physical RAM, I thought that the global max_instances would have stopped it but....

Then you have 20,000 new users sign up on a Monday and ka-pow.

ToxicFrog
Apr 26, 2008


All of these questions can be answered with with sed manual, accessible with info sed (man sed is a quick reference for people already familiar with sed). I've provided manual references so you can go look up the details yourself if you wish.

Crush posted:

I've got some sed questions:

How does $ represent the end of a line and the last line? What distinction is there to make it represent one or the other? (e.g., sed '$d' filename.ext and sed 's/^$//g' filename.ext)

'$' as an address matches the last line of input. '$' as a character in a regular expression matches the end of the pattern space. Note that if the regular expression has the M flag, '$' instead becomes 'matches just before any linebreak' in addition to matching the end (and '^' becomes 'matches just after'). (3.2 "Selecting Lines", 3.3 "Overview of Regular Expressions")

quote:

I know you can refer to a tab with \t, but are there any other things that are represented by a backslash and a character?

3.9 "GNU Extensions for Escapes" has a complete list; the short form is that it has the C escapes afnrtv, cX for ctrl-X, odx for octal, decimal, or hex character codes, and some regex-specific escapes bBwW`'.

quote:

Also, and this doesn't have to be done using sed, but is there a way to (preferably using a one liner) replace a specified instance of a string within a file (as opposed to a line)? For example, the first instance of a string within a file or the fiftieth instance within the file.

A sed guru can probably come up with a better way of doing this, but here's mine:

sed -n '1{h;d}; H; ${g; s/FIND/REPLACE/50; p}'

You can pipe the file through this, or use -i and pass it on the command line as you like.

To break this down:

code:
1 {     # first line
    h   # copy pattern space to hold space
    d   # clear pattern space and skip to next line
}

H       # every line (except first, since we have that 'd' above) append a newline
        # + the pattern space to the hold space (we can't do that on the first line
        # because then we end up with an extra \n at the start)

$ {     # last line
    g   # copy hold space to pattern space
    s/FIND/REPLACE/50  # replace the 50th instance of FIND with REPLACE
    p   # print contents of pattern space
}

maskenfreiheit
Dec 30, 2004
.

maskenfreiheit fucked around with this message at 21:04 on Apr 28, 2019

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!

GregNorc posted:

So I am trying to burn some MP3 cds, but get this error when opening K3b on my Redhat 6.2 install:


Is there some sort of library I can install via yum to enable MP3 burning?

Can you use the Fedora instructions?

http://www.fedorafaq.org/#mp3

quote:

Q: How do I play MP3s in Fedora?
A: To play MP3s in Fedora, you have to install a different package depending on which Fedora MP3 player you want to use. If you're not sure which one to pick, Rhythmbox is the standard. It's in the "Applications" menu, under "Sound & Video" -- it's called "Rhythmbox Music Player." It looks kind of like iTunes when you run it.
Here's how to install the correct MP3 plugin:

Make sure that you're using my yum configuration from the installing software question.
Open a Terminal.
Become root:
su -

Now, install the correct plugin depending on which MP3 player you want to use:
For Rhythmbox or Totem:
yum install gstreamer-plugins-ugly

For Audacious (which is like XMMS or Winamp):
yum install audacious-plugins-freeworld-mp3

Now you should be able to play MP3s in your favorite Fedora MP3 player!

NOTE: For home users in any country (even the USA), there is no legal problem with MP3 players, so you are not doing anything illegal by enabling MP3 support in Fedora. However, if you are in the USA and you want to encode MP3s or use them in a commercial setting, you may be required to pay patent royalties.

spankmeister
Jun 15, 2008






GregNorc posted:

So I am trying to burn some MP3 cds, but get this error when opening K3b on my Redhat 6.2 install:


Is there some sort of library I can install via yum to enable MP3 burning?

Yeah I think you can use libmad for that, which is in RPMForge.

Install this rpm (or this if you're on 32 bit.)

And then yum install libmad.

Longinus00
Dec 29, 2005
Ur-Quan

GregNorc posted:

So I am trying to burn some MP3 cds, but get this error when opening K3b on my Redhat 6.2 install:


Is there some sort of library I can install via yum to enable MP3 burning?

In debian k3b is split up so the nonfree codecs are in a different package which is separate from the main program, libk3b6-extracodecs. There might be something similar going on in redhat.

maskenfreiheit
Dec 30, 2004
.

maskenfreiheit fucked around with this message at 21:04 on Apr 28, 2019

spankmeister
Jun 15, 2008






GregNorc posted:

Tried this, it might work... but since it's a uni owned computer, I cannot su, but merely sudo. Sent an email to hour helpdesk, so I will probably be back here sometime next week if the command did not work :/

Well sudo is good enough if you can do everything. Just put sudo in front of all the commands.

You're probably not allowed to do that though. (And if your only reason for asking is: I want to burn some MP3's to a CD then well...)

The Third Man
Nov 5, 2005

I know how much you like ponies so I got you a ponies avatar bro
general question, I'm teaching myself how to use Linux and trying to read through this: http://tldp.org/LDP/intro-linux/html/. Are there any other good resources out there if I want to move beyond a basic understanding of the system?

Dilbert As FUCK
Sep 8, 2007

by Cowcaster
Pillbug

The Third Man posted:

general question, I'm teaching myself how to use Linux and trying to read through this: http://tldp.org/LDP/intro-linux/html/. Are there any other good resources out there if I want to move beyond a basic understanding of the system?

this is very worth it
http://www.amazon.com/RHCSA-Linux-Certification-Study-Edition/dp/0071765654

Clugg
Apr 21, 2005

I just installed Fedora 16 (last night) and I want to try out KDE. I installed from the x86_64 ISO which game with Gnome 3 by default.

I've not made any big changes to the system (I think) but when I try to run "sudo yum install @kde-desktop" it fails with this error: http://pastebin.com/TRYV3Gur

This is a weird error and I'm kind of new to Linux -- has anyone seen this before or had any suggestions? It seems weird that it would flat out just not work, or am I missing something?

Longinus00
Dec 29, 2005
Ur-Quan

Clugg posted:

I just installed Fedora 16 (last night) and I want to try out KDE. I installed from the x86_64 ISO which game with Gnome 3 by default.

I've not made any big changes to the system (I think) but when I try to run "sudo yum install @kde-desktop" it fails with this error: http://pastebin.com/TRYV3Gur

This is a weird error and I'm kind of new to Linux -- has anyone seen this before or had any suggestions? It seems weird that it would flat out just not work, or am I missing something?

It looks like you added the updates-testing repo and the kde packages aren't built with that in mind. It'll probably work if you use the skip-broken switch like it suggests but did you enable the updates-testing repo yourself?

Clugg
Apr 21, 2005

Longinus00 posted:

It looks like you added the updates-testing repo and the kde packages aren't built with that in mind. It'll probably work if you use the skip-broken switch like it suggests but did you enable the updates-testing repo yourself?

Using the skip-broken switch allowed me to continue, but KDE didn't install properly -- I can't select it at logon or change by the command line.

I can't remember enabling the updates-testing repo, I might have ticked the box during installation. Seems like that might be the problem -- would it be tricky to fix?

e: that repo appears to be disabled at the moment, but presumably has been enabled at some point in the past. I guess it would just be a matter of removing the four packages there and installing kde again?

Clugg fucked around with this message at 07:05 on May 2, 2012

Longinus00
Dec 29, 2005
Ur-Quan

Clugg posted:

Using the skip-broken switch allowed me to continue, but KDE didn't install properly -- I can't select it at logon or change by the command line.

I can't remember enabling the updates-testing repo, I might have ticked the box during installation. Seems like that might be the problem -- would it be tricky to fix?

e: that repo appears to be disabled at the moment, but presumably has been enabled at some point in the past. I guess it would just be a matter of removing the four packages there and installing kde again?

I'm not a yum guru but yes, in principle you'd reinstall all the packages from the testing repo with versions from your normal repos.

Social Animal
Nov 1, 2005

The Third Man posted:

general question, I'm teaching myself how to use Linux and trying to read through this: http://tldp.org/LDP/intro-linux/html/. Are there any other good resources out there if I want to move beyond a basic understanding of the system?

Everyone at my work place recommended this book: http://www.amazon.com/Linux-System-Administration-Handbook-Edition/dp/0131480057/ref=sr_1_3?s=books&ie=UTF8&qid=1335941376&sr=1-3

I just purchased it so I haven't had time to dig in.

other people
Jun 27, 2004
Associate Christ

Clugg posted:

Using the skip-broken switch allowed me to continue, but KDE didn't install properly -- I can't select it at logon or change by the command line.

I can't remember enabling the updates-testing repo, I might have ticked the box during installation. Seems like that might be the problem -- would it be tricky to fix?

e: that repo appears to be disabled at the moment, but presumably has been enabled at some point in the past. I guess it would just be a matter of removing the four packages there and installing kde again?

You could install the proper kde build: http://fedoraproject.org/en/get-fedora-options#desktops

other people
Jun 27, 2004
Associate Christ
I have my own question! Is there a proper way to set a /sys parameter on boot? Google is telling me to put it in /etc/rc.local, but that is not a file I have in Fedora 17. I am not sure if that is because Fedora is doing something different, or if I should just create it?

spankmeister
Jun 15, 2008






Those go in /etc/sysctl.conf.

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!

Kaluza-Klein posted:

I have my own question! Is there a proper way to set a /sys parameter on boot? Google is telling me to put it in /etc/rc.local, but that is not a file I have in Fedora 17. I am not sure if that is because Fedora is doing something different, or if I should just create it?

http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/3/html/Reference_Guide/s1-proc-sysctl.html

other people
Jun 27, 2004
Associate Christ

Right, I had tried to use that, but couldn't get it to work.

The parameter I am trying to modify is /sys/module/hid_apple/parameters/fnmode.

sysctl assumes /proc/sys, which doesn't seem to be the same thing?

sysctl -a | grep hid doesn't show hid_apple.

spankmeister
Jun 15, 2008






Kaluza-Klein posted:

Right, I had tried to use that, but couldn't get it to work.

The parameter I am trying to modify is /sys/module/hid_apple/parameters/fnmode.

sysctl assumes /proc/sys, which doesn't seem to be the same thing?

sysctl -a | grep hid doesn't show hid_apple.

It's a vfs which can be mounted either under / or /proc.

Try putting this in sysctl.conf (last line)

module/hid/parameters/pb_fnmode = 2

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender
/proc/sys and /sys are completely different things, and you can't use /etc/sysctl.conf to change stuff in /sys.

That said, you probably shouldn't be using the /sys interface to change a module parameter. Just make a file in /etc/modprobe.d with:
code:
options hid_apple pb_fnmode=2
That will arrange for the hid_apple module to be loaded with the parameter you want. There should be a modprobe.d(5) manpage on your system which explains the exact syntax.

other people
Jun 27, 2004
Associate Christ

spankmeister posted:

It's a vfs which can be mounted either under / or /proc.

Try putting this in sysctl.conf (last line)

module/hid/parameters/pb_fnmode = 2

I don't have a /sys/module/hid/parameters/pb_fnmode or a /proc/sys/module/hid/parameters/pb_fnmode :(

I have both a /proc/sys and a /sys, which do not have the same contents.


edit: Ah ShoulderDaemon, that makes sense! We'll see what happens next time this thing had to reboot.

So /sys contains module parameters and /proc contains kernel parameters?

other people fucked around with this message at 21:04 on May 2, 2012

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender

Kaluza-Klein posted:

So /sys contains module parameters and /proc contains kernel parameters?

/sys and /proc/sys contain the same sort of information, namely kernel configuration information. The /sys hierarchy was introduced because there was a need to store an extremely dynamic configuration, namely the device configuration, which the /proc/sys interface in the kernel was very ill-suited for. Module configuration wound up in /sys for a similar reason; because modules can appear and vanish at runtime, it's irritating to make room for them in the /proc/sys interface. So nowadays you get device-specific and module-specific stuff in /sys, and general tuning parameters in /proc/sys. There are a few warts, like some parts of the network configuration appearing in both places for various silly historical reasons.

spankmeister
Jun 15, 2008






ShoulderDaemon posted:

/proc/sys and /sys are completely different things, and you can't use /etc/sysctl.conf to change stuff in /sys.

That said, you probably shouldn't be using the /sys interface to change a module parameter. Just make a file in /etc/modprobe.d with:
code:
options hid_apple pb_fnmode=2
That will arrange for the hid_apple module to be loaded with the parameter you want. There should be a modprobe.d(5) manpage on your system which explains the exact syntax.

I must be on crack. Thanks

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
I remember reading somewhere (possibly on some part of lwn.net) that the kernel developers consider /proc to be an uncontrolled mess that outgrew its original purpose long ago. They decided to start from scratch with a well-designed hierarchy in /sys -- as far as I know /proc is semi-deprecated for anything that isn't "information on running processes".

Problem is, /proc's layout is hardcoded in a ton of userspace tools and not all of its functionality has been ported to /sys. For example, I don't know of any way to read/write the equivalent of /proc/sys/net/ipv4/ip_forward in the /sys filesystem.

waffle iron
Jan 16, 2004

Clugg posted:

Using the skip-broken switch allowed me to continue, but KDE didn't install properly -- I can't select it at logon or change by the command line.

I can't remember enabling the updates-testing repo, I might have ticked the box during installation. Seems like that might be the problem -- would it be tricky to fix?

e: that repo appears to be disabled at the moment, but presumably has been enabled at some point in the past. I guess it would just be a matter of removing the four packages there and installing kde again?
You need to run "yum disto-sync". That should downgrade all the packages to the ones in updates.

joe944
Jan 31, 2004

What does not destroy me makes me stronger.

Social Animal posted:

Everyone at my work place recommended this book: http://www.amazon.com/Linux-System-Administration-Handbook-Edition/dp/0131480057/ref=sr_1_3?s=books&ie=UTF8&qid=1335941376&sr=1-3

I just purchased it so I haven't had time to dig in.

Awesome. I was thinking about purchasing a *nix book for career enhancing study and this seems to fit the bill perfectly. Ran out on my lunch and picked up a copy!

I'll most likely get the RH book as well since I'll be going for those certifications after I complete the CCNA.

Kenshirou
Jan 6, 2007

j.HP, c.Mp xx Flash Kick

joe944 posted:

Awesome. I was thinking about purchasing a *nix book for career enhancing study and this seems to fit the bill perfectly. Ran out on my lunch and picked up a copy!

I'll most likely get the RH book as well since I'll be going for those certifications after I complete the CCNA.

If you don't already have one you should really look into getting a Safari Books Online account so you can get a bunch of books for cheap in order to study for certs.

https://safaribooksonline.com

ExcessBLarg!
Sep 1, 2001

Lysidas posted:

They decided to start from scratch with a well-designed hierarchy in /sys -- as far as I know /proc is semi-deprecated for anything that isn't "information on running processes".
In addition to hierarchy, /sys has rules on the format of data within it, namely that for each file entry in /sys, there should be a single value that can be read or written to it.

/proc is much more free form. There's also debugfs (not to be confused with the user-space ext file system manipulation tool of the same name) that's intended for free-form user-space interaction with modules.

some kinda jackal
Feb 25, 2003

 
 
Yo openSUSE what's up with your poo poo?

I have never had as many segfaults, weird system things, or whatever, as I have on a standard 12.1 install.

Try to set the system time by right clicking the clock in the bottom task bar? Hit apply -- Oops KDE segfault notification window.

Try to add some packages through YAST? Oops packaged is locking the system and hasn't released it for hours.

There are a hundred other little notifications that pop up about something not running or indexing being disabled or whatever.

Try to run a system update? Half the downloads stall. (Okay, this one is actually just a problem with the closest mirror, probably, but it's part and parcel of the whole frustrating experience I've had today.

I don't know if this is just KDE being poo poo or what, but openSUSE is seriously lacking in polish. If I wasn't asked for this specific setup I would have just installed CentOS Desktop or something :(

Adbot
ADBOT LOVES YOU

ambushsabre
Sep 1, 2009

It's...it's not shutting down!

Martytoof posted:

Yo openSUSE what's up with your poo poo?

I have never had as many segfaults, weird system things, or whatever, as I have on a standard 12.1 install.

Try to set the system time by right clicking the clock in the bottom task bar? Hit apply -- Oops KDE segfault notification window.

Try to add some packages through YAST? Oops packaged is locking the system and hasn't released it for hours.

There are a hundred other little notifications that pop up about something not running or indexing being disabled or whatever.

Try to run a system update? Half the downloads stall. (Okay, this one is actually just a problem with the closest mirror, probably, but it's part and parcel of the whole frustrating experience I've had today.

I don't know if this is just KDE being poo poo or what, but openSUSE is seriously lacking in polish. If I wasn't asked for this specific setup I would have just installed CentOS Desktop or something :(

I thought openSUSE wasn't going to be support anymore and left to die?

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