« first day (286 days earlier)      last day (4673 days later) » 

12:08 AM
0
Q: How to determine which executable on my path will be run?

BrendanI run which and get the following, brendan$ which python /opt/local/bin/python brendan$ which -a python /opt/local/bin/python /usr/bin/python brendan$ ls -l /opt/local/bin/python lrwxr-xr-x 1 root admin 24 22 Jul 00:45 /opt/local/bin/python -> /opt/local/bin/python2.4 brendan$ python ...

 
 
3 hours later…
3:15 AM
0
Q: Performance difference between stdin and command line argument

TimFor some commands, it is possible to specify certain input as either stdin or a command line argument. Specifically, suppose command can take stdin input and a filename as command line argument, and command < myfile, cat myfile | command and command myfile can produce the same result. For...

 
 
2 hours later…
5:38 AM
0
Q: Where has my `uniq` or `sort -u` line gone, with some unicode characters.

fredWhat has happened in this snippet? The firs 3 examples work, but the 4th fails!. I would expect the same behaviour for any and all characters. ie. to print out 2 lines (from the 3 lines of input)... but in the last case, I only get 1 (for sort -u and uniq); the firt character... I've converted th...

 
 
2 hours later…
7:27 AM
0
Q: Sometimes I feel like a directory, some times I feel like a regular file.

HandyGandyOk. I confess I had trouble coming up with a title for my question, so I tried to make a joke out of a very old commercial--sorry. For organizational purposes. I would like a certain filesystem object which most of the time appears as a file but on occasion appears as a directory. The basic idea...

 
7:48 AM
Another case of needing votes reset on migrate:
6
Q: What is new in Kernel 3.0?

alexI understand this is somewhat less Ubuntu related, but it affects it. So,what is so new about it that Linus decided to name it 3.0? I'm not trying to get information about the drivers that got into it or stuff that always gets improved. I want to know what really made it 3.0. I read somewhere th...

26
Q: Reset votes on migrated questions

GillesI've become more and more convinced that all votes should be reset when a question is migrated. That's both votes on the question, in both directions, and votes on any answer. At the moment, downvotes are cleared from the question. Yes, it makes sense on its own, but I don't think this is the ri...

 
1
Q: Linux source, where are sys_umount and sys_mount system calls?

Michael TrauschI am sure that I must be missing something, here. I cannot for the life of me find the source code for these system calls. I can find their numbers, and I can find their prototypes, but I cannot seem to actually find the functions that implement them. In case anyone's interested: the reason th...

 
 
1 hour later…
8:58 AM
@Gilles: seems rather ambiguous to me. Can we make it ?
 
9:16 AM
1
Q: Validating an OpenSSL Cipher List

eyaziciIs there any tool that can validate OpenSSL cipher list both syntactically and semantically? For example ALL:!LOW:!SSLv2:!EXP:!aNULL is both syntactically and semantically valid cipher list. On the other hand FOO:!BAR:!SSLv2:!EXP:!aNULL is semantically invalid (since FOO and BAR are not valid ci...

0
Q: sed script to insert line after the last matching line in a file

starfryI'd like to write a script in sed to insert line to a file after all similar lines in the file. So I need to locate the last match for a pattern and insert immediately after it. It's very unlikely that this would be the last line in the file. I've seen a number of solutions that employ multiple ...

 
9:31 AM
1
Q: How to limit log file size using >>

davidHow can I limit the size of a log file written with >> to 200MB? $ run_program >> myprogram.log

 
10:21 AM
@Caleb Yeah, why not. I'm not fond of either name but I can't think of a better one.
 
10:34 AM
I removed the new , and from the questions they showed up on yesterday. They didn't seem to add anything useful to me. I did keep which somebody recently added and actually stuck that on some of the other cat questions. I'd say it's of dubious value except in appeasing people who are constantly doing to try to use it and in making duplicates easier to find.
 
10:45 AM
This answer seems to be on-track to me. It could use another up-vote to be a candidate for at least 1/2 the bounty if Lance doesn't turn up in time to award it. It's a new user who seems to have actually tried to understand what was going on and has enough knowledge to at least suggest legitimate issues.
1
A: OpenVPN on OpenWrt

knockNrod Sat Jul 9 13:14:21 2011 WARNING: potential route subnet conflict between local LAN [192.168.80.0/255.255.255.0] and remote VPN [192.168.80.1/255.255.255.255] For some reason, your configuration seems to be sharing ip address space. Your VPN is selecting addresses from the 192.168.80.x addre...

 
11:04 AM
1
Q: Selinux is denying access to mysqld

Shehzad009I have a script that dumps a mysql database. It then compresses the file and this gets stored in my home folder by using cron. The problem is I seem to be getting an error message. mysqldump: Couldn't execute 'show fields from `auth_group`': Can't create/write to file '/tmp/#sql_151e_0.MYI' (...

0
Q: Keep local copy of nfs mount on computer.

user174084I mount all my home directories and what ever else on my laptop when it is on my home network. I was wondering if there is a way to keep a local copy of the nfs mount when my laptop is on the network. A bonus would be the ability to merge changed folders and files etc.

 
@Caleb ok, done
 
11:38 AM
2
Q: Pixelization of KDE screen

muffelI am using Arch Linux on an Acer Aspire 5920G and KDE 4.6.5 as WM. All installed packages are up-to-date. Starting some days ago I got few strange artifacts that spread all over the screen. Interestingly they do not affect any open window at all (neither QT nor GTK or a regular X window). Only t...

0
Q: How long is a TCP local socket address that has been bound unavailable after closing?

Tom AndersonOn Linux (my live servers are on RHEL 5.5 - the LXR links below are to the kernel version in that), man 7 ip says: A TCP local socket address that has been bound is unavailable for some time after closing, unless the SO_REUSEADDR flag has been set. I am not using SO_REUSEADDR. How long is "...

 
11:53 AM
0
Q: What is the [video] tag supposed to be?

CalebThe video seems to be an ambiguous mashup of things related to movie-media files and issues with output hardware. There is a media which is sometimes (but not always) combined with video but it doesn't seem to add a lot of clarity being a rather mixed bag itself. There are already tags for lots ...

 
12:38 PM
0
Q: How to view and edit the code of a pdf file

TimI was wondering how to view and edit the code of a pdf file? By viewing, I don't want to see the binary format, so I think hexdump may not be what I want. I tried gedit, but no encoding method can be used to decode the pdf content. By editing, I would like to search for /Fit and change them to ...

 
12:56 PM
0
Q: Did I delete the whole debian root server?

I installed a new debian 6 system a few days ago - today I wanted to create a CSR request for a SSL certificate and wanted to delete the CSR file afterwards. In the root of my server I was typing rm * /etc/apache2/sslstuff then I noticed that I cannot use ls or top anymore, did I delete every...

 
0
Q: Which is our canonical which question?

GillesA frequently asked question is: which foo tells me something, but it doesn't correspond to what happens when I actually run foo, what's going on? This is a recent example, but we've had many more — basically anything in the which tag, and more that should all be in the path tag. Is there one th...

 
1:11 PM
0
Q: libxml linker error

MarinI've got an app which won't link, giving error: /usr/lib64/libcroco-0.6.so.3: undefined reference to `xmlGetProp@LIBXML2_2.4.30' /usr/lib64/libcroco-0.6.so.3: undefined reference to `xmlFree@LIBXML2_2.4.30' /usr/lib64/libcroco-0.6.so.3: undefined reference to `xmlHasProp@LIBXML2_2.4.30' I've g...

 
1:26 PM
0
Q: How to run regular programs as deamons/services

Joern AkkermannI'm using Debian for my Server. I just installed MediaCore, which works well. Now I want to have it always started and want to ask, how it'd be possible to start it as a service or in the background. I know how to start but then the shell is useless as long as the program runs. So how can I r...

 
 
1 hour later…
Tim
2:36 PM
@Gilles: In sed, if the query word is meant to be binary, how shall it be specified for avoiding being interpreted as text?
 
@Tim There's no such thing as “interpreted as text” or “interpreted as binary”. Text is binary data that happens to contain only printable characters.
 
@Tim There isn't actually a fundamental difference. If you look at a big binary file in a text editor you will see several characters you recognize. That's the characters you know as text are just representations of certain binary values.
The program strings looks through binary files and pulls out all the data in a certain range ... anything recognizable as a-z for example. But that's only a range of a few hundred characters, everything outside of that range is left behind.
Doing a sed operation on a binary file to replace 'x' with 'y' would work exactly as expected, except that if the file isn't meant o be text 'x' might not have the meaning you expect, it might be a fragment of some other sequence of bytes.
 
Tim
@Gilles @Caleb: In a query word, digits can be interpreted as either binary or text, and the binary of the digit text is different from the digit as binary. That is where my question comes from.
 
@Tim Let's start with some new definitions, because that doesn't make a lot of sense.
Binary is ones and zeros. 01000110101111001 and so on.
 
@Tim What do you mean by “digits can be interpreted as either binary or text”? Can you give an example of this? You're probably misinterpreting something, but I don't know what.
@Tim i.e. describe an experiment that, according to you, would distinguish digits interpreted as binary from digits interpreted as text.
 
2:47 PM
What you know of as "text" is specific discrete binary values that have been agreed represent certain letters. Or digits that are text strings ... those are the same thing.
 
Tim
For example, searching for text "0" and search for binary 0 are different. I guess these two kinds of searching are specified differently to sed. By the way, I understand the concept of character encoding.
 
Text files are just binary that only contain characters in a certain "readable" range and are intended to be read as such. What you know of as "binary" files can have characters outside of that range and even be broken down into bytes or bits at different markings than the commone each-8-bytes-represent-a-character breakdown.
 
@Tim What do you mean by “binary 0”? Describe an experiment that would show it (e.g. a command that uses this “binary 0”)
 
Tim
@Gilles: In many sed examples I have seen, they search for text such as "01234" in some text file. Instead, if searching for the binary digits "0", "1" or "010110" in a file, how can I specify I am not searching for text characters "0", "1" or "010110"?
 
@Tim You can't do it with sed, except by passing the nonprintable characters explicitly, which I can't easily illustrate in chat.
Let's use perl, for a change.
perl -lne 'print if /REGEXP/' is roughly equivalent to grep REGEXP (except that the regexp syntax is slightly different)
 
2:59 PM
0
Q: Chinese characters instead of Latin being written to file

Eric BrottoThis is a follow up problem to a question I posed earlier. Basically when I do this: sed '/Q/{ s/Q//g r /Users/ericbrotto/Desktop/question.txt }' Commision.txt everything is fine, but the new output just prints to a console. When I do this: sed '/Q/{ s/Q//g r /Users/ericbrotto/Desktop/questi...

 
Hmm, I need to show how to create an example binary file too
Ok, run this command: perl -e 'print "foo1\nb\001r\n"' >somefile
This creates a file called somefile, containing the string between the double quotes, except that Perl expands the escape sequences \n and \001
\n becomes a newline character in the file, and \001 becomes character number 1. That's not a digit 1, that's the character encoded by the byte number 1
Look at the contents of the file by running hd somefile (you're on Linux, right?)
The left column is the positions in the file, ignore it. The middle column shows hexadecimal values for each byte. The right column shows printable characters, and non-printable characters are replaced by .
00000000 66 6f 6f 31 0a 62 01 72 0a |foo1.b.r.|
 
Tim
@Gilles: Yes, I am in Ubuntu. I am following you. So far so good.
 
The character 1 is encoded by the byte whose code is 49 (31 in hexadecimal).
The character f is encoded by the byte 66 (hexadecimal), o by 6f, and so on.
The last character is a newline, 0a.
When you pass the text foo1, what the program sees is a sequence of four bytes: 66 6f 6f 31.
I could describe those same four bytes in a different notation, for example in binary: 01100110 01101111 01101111 00110001 (quite verbose, when we only have two digits available)
or in decimal: 102 111 111 49
Some of these byte codes correspond to printable characters. For example 30 (hexa) is the digit 0, 31 is the digit 1, 41 is the letter A, 61 is lowercase a and so on.
Some of these byte codes are non-printable characters. This includes control characters such as 0a (hexa), which is a newline character.
The byte code 01 doesn't have any effect when printed in most terminals, so if you run cat somefile, you'll see
foo1
br
A character encoding describes how the byte codes map to characters
Almost every encoding in use is an extension of ASCII
(Actually encodings associate numbers with characters, not always bytes, but that's a lesson for another day.)
Getting back a bit on-topic: at some level, all the data that you pass to a command or store in a file is bytes. Most tools show you the bytes as text. This works well when the bytes correspond to printable characters.
Binary data is data that contains non-printable characters.
If you want to enter or view binary data, you need a tool that translates from or into a form that you can actually type or read.
We've just seen a few examples above.
In Perl, you can specify non-printable characters with backslash escapes, for example \n meaning a newline character.
hd displays the bytes in a file, encoded in hexadecimal (i.e. it encodes the data into letters a-f and digits, so that you can read it)
 
Tim
3:29 PM
@Gilles: Thanks for the input! Do you mean sed can search for text word but not for binary word? What does "passing the nonprintable characters explicitly" mean?
 
@Tim Let's look at a couple of ways to replace the 01 byte in somefile by an a`
We've seen that in Perl, this character can be represented by the escape sequence \001
So: perl -pe 's/\001/a/' <somefile
In sed, you need to pass the character literally
Type sed -e 's/^A/a/' <somefile
Only, instead of typing the two characters ^ and A, press Ctrl+V and then Ctrl+A
This inserts a non-printable character on your command line. The shell displays it as ^A, but it's really one non-printable character, and the shell is using a conventional visual representation of the character.
 
Tim
@Gilles: Thanks! I was wondering if it is " the two characters ^ and A" = "Ctrl+V and then Ctrl+A" = "\001" and why?
 
@Tim Look at the ASCII table
The letters A, B, C, … are at positions 65, 66, 67, …
 
man ascii as well, since that seems to be fairly unknown
 
The Ctrl key shifts the values by 64, so Ctrl+A is 1, Ctrl+B is 2, etc.
^A is a convention to write the Ctrl+A character. It's ambiguous with ^ followed by A, you have to make sure there's no ambiguity in the reader's mind.
 
3:48 PM
0
Q: Recover formatted ext3 partition

user5289Suppose you have an ext3 partition which was unfortunately formated as ext4 partition (and where now are some but not a lot new files on it). Is there any way to recover (some) files from the old ext3 partition?

 
4:18 PM
0
Q: where is log file of Gnome 3?

ahmad598I've just installed gnome3 on openSUSE 11.4 following instructions of http://en.opensuse.org/openSUSE:GNOME_3.0 but when from kdm i try to load gnome3, it just shows me a page saying that it cannot load and it doesn't give me any further information about what is the problem. where should i look ...

 
5:06 PM
0
Q: GRUB error Fedora 15 when Dual Booting on MacBook Pro

madtowneastI am having trouble getting FEdora 15 running on my MacBook Pro. I had Fedora 15 installed before on this MBP before, so I know it works. I basically followed the good old instructions of Create a Windows partition in bootcamp (rEFIt was already installed from trying to get ubuntu running) Boo...

 
 
5 hours later…
9:53 PM
0
Q: How to set up properly zram and swap

Maciej PiechotkaI'm configuring & compiling new 3.0 kernel. One of the goodies I planned to use for some time (by patching) that was merged into 3.0 is zram. Is it possible to set both hdd swap and zram swap so the zram is used first and only spilled pages are put into actual swap?

 

« first day (286 days earlier)      last day (4673 days later) »