[131000010010] |Recommend a reading for learning LINUX firewalls configuration for beginner? [131000010020] |I am using Linux at home and want to be able to configure firewall. [131000010030] |I would like to understand what I am doing not just copy paste some rules from internet :). [131000020010] |If you want to really understand what you are doing, you've got your work cut out for you as iptables is massively complex: frozentux iptables tutorial. [131000020020] |This is a highly recommended tutorial (it's free). [131000020030] |If you're willing to break a few bucks: http://www.amazon.com/Linux-Firewalls-3rd-Steve-Suehring/dp/0672327716 [131000030010] |I just stumbled on to this question and I thought I'd add a reference to an IPtables tutorial that I've written. [131000030020] |It's more server-oriented, but it might be useful to anyone configuring IPtables for a home computer as well. [131000030030] |It does include a lot of information on why each rule is set up the way it is. [131000030040] |http://www.ellipsix.net/geninfo/firewall/index.html [131000040010] |Dan Robbins (the creator of Gentoo) wrote a great article on Stateful Firewall Design. [131000040020] |It's by far the easiest to understand iptables tutorial. [131000040030] |It says '2.4' however all but the kernel config will apply equally as well to '2.6'. [131000040040] |Even though the article is hosted by gentoo (I could have linked to IBM developerworks too) it's distribution independent (except for emerge iptables which should be read as use your package manager to get the iptables command). [131000050010] |I'm a huge fan of the Wiki over at Rackspace Cloud Servers. [131000050020] |Their page on IPTables is not as detailed as some of the other stuff out there, but it gets you off the ground without causing too much confusion. [131000060010] |Here's an article I wrote about setting up iptables for a destkop. [131000060020] |IPTables for the average desktop user, and another one if you need to connect to a windows (smb) file share network, called IPTables browsing Samba shares. [131000070010] |How to get file to a host when all you have is a serial console? [131000070020] |When all you have is a serial console (say via telnet through a terminal server), what methods can be used to transfer files in/out of a host? [131000070030] |Cut/paste works for the small/printable stuff and I've played with a combination of uuencode/uudecode (with gzip) handle the unprintable but it's all very limiting. [131000080010] |have you tried minicom file transfer? [131000090010] |I would use kermit, the grandparent of filetransfer programs. [131000090020] |We used that already long before there was Linux. [131000100010] |Don't know if this would work if all you had was a serial console, but if you have network access at all, then you could use nc(1) to copy files using TCP/IP. [131000100020] |In the above example, I cloned sdb1 from a source box to sda1 of the destination box. [131000100030] |My choice of 8675 for a TCP port number was arbitrary; you could use any port you have access to. [131000100040] |And it doesn't have to be a device; it can be any file. [131000100050] |In the second example, I copied my rsa public key(~/.ssh/id_rsa.pub) and added it to the authorized keys file for the target host. [131000110010] |Most of the serial console programs (minicom, HyperTerm, VanDyke CRT...) you'll use on the other end of the connection will have Zmodem support, and most Linux boxes have the lrzsz package installed on them already. [131000110020] |If not, lrzsz is small enough that you could bootstrap the process with one of the other recommended methods. [131000110030] |You could ASCII-upload the sources, either as C text files, or a uuencoded tarball. [131000110040] |Once you have Zmodem on both ends, just type rz to start the receive on the Linux box. [131000110050] |One of the nice things about Zmodem, relative to other alternatives mentioned like nc or kermit, is that it sends out a unique string that the serial console program on the other end recognizes as its cue to start a Zmodem send. [131000110060] |You usually get a file picker dialog at this point, letting you choose the file(s) to upload. [131000110070] |Other nice things about Zmodem are the ability to transfer multiple files at once, automatic resume if a transfer aborts, etc. [131000120010] |How to remove Ctrl-M from files where dos2unix, perl, tr, and sed are not present? [131000120020] |Suppose you are working on a very old unix server where where where dos2unix, perl, tr, and sed are not present. [131000120030] |How can you convert files from dos to unix format? [131000130010] |I think you are referring to removing the caret-M at the end of lines. [131000130020] |You can use search and replace in vi to do this. [131000130030] |In vi I normally do: (where "^" represents CTRL): [131000130040] |Which shows on the screen as: [131000140010] |A server without tr or sed would have to be really old, or missing some basic commands. [131000140020] |Hopefully ed is there; it existed in Unix first edition. [131000140030] |where ^V^M means typing Ctrl+V then Ctrl+M (to enter a literal line feed). [131000140040] |If you know that all lines do end in CR LF, you can use 1,$s/.$// instead (indiscriminately remove the last character on each line). [131000150010] |The 'less' command-line equivalent of 'tail -f' [131000150020] |I would like to open up a file using less, and have it automatically scroll the file similar to 'tail -f'. [131000150030] |I know that I can do less file, and then hit Shift-F to forward forever; like "tail -f". [131000150040] |I want less for use of the --raw-control-chars flag. [131000160010] |use the command "F" while inside of less. [131000160020] |or, to do so automatically, use the +cmd option: [131000170010] |Are there rc logs in arch? [131000170020] |one of my processes is failing to start fairly early in the boot process (I suspect mdadm and I suspect that it's just taking longer than the rc script allows for) but I can't quite catch it (see it) during boot and arch clears the screen before the login prompt appears. [131000170030] |Does arch keep any logs of the init process that might show? or is there any way to see what was on the screen before it clears or keep it from clearing the screen? [131000170040] |update I'm really talking about the rc scripts and output to the screen... this does not actually translate to things sent to the system logs or errors output by daemons unfortunately. [131000170050] |Gentoo had a special log just for the boot output, but it wasn't enabled by default, I'm hoping Arch has something similar. [131000180010] |/var/log/messages would be the first place to look. /var/log/dmesg and the dmesg command could also be helpful. [131000180020] |RC scripts also have their own separate log files, such as Apache, SSH, Postfix, etc. [131000180030] |Check under /var/log for the right log file based on the utility that is having trouble starting. [131000190010] |If you add a -i option to the getty command in /etc/inittab this will stop the screen from clearing. [131000190020] |So something like: [131000190030] |c1:2345:respawn:/sbin/agetty -i -8 38400 tty1 linux [131000200010] |Run a script via cron every other week [131000200020] |I've done quite a bit of research in how to do this, and I see there's no direct way in cron to run a job, say, every other Thursday. [131000200030] |Right now, I'm leaning toward making a script that will just run every week, and will touch a "flag" file when it runs, and if it runs and the file is already there, to remove the file (and not perform the bi-weekly action). [131000200040] |My question is, is there any other more elegant or simpler way to accomplish this goal of a bash script of actions running every other week automatically? [131000200050] |Thanks! [131000210010] |One way might be to use the at utility if you're running Linux. [131000210020] |You could put this at the end of your script: [131000210030] |where X is the time you want to run your script at. [131000210040] |To initialize just call at for the time you want to run it the first time and then the above statement keeps renewing your scheduled call. [131000220010] |I'm not sure if there is a more elegant way to define the every other week, but this may work for you. [131000220020] |This will launch the script at 6:00am on the first and third Thursdays of the month. [131000230010] |Can please someone with comment rights correct the posting to: [131000230020] |Otherwise it will fail depending on the locale you are using. [131000240010] |I used bash to do my math because I'm lazy; switch that to whatever you like. [131000240020] |I take advantage of January 1, 1970 being a Thursday; for other days of the week you'd have to apply an offset. [131000240030] |Cron needs the percent signs escaped. [131000240040] |Quick check: [131000240050] |Note I've chosen random times to show this will work if run anytime on Thursday, and chosen dates which cross year boundaries plus include months with both 4 and 5 Thursdays. [131000240060] |Output: [131000250010] |If you can use anacron on the system, things will be mush simpler. [131000250020] |To use anacron you must have it installed and also you must have root access. [131000250030] |With anacron, one can schedule jobs in a more flexible way, e.g. run X job once a week. [131000250040] |Also anacron runs jobs when computer becomes available, i.e. you don't have to consider when the system is up or down. [131000250050] |To run a script every other week, you have to add a line similar to following to the /etc/anacrontab: [131000250060] |Take a look to the man page for details. [131000260010] |How to save temp data [131000260020] |updated: [131000260030] |I'd like to save a large amount data ( ~ 100MB ) from the standard input in temporary location for the duration of my bash session. [131000260040] |Piping it to a file won't work as I have only 30MB of free space. [131000260050] |I also don't want to save it in a variable. [131000260060] |I'd obviously have to utilize some space other than that of my Disk Storage. [131000260070] |Which leaves my RAM. [131000260080] |Is there some mechanism that will allow me to write to it, and then to retreive the written data again. ( like when you pipe to and from /dev/null ) [131000270010] |you can mount an ramfs and store data there (as a file) [131000280010] |Is it possible to put root in LVM without using initrd? [131000280020] |Hello, [131000280030] |I have just set up a Gentoo base system (which means I can boot and log in and do stuff with it now). [131000280040] |My root partition is in an LVM2 virtual group (with a separated /boot partition). [131000280050] |In order to boot I need to pass the parameters below to the kernel: [131000280060] |Apparently it is using an initial ramdisk to do something (I guess loading the LVM things) before mounting root. [131000280070] |Is there a way that I can put this code into the kernel itself so that no initrd is needed? [131000280080] |If not, how can I make the initrd myself? [131000280090] |It might be useful to add that I had tried compiling the kernel for non-LVM root, without initrd and it worked perfectly. [131000280100] |Then I tried to put the whole thing under LVM and couldn't get the machine to boot (I guess it cannot deal with the LVM stuff). [131000280110] |Then I used the genkernel tool with the --lvm option and it creates the working kernel and initrd that I am currently using. [131000280120] |Now I want to skip genkernel and do everything on my own, preferably without initrd so that the machine will boot somewhat faster (I don't need the flexibility anyway). [131000290010] |Simple answer: No. [131000290020] |If you want LVM you need an initrd. [131000290030] |But as others have said before: LVMs don't slow your system down or do anything bad in another way, they just allow you to create an environment that allows your kernel to load and do its job. [131000290040] |The initrd allows your kernel to be loaded: If your kernel is on an LVM drive the whole LVM environment has to be established before the binary that contains the kernel can be loaded. [131000290050] |Check out the Wikipedia Entry on initrd which explains what the initrd does and why you need it. [131000290060] |Another note: I see your point in wanting to do things yourself but you can get your hands dirty even with genkernel. [131000290070] |Use genkernel --menuconfig all and you can basically set everything as if you would build your kernel completely without tool support, genkernel just adds the make bzImage, make modules and make modules_install lines for you and does that nasty initrd stuff. [131000290080] |You can obviously build the initrd yourself as it is outlined here for initramfs or here for initrd. [131000300010] |edit: just realized you're trying to boot on LVM, I've never setup an LVM, never needed them, so probably the approach here may not work [131000300020] |Here is the basic rules you need to do to create an initrd-less kernel (from memory, I didn't remember exactly): [131000300030] |
  • Recompile your kernel, make sure to built into the kernel (IMPORTANT: not as module!): [131000300040] |
  • motherboard driver and harddrive driver (both under Device Drivers)
  • [131000300050] |
  • filesystem driver for /, /etc/*, and /lib/modules/* (under File systems)
  • [131000300060] |Basically, the kernel needs to be able to mount the root filesystem, read the /etc/fstab, load other driver modules (if necessary), and mount other non-root filesystems to complete the rest of the booting process. [131000300070] |If you have a more involved booting process, e.g. network booting then you need to built in those drivers as well. [131000300080] |
  • Disable initrd from the kernel "General setup >Initial RAM filesystems and RAM disk (initramfs/initrd)support" a.k.a. CONFIG_BLK_DEV_INITRD=n.
  • [131000300090] |
  • Modify GRUB config, you no longer needs init= and realroot=, and setup root= so it points to the root filesystem device.
  • [131000300100] |I think that's all. [131000300110] |Don't forget to keep a backup kernel, and a good copy of a bootable Live CD, in case something happens. [131000300120] |Things that could go wrong: if you compiled in the wrong drivers or if you compile the basic drivers as a module, then the kernel cannot read the filesystem. [131000300130] |Reboot with a fresh kernel, or with a Live CD and recompile a kernel with the correct drivers. [131000300140] |The only hard part is figuring out which driver is relevant to your hardware. [131000300150] |You can use lspci and lshw to help identify your hardware. [131000300160] |If you don't have these tools already, then emerge lshw pciutils. [131000310010] |Yes, you need an initrd. [131000310020] |Here's why: [131000310030] |The normal boot process starts with the bootloader, which knows just enough about your system to find the kernel and run it. [131000310040] |(GRUB2 is smart enough to find a kernel that's located on an LVM2 or RAID partition, but GRUB1 isn't, so it's usually recommended that you create /boot as a separate partition with a simplified layout.) [131000310050] |Once it's loaded, the kernel needs to be able to find the root filesystem, so it can start the boot process. [131000310060] |However, LVM can't start without being triggered by some userspace tools, which exist on the root filesystem, which can't be loaded without the LVM tools, which exist on the root filesystem... ;) [131000310070] |To break this cycle, an initrd or initramfs is a compressed filesystem that's stored with the kernel (either in /boot, or inside the kernel itself), which contains just enough of a Linux system to start services such as LVM or MD or whatever else you want. [131000310080] |It's a temporary filesystem, and only acts as your root filesystem long enough for the real root to be loaded. [131000310090] |As far as actually making one, most documentation on the topic is staggeringly obsolete - lvm2create_initrd, for instance, doesn't even work on Gentoo anymore. [131000310100] |(I set up the same thing a few months ago, and I had to all but rewrite the script before I got a working initrd from it.) [131000310110] |Creating your own initramfs can be fun, and it's the only way to get an absolutely minimal boot process (and learn the ins and outs about how Linux boots in the process), but it's a lot of work. [131000310120] |The short answer: use Dracut. [131000310130] |It's a new framework that's being created for generating an initramfs in a mostly automated way, and it's in portage. [131000310140] |The documentation is a bit sparse, but there's enough of it out there to figure things out, and it's by far the easiest way to get a solid initramfs, and an LVM root. [131000320010] |Yes, it is. [131000320020] |The complications that arise from creating and handling initrds are rendered moot if you install and use grub2. [131000320030] |The grub2 wiki http://grub.enbug.org/LVMandRAID describes how you can have your /boot on lvm with nothing more than an insmod lvm in grub.cfg, the grub configuration file, hence no need for an initrd. [131000320040] |grub2 now at version 1.98 but still in the experimental branch in gentoo. [131000320050] |However it can be installed in another slot and is perfectly usable. [131000320060] |Enjoy! [131000330010] |While it is not possible to not use some sort of initrd it is possible to not use separate initrd files. [131000330020] |(I have never used genkernel so I cannot give instruction for it). [131000330030] |For example I have set option: [131000330040] |Where /usr/src/initrd.contents in my case looks like (I have LVM+tuxonice+fbsplash): [131000330050] |And /usr/src/init is: [131000340010] |KDE custom global shortcuts [131000340020] |How can I set a global shortcut in KDE (4.4) to run a bash script? [131000350010] |First make sure that your script is executable, e.g. like this [131000350020] |Then create the shortcut using the tool which can be accessed by System Settings >Input Actions. [131000350030] |Do a right click in the left pane where existing shortcuts are listed and say New Global Shortcut >Command/URL. [131000350040] |Set the name to something sensible, choose your desired shortcut, set the command to your script, e.g. ~/scripts/myscript.sh and tick the Enabled box. [131000350050] |If you put your script in a folder in path, (following common conventions one would use /usr/local/bin) you can skip the path in the command and just write myscript.sh. [131000360010] |Show a notification across all running X displays [131000360020] |Using the command line, I'd like show a notification on every running X display. ( and running console ) [131000360030] |Something like: [131000360040] |Is there a program that will do this? [131000360050] |If not, can this be implemented with bash? [131000370010] |You can send a message to all consoles with the command wall. [131000370020] |For sending notifications under X there is notify-send which sends a notification to the current user on the current display. [131000370030] |(From your question, I guess you already know this one.) [131000370040] |You can build upon this with some bash scripting. [131000370050] |Basically you have to find out which users are on which X-Displays. [131000370060] |Once you got this info you can use notify-send like this: [131000370070] |Where fschmitt is the user at display 0. [131000370080] |You can parse the output of the "who" command to find all users and their displays. [131000370090] |The output looks like this [131000370100] |You see, there are two users running X sessions, markmerk3 at display 0 and seamonkey at display 1. I think you need to grep for tty[0-9]* then assure that at the end of the line there is (:[0-9.]*) to get rid of console logins and extract the display id from the string between the parentheses. [131000380010] |how do i tell gnome to reread my ~/.profile [131000380020] |gnome reads ~/.profile upon login. when i change something in .profile (for example the LC_MESSAGES) i want gnome to reread the .profile file without logging out and back in. in bash i can tell bash to source .profile. how can i do that for the running gnome session? [131000390010] |I think it is not possible. [131000390020] |The relevant script is /etc/gdm/Xsession. [131000390030] |There quite at the top you'll find [131000390040] |and after that (and sourcing other scripts, loading X resources etc) the desktop environment is started, inheriting the values of .profile just loaded. [131000390050] |As there is no way to change the environment of running processes (if the process has no special functionality to import changed environment, but this is nothing you commonly find), you seem to be out of luck. [131000400010] |How can I shutdown after unmounting a USB device from the command line? [131000400020] |Previously, I asked this question about how to suspend Linux after a set amount of time. [131000400030] |I would like to ask a similar question. [131000400040] |Supposing I have a USB device attached to my system (OS = Fedora 13), are there commands that can: [131000400050] |
  • detach the USB device and,
  • [131000400060] |
  • after detaching it, shutdown the system after a specified interval.
  • [131000400070] |To be more precise, detaching means a command that safely removes the device. [131000410010] |I assume by USB you mean a pendrive or external harddisk mounted to your file system. [131000410020] |You "detach" this by unmounting the device. [131000410030] |For that you will have to use the umount command. [131000410040] |You can use the device or the mountpoint, for example: [131000410050] |umount /dev/sdb1 or umount /mnt/usb [131000410060] |See man umount for more details. [131000410070] |For shutting down your system, you use the shutdown command. -h will "Halt or power off after shutdown". [131000410080] |The manpage says: [131000410090] |So you can use it to shutdown your system after a specific amount of time. [131000410100] |The following command will halt your system after 30 minutes: [131000410110] |shutdown -h 30 [131000410120] |Now you have one command which should only executed after the other one was succesfull. [131000410130] |This is done with &&, shorthand for a conditional statement and a feature of your shell (Note: || exists also). [131000410140] |The second command will only be executed if the first one returned without any errors. [131000410150] |This is indicated by a return code of 0. [131000410160] |For example: [131000410170] |umount /dev/sdb1 &&shutdown -h 15 will detach your USB and halt your system after 15 minutes. [131000410180] |If this doesn't answer your question, please be more specific. [131000420010] |It sounds like you want your machine to shutdown automatically when you remove a USB pendrive. [131000420020] |I haven't done this myself, but the new Upstart service (which is supported in Fedora 9 onwards) does have the ability to run scripts based on an event. [131000420030] |Here's an article discusses how an event can be triggered when how a hotplug device or when a USB printer is plugged in. [131000420040] |In theory, an event could also be generated when you unplug a USB device, and that event could call an arbitrary script , like shutdown -h now or lock the screen. [131000420050] |I've seen Windows and Mac systems which automatically lock the screen when a Bluetooth device leaves the proximity of the computer, and this is probably possible in Linux using Upstart. [131000430010] |vnc over ssh port assignment [131000430020] |Hi, At the office I have on the servers a vnc server running. [131000430030] |In Windows I use putty to connect to the server, I log in and then use realvnc to see the desktop. [131000430040] |But I cannot get this to work on Linux. [131000430050] |I have done it in the past struggling but never again. [131000430060] |What I have done is try to bind my localhost to the port 5901 and then to the port 5901 on the server machine [131000430070] |I am using the vnc client "remote desktop viewer". [131000430080] |Best, [131000440010] |Try ssh -f -L 5901:localhost:5901 server.dog.com -N [131000450010] |“free-as-in-speech” vs. "free-as-in-beer” [131000450020] |What is the difference between "free-as-in-speech" and "free-as-in-beer"? [131000460010] |"free" is ambiguous in English, and FOSS people tend to mean the former when people misinterpret it as the latter, which is why the phrases came about [131000460020] |
  • free as in speech means freedom; in an open-source context, the license doesn't prevent you from fiddling with the code or making your own changes
  • [131000460030] |
  • free as in beer means price; the software costs nothing
  • [131000460040] |There was (is?) a lot of confusion when people said they support "free software" -- free (as in speech) software doesn't need to cost nothing, and costing nothing doesn't necessarily make software "free". [131000470010] |"Free as in free speech" vs "Free as in free beer" isn't a concept, it is an example for an concept. :-) [131000470020] |This example belongs to the GPL and is used to clarify the definition of "free" in the term "Free Software". [131000470030] |Free beer is gratis. [131000470040] |It doesn't cost you anything. [131000470050] |The term refers to the price of a product. [131000470060] |This is not the intention of the word "free" in this context. [131000470070] |The intention is more like "free" in free speech, the liberty to say the things you want and don't getting censored. [131000480010] |http://members.optushome.com.au/brendanscott/papers/four_fs_fallacies_brendanscott_020920.html [131000490010] |As I mentioned in the comments here, I e-mailed Mr. Richard Stallman about this. [131000490020] |Here is his reply: [131000490030] |From: Richard Stallman Date: Fri, Oct 22, 2010 at 9:12 AM Subject: Re: “free-as-in-speech” vs. "free-as-in-beer” To: RENJITH G [131000490040] |QN: I would like to know the exact meaning of "free-as-in-speech" and "free-as-in-beer" [131000490050] |It is hard to give "exact" meanings for philosophical concepts, so I am a bit lost. [131000490060] |The English word "free" has two different meanings. [131000490070] |Many other languages have different words for them. [131000490080] |For instance, I think Hindi has "mukt" for "free as in freedom" and "muft" for "gratis, zero price'. [131000490090] |QN: Also why this example words (the words free-as-in-speech and free-as-in-beer) are being used to descibe the concept? [131000490100] |Those are not the words I use. [131000490110] |I use "free as in 'free speech'" and "free as in 'free beer'". [131000490120] |Is that clearer? [131000490130] |It seems you heard someone else shorten the two phrases a little. [131000490140] |-- Richard Stallman President, Free Software Foundation 51 Franklin St Boston MA 02110 USA www.fsf.org, www.gnu.org [131000500010] |How to run a command inside screen such that you can get back to the command's parent shell? [131000500020] |What's the best way to run a command inside a screen session such that its parent shell can be accessed? [131000500030] |I want to be able to restart it from within the same screen session. [131000500040] |The best I've managed to come up with is the following: [131000500050] |and then: [131000500060] |Then, if top stops running, I'll at least get a new shell within the same screen session I can work with. [131000500070] |This isn't very elegant, though, and I can't quite convince myself that the signal will reliably be sent to the right process if I hit C-c. [131000500080] |Moreover, C-z doesn't work at all. [131000500090] |I'm using bash 3.2.48 on OSX and 3.2.39 on Linux. [131000500100] |Both are probably patched by OS vendors. [131000500110] |There's nothing special about the top command here, of course. [131000500120] |[As an aside, -e'^\\\' reassigns the Magick Screen Key from C-a (a bad default if there ever was one) to C-\.] [131000510010] |Here's an imperfect solution I found. [131000510020] |Then you can run: [131000510030] |(Note that although you'll only see ^M you should actually type C-v followed immediately by C-m.) [131000510040] |It's imperfect because (I think) there is a race condition between the first and second invocations of screen. [131000510050] |From http://aperiodic.net/screen/faq#how_to_send_a_command_to_a_window_in_a_running_screen_session_from_the_commandline, which has lots of other good information as well. [131000520010] |Create a ~/.screenrc.top like so: [131000520020] |Now run screen -c ~/.screenrc.top. [131000520030] |No race condition! [131000530010] |How can I see what processes are running? [131000530020] |I use Ubuntu Server 10.10 and I would like to see what processes are running. [131000530030] |I know that PostgreSQL is running on my machine but I can not see it with the top or ps commands, so I assume that they aren't showing all of the running processes. [131000530040] |Is there another command which will show all running processes or is there any other parameters I can use with top or ps for this? [131000540010] |have you tried ps aux | grep postgres? it really should show up if postgres is running. [131000540020] |If it doesn't... how do you know postgres is running? [131000540030] |(note: it's a common misconception that's it's ps -aux but that's not correct) [131000550010] |From the ps man page: [131000550020] |-e Select all processes. [131000550030] |Identical to -A. [131000550040] |Thus, ps -e will display all of the processes. [131000550050] |The common options for "give me everything" are ps -ely or ps aux, the latter is the BSD-style. [131000550060] |Often, people then pipe this output to grep to search for a process, as in xenoterracide's answer. [131000550070] |In order to avoid also seeing grep itself in the output, you will often see something like: [131000550080] |where foo is the process name you are looking for. [131000550090] |However, if you are looking for a particular process, I recommend using the pgrep command if it is available. [131000550100] |I believe it is available on Ubuntu Server. [131000550110] |Using pgrep means you avoid the race condition mentioned above. [131000550120] |It also provides some other features that would require increasingly complicated grep trickery to replicate. [131000550130] |The syntax is simple: [131000550140] |where foo is the process for which you are looking. [131000550150] |By default, it will simply output the Process ID (PID) of the process, if it finds one. [131000550160] |See man pgrep for other output options. [131000550170] |I found the following page very helpful: [131000550180] |http://mywiki.wooledge.org/ProcessManagement [131000560010] |31 Debian CDs -- Why? and which do I need for a vanilla desktop install? [131000560020] |I've been using Linux (Ubuntu) for a couple of months now, and I want to try Debian to see how different it is. [131000560030] |Well, I've already found a couple of differences.. [131000560040] |
  • The first one that Debian-Live means only-Live.
  • [131000560050] |
  • The second difference has stopped me in my tracks. [131000560060] |There doesn't seem to be a specific .iso CD to download / install.
  • [131000560070] |I am confronted with a list of 31 CDs ... [131000560080] |What is this all about and which .iso do I need for a vanilla (32 bit) desktop install? [131000570010] |The Debian CD set contains all of the packages in the main repository. [131000570020] |Most of this software can easily be downloaded later. [131000570030] |According to the Debian wiki: [131000570040] |Although there are over 30 CDs (or 5 DVDs) in a full set, only the first CD is required to install Debian. [131000570050] |The additional CDs are optional and include extra packages, that can be downloaded individually during the installation, or later. [131000570060] |Just installing CD-1 will limit what software you can install during the installation process, but after installing with the first CD, other software can be downloaded from the Debian repositories, just as with Ubuntu. [131000580010] |Usually many distros provides 'network' installation disk - including Debian. [131000580020] |If you have normal broadband connection probably the easiest way is to install via network install as: [131000580030] |
  • You download only things you need
  • [131000580040] |
  • You (usually - I'm not sure about Debian) don't need to update things right after installation as the newest package is installed with all security patches applied
  • [131000580050] |
  • You don't have problems that you downloaded only some of disks while you favourite editor is not included
  • [131000580060] |Network image is as large as 40-120 MB for debian. [131000580070] |PS. [131000580080] |Probably you would need standalone router for network installation as I doubt that many drivers for USB routers are included on network disk. [131000590010] |Perhaps a simpler way to try Debian. [131000590020] |Mint has their recent LDME. [131000590030] |A version of Mint based on debian. [131000590040] |For all essential purposes it is Debian with some proprietar4y stuff added in ( eg codecs ). [131000600010] |Is "export" needed when setting HISTIGNORE in bashrc files? [131000600020] |As I understand it, exporting an environment variable makes it available to any processes spawned from the current one. [131000600030] |But the only processes that will be interested in the HISTIGNORE variable (and some related variables) are other instances of bash, which will read ~/.bashrc and pick up the value anyway. [131000600040] |So should I use: [131000600050] |or just: [131000600060] |in my .bashrc file? [131000610010] |For shell settings, you don't need export, for the reason you give. [131000610020] |And it's better not to use it, in case some other application reacts to the same variable but doesn't interpret the value in the same way. [131000610030] |I don't know any other application that uses HISTIGNORE, but the issue arises with other variables. [131000610040] |For example, PS1 should definitely not be exported since different shells use this variable but with different escape sequences. [131000620010] |./executable: cannot execute binary file [131000620020] |I have a script that works well when I ssh to the server to execute it myself, but has problems when Hudson, a continuous integration server, runs it. [131000620030] |I am automating tests on an embedded linux system (the target). [131000620040] |The target is connected to Server A (RHEL 5) via serial and operated over minicom. [131000620050] |Server B (FC 12) builds the tests that actually run on the target, and can ssh to Server A. Server C (RH) hosts Hudson, with Server B as a slave. [131000620060] |I've written a runscript (http://linux.die.net/man/1/runscript) script to do everything needed on the actual target; it boots the image, mounts a directory from Server B and executes the tests. [131000620070] |A bash script on Server B invokes minicom with the runscript script along with some companion actions. [131000620080] |I have a bash script on Server B which uses [131000620090] |to get those tests run on the target. [131000620100] |I am on Server C, I can get those tests run by ssh'ing to Server B and executing the script that ssh's to Server A which executes minicom with runscript. [131000620110] |Whew. [131000620120] |To review: [131000620130] |Server A: Hudson uses its slave mechanism to ssh to Server B. [131000620140] |Server B: kickOffTests.sh has the line ssh -t -t ServerA runTests.sh [131000620150] |Server A: runTests.sh calls a perl script which invokes minicom -S my.script ttyE1 [131000620160] |Target, after booting: Mounts a directory from Server B, where the tests are, and enters that directory. [131000620170] |It invokes yet another bash script, which runs the tests, which are compiled C executables. [131000620180] |Now, when I execute any of these scripts myself, they do what they should. [131000620190] |However, when Hudson tries to do the same thing, over in the minicom session it complains about a line in the "yet another bash script" that invokes the C executable, ./executable, with ./executable: cannot execute binary file [131000620200] |I still have a lot to learn about linux, but I surmise this problem is a result of Hudson not connecting with a console. [131000620210] |I don't know exactly what Hudson does to control its slave. [131000620220] |I tried using the line export TERM=console in the configuration just before running kickOffTests.sh, but the problem remains. [131000620230] |Can anyone explain to me what is happening and how I can fix it? [131000620240] |I cannot remove any of the servers from this equation. [131000620250] |It may be possible to take minicom out of the equation but that would add an unknown amount of time to this project, so I'd much prefer a solution that uses what I already have. [131000630010] |The message cannot execute binary file has nothing to do with terminals (I wonder what led you to think that — and I recommend avoiding making such assumptions in a question, as they tend to drown your actual problem in a mess of red herrings). [131000630020] |In fact, it's bash's way of expressing ENOEXEC (more commonly expressed as exec format error. [131000630030] |First, make sure you didn't accidentally try to run this executable as a script. [131000630040] |If you wrote . ./executable, this tells bash to execute ./executable in the same environment as the calling script (as opposed to a separate process). [131000630050] |That can't be done if the file is not a script. [131000630060] |Otherwise, this message means that ./executable is not in a format that the kernel recognizes. [131000630070] |I don't have any definite guess as to what is happening though. [131000630080] |If you can run the script on that same machine by invoking it in a different way, it can't just be a corrupt file or a file for the wrong architecture (it might be that, but there's more to it). [131000630090] |I wonder if there could be a difference in the way the target boots (perhaps a race condition). [131000630100] |Here's a list of additional data that may help: [131000630110] |
  • Output of file …/executable on server B.
  • [131000630120] |
  • Some information about the target, such as the output of uname -a if it's unix-like.
  • [131000630130] |
  • Check that the target sees the same file contents each time: run cksum ./executable or md5sum ./executable or whatever method you have on the target just before yet-another-bash-script invokes ./executable. [131000630140] |Check that the results are the same in the Hudson invocation, in your successful manual invocation and on server B.
  • [131000630150] |
  • Add set -x at the top of yet-another-bash-script (just below the #!/bin/bash line). [131000630160] |This will produce a trace of everything the script does. [131000630170] |Compare the traces and report any difference or oddity.
  • [131000630180] |
  • Describe how the target is booting when you run the scripts manually and when Hudson is involved. [131000630190] |It could be that the target is booted differently and some loadable module that provides the support for the format of ./executable doesn't get loaded (or is not loaded yet) in the Hudson invocations. [131000630200] |You might want to use set -x in other scripts to help you there, and inspect the boot logs from the target.
  • [131000640010] |Would it be possible to jump between prev/next command prompts? [131000640020] |Hi, I'm using zsh in OS X Terminal.app and for quite a while, I've been longing for a way to jump back and forth between prev/next prompts in the terminal's output. [131000640030] |One convenience with this would be to be able to review (and track errors at) the end of each command's output; eg. when you building stuff from source with ./configure; make; make install. [131000640040] |Note: I'm obviously not referring to jumping back and forth in the command-history, but for a way to take a peek at the endings of each command's output. [131000640050] |Has anyone heard of such functionality in the *nix (preferrably also Mac) world? [131000640060] |Would it require some sort of OS-centric Terminal plugin, or can it be programmatically done via a shell script which can be tied to a keyboard shortcut? [131000640070] |Maybe I'm the only one thinking about this? :) [131000650010] |Not sure if this should be an answer, but since I'm posting an image I guess it will work. [131000650020] |You can make your bash prompt look different so that it's easily spotted, or use zsh and make your prompt look something like this. [131000650030] |I took my prompt from someplace online, I forget where. [131000650040] |And I combined it with another zshrc file I found elsewhere. [131000650050] |I'll just paste the whole thing here. [131000650060] |The prompt is all contained in the bottom if you just awnt to take that. [131000660010] |I've never heard of such a feature with typical shells (zsh, fish or otherwise) in typical terminal emulators. [131000660020] |Once you've pressed Enter at a prompt, that command line only exists as a history entry as far as the shell is concerned, and as a bunch of displayed characters (indistinguishable from command output) as far as the terminal emulator is concerned. [131000660030] |On the other hand, the kind of navigation you ask for is available as a matter of course in shells run in an Emacs buffer, with M-x shell if you want your usual shell and Emacs's command line edition or M-x eshell if you want a shell built into Emacs. [131000670010] |One answer to your question is to use emacs with M-x eshell. [131000670020] |This gives you a reasonably full shell functionality inside of emacs. [131000670030] |Taking quick peeks at files can obviously be done by opening them in the editor, but more importantly you can use its search functionality to search back through the buffer for any earlier output (or any earlier prompts). [131000670040] |Another answer is to use screen, I believe this also has a search functionality of the history, but it has been too long since I used it to remember what the key-combos are. [131000680010] |To expand on xenoterracide's comment... [131000680020] |Rather than run make, I put this in my .bashrc [131000680030] |then run m instead of make. [131000680040] |This puts all output to make.log, but only prints errors on the console. [131000680050] |That way you don't have tonnes of output on the screen, can easily see errors, and can read make.log to diagnose any problems if it failed. [131000690010] |In eshell in Emacs, there is command (not yet mentioned here in other answers) that seems to tackle the task you are implicitly wondering about when asking your question -- eshell-show-output; its description (C-h feshell-show-output): [131000690020] |It is bound to C-c C-r, C-M-l. [131000690030] |(eshell-show-output &optional arg) [131000690040] |Display start of this batch of interpreter output at top of window. [131000690050] |Sets mark to the value of point when this command is run. [131000690060] |With a prefix argument, narrows region to last command output. [131000690070] |The narrowing effect (with a prefix argument, i.e., C-u C-c C-r) could be also interesting to you given your task. [131000700010] |Emacs and windows manager keyboard shortcuts without "Super" key [131000700020] |I found a classic M-series keyboard and I want to use it. [131000700030] |However, it does not have the "Windows" key (a.k.a "Super"), only the Shift, Control and Alt modifiers. [131000700040] |My keyboard shortcuts are cluttered as-is, since that I try to control both Emacs and the windows manager (Gnome) only from the keyboard. [131000700050] |I rely on the "Super" key to identify the windows manager shortcuts. [131000700060] |What it the best practice for keyboard-centric work without the "Super" key? [131000710010] |On my old Thinkpads without windows keys, I set capslock to behave as super. [131000710020] |In Gnome, you can achieve this with Preferences->Hardware->Keyboard. [131000710030] |There on tab layout, click on options and there "CapsLock-Key behaviour" and choose "Make CapsLock an additional super". [131000710040] |If you don't use Gnome, you can achieve the same by modifying ~/.xmodmap to include this [131000710050] |and making sure ~/.xmodmap is loaded during startup of X. [131000720010] |Are there any Workload Management subsystems for Linux? [131000720020] |Asked this on superuser, got no response: [131000720030] |Can anyone tell me of the status/state of WLM (Workload Management) kernel scheduler systems in Linux? [131000720040] |Alternatively, any user-space process goal-based load management programs? [131000720050] |This is a good start, but I'm not aware if these proposals are implemented? [131000720060] |http://www.computer.org/plugins/dl/pdf/proceedings/icac/2004/2114/00/21140314.pdf [131000720070] |http://ckrm.sourceforge.net/downloads/ckrm-linuxtag04-paper.pdf [131000720080] |AIX has inclusive WLM, anything comparable for Linux? [131000730010] |Not very sure, but the closest I can think of is cgroups. [131000730020] |Check http://broadcast.oreilly.com/2009/06/manage-your-performance-with-cgroups-and-projects.html [131000740010] |Is Linux a Unix? [131000740020] |So, there are lots of different versions of Unix out there: HP-UX, AIX, BSD, etc. [131000740030] |Linux is considered a Unix clone rather than an implementation of Unix. [131000740040] |Are all the "real" Unices actual descendants of the original? [131000740050] |If not, what separates Linux from Unix? [131000750010] |Linux is more 'Unix-like' so yes simplistically you could call it a clone, the same is true for BSDs (although admittedly BSDs could be considered closer to Unix than Linux). [131000750020] |The main thing that gives Linux the Unix-like title is the fact that it is nearly fully compliant w/ POSIX (Portable Operating System Interface [for Unix]) standards that have built up over time. [131000750030] |The other key thing, is the inheritance of code etc, as demonstrated on Wikipedia, Linux does not actually originate from Unix sources, instead it is pretty much built from scratch (this is disputed however). [131000750040] |So essentially, the main thing that separates Unix from Linux is the ancestry and the standards that it meets. [131000760010] |That depends on what you mean by “Unix”, and by “Linux”. [131000760020] |
  • UNIX is a registered trade mark of The Open Group. [131000760030] |The trade mark has had an eventful history, and it's not completely clear that it's not genericized due to the widespread usage of “Unix” refering to Unix-like systems (see below). [131000760040] |Currently the Open Group grants use of the trade mark to any system that passes a Single UNIX certification. [131000760050] |See also Why is there a * When There is Mention of Unix Throughout the Internet?.
  • [131000760060] |
  • Unix is an operating system that was born in 1969 at Bell Labs. [131000760070] |Various companies sold, and still sell, code derived from this original system, for example AIX, HP-UX, Solaris. [131000760080] |See also Evolution of Operating systems from Unix.
  • [131000760090] |
  • There are many systems that are Unix-like, in that they offer similar interfaces to programmers, users and administrators. [131000760100] |The oldest production system is the Berkeley Software Distribution, which gradually evolved from Unix-based (i.e. containing code derived from the original implementation) to Unix-like (i.e. having a similar interface). [131000760110] |There are many BSD-based or BSD-derived operating systems: FreeBSD, NetBSD, OpenBSD, Mac OS X, etc. [131000760120] |Other examples include OSF/1 (now discontinued, it was a commercial Unix-like non-Unix-based system), Minix (originally a toy Unix-like operating system used as a teaching tool, now a production embedded Unix-like system), and most famously Linux.
  • [131000760130] |
  • Strictly speaking, Linux is an operating system kernel that is designed like Unix's kernel.
  • [131000760140] |
  • Linux is most commonly used as a name of Unix-like operating systems that use Linux as their kernel. [131000760150] |As many of the tools outside the kernel are part of the GNU project, such systems are often known as GNU/Linux. [131000760160] |All major Linux distributions consist of GNU/Linux and other software.
  • [131000760170] |
  • There are Linux-based Unix-like systems that don't use many GNU tools, especially in the embedded world, but I don't think any of them does away with GNU development tools, in particular GCC.
  • [131000760180] |
  • There are operating systems that have Linux as their kernel but are not Unix-like. [131000760190] |The most well-known is Android, which doesn't have a Unix-like user experience (though you can install a Unix-like command line) or administrator experience or (mostly) programmer experience (“native” Android programs use an API that is completely different from Unix).
  • [131000770010] |The choosen answer explains it quite exhaustively, but you would have to watch a whole documentary to know all the details between the UNIX initial developement, and how Linux went out. [131000770020] |First you have to consider that Linux is the kernel, which was made by linus and other programmers. [131000770030] |He chose to release it with the GPL, which by the time was a license made by the FSF, (RMS and other folks), who were also developping their own kernel and GNU. [131000770040] |What we usually call Linux is, at first, the kernel, plus all other tools originally coming from the GNU project. [131000770050] |Those two project are historically different, because at the time, the kernel from the FSF folks was abandonned to favor the Linux kernel, which was much better. [131000770060] |I remember there is a documentary, you should really watch it, I find it important for your programming culture. [131000770070] |Another thing you have to consider when thinking about "*nix", is also everying involving POSIX and other architecture-standardised stuff. [131000770080] |It's subject of OS design/research, but it defines precisely how the involved OSes works, and is crucial when you have a kernel working well with its tools. [131000780010] |You can see a reference chart supporting above comments at - http://www.computerworld.com/common/images/site/features/2009/062009/unix_chart_775.jpg [131000790010] |For all intents and purposes, a typical modern Linux distribution (Ubuntu, Debian, Red Hat, Fedora, Slackware, etc) is a Unix, but strictly speaking, no system can claim to be Unix without being certified, so instead people say they are Unix-like. [131000790020] |They are inspired by Unix, and carry on its culture. [131000790030] |This also applies to BSD systems. [131000790040] |Mac OS X is certified Unix, so it's Unix both in name and indeed. (and it's actually based on BSD). [131000790050] |It should be noted that since Linux itself is just a kernel, it can be used to build non-unix-like systems (such as Android). [131000800010] |Markdown Viewer [131000800020] |I found a file formatted with Markdown. [131000800030] |Could you guys suggest what viewer that I could use to view this type of files? [131000800040] |Hopefully one without gui (if it's possible) [131000800050] |Update I was actually looking for a viewer that could parse markdown file format that does not need any conversion. [131000800060] |But something close to that should be ok. [131000810010] |The following website provides a tool that will translate markdown into HTML: [131000810020] |http://daringfireball.net/projects/markdown/ [131000810030] |Once you convert the file to HTML, there are a number of command line tools to use to view the file. [131000810040] |Using a test file that contains markdown formatted-text, I found the following worked nicely. [131000810050] |html2text is one of many tools you can use to view html formatted text from the command line. [131000810060] |Another option, if you want slightly nicer output would be to use lynx: [131000810070] |If you are an emacs user, someone has written a mode for markdown which is available here: http://jblevins.org/projects/markdown-mode/. [131000810080] |This provides nice syntax highlighting as can be seen in the screenshot on that website. [131000810090] |All of these tools should be available for slackware. [131000820010] |I know you said you preferred a non-GUI application, but I am currently working on a GUI application called DownMarker which does this. [131000820020] |You can find the source in a mercurial repository here. [131000820030] |You can find a stand-alone executable to run with mono or .NET here. [131000820040] |Caveat: It is far from finished and only occasionally tested on linux/mono. [131000820050] |Last test I did was on Mono 2.6. [131000820060] |If you want to build it yourself will need a recent version of mercurial to clone the repository, and MonoDevelop to compile the application. [131000830010] |2 more tools: [131000830020] |- Showdown is JavaScript port or Markdown: http://attacklab.net/showdown/ . [131000830030] |You can use it only from browser [131000830040] |- txt2tags can read Markdown format but it adds a lot of new options and featues: http://txt2tags.org/online.php [131000840010] |How do I find out what hard disks are in the system? [131000840020] |I need to know what hard disks are available, including ones that aren't mounted, possibly aren't formatted. [131000840030] |I can't find them in dmesg or /var/log/messages (too much scroll) so... [131000840040] |I'm thinking there's a way to use /dev or /proc to find out, but I don't know what it is. for some clarification this is linux [131000850010] |How about [131000860010] |This is highly platform-dependent. [131000860020] |Also different methods may treat edge cases differently (“fake” disks of various kinds, RAID volumes, …). [131000860030] |Under Linux 2.6, each disk and disk-like device has an entry undr /sys/block. [131000860040] |Under Linux since the dawn of time, disks and partitions are listed in /proc/partitions. [131000860050] |Alternatively, you can use lshw: lshw -class disk. [131000860060] |If you have an fdisk or disklabel utility, it might be able to tell you what devices it's able to work on. [131000860070] |You will find utility names for many unix variants on the Rosetta Stone for Unix, in particular the “list hardware configuration” and “read a disk label” lines. [131000870010] |@Giles says this is highly platform-dependent. [131000870020] |Here's one such example. [131000870030] |I'm running a CentOS 5.5 system. [131000870040] |This system has 4 disks and a 3ware RAID controller. [131000870050] |In my case, lshw -class disk, cat /proc/scsi/scsi and parted --list shows the RAID controller (3ware 9650SE-4LP). [131000870060] |This doesn't show the actual disks: [131000870070] |only shows the 3ware RAID controller which provides the /dev/sda volume: [131000870080] |In order to see the disks which lie underneath, I had to install the tw_cli utility from 3ware, and ask the controller itself. [131000880010] |Install Ubuntu 10.10 server from USB (with GRUB4DOS) [131000880020] |I have had no problem installing Ubuntu desktop when I boot off a live USB, but the server version has given me some trouble. [131000880030] |I think it has to do with the way GRUB handles drivers. [131000880040] |When the server install tries to look from the CD it can't find it. [131000880050] |I use the following to load it: [131000880060] |Is there any way to pass the location of the ISO to Ubuntu? [131000880070] |EDIT: GRUB4DOS is run from the USB, not the HD. [131000890010] |Have you tried installing Grub on the USB and tell it to boot from your ISO? [131000890020] |I'm not sure with server edition, but I have been using and installing Ubuntu desktop this way. [131000890030] |EDIT: I have just tried this and it doesn't work. [131000890040] |I'm leaving the answer here just to keep track of things. [131000890050] |Just don't downvote me please ;) [131000890060] |Here is the entry in my /boot/grub/grub.cfg on the USB [131000900010] |If you want to install an Ubuntu 10.10 Server from an USB Key, you might want to try "Unetbootin". [131000900020] |Download an Run it, select your iso file and it will take care of installing GRUB and copy the files over. [131000910010] |This is a PITA to handle manually. [131000910020] |I just recently found Multiboot USB for Ubuntu and it works like a champ. [131000910030] |You can feed ISOs into it and it takes care of creating the syslinux menu and all. [131000910040] |It is a French program, but there are English instructions here. [131000920010] |It's awfully simple: [131000920020] |
  • Set GRUB4DOS to boot from ISO, (which is what you probably done already)
  • [131000920030] |
  • When Ubuntu Installer complains about no CD-ROM select go to shell console option,
  • [131000920040] |
  • Use a set of commands like this one: [131000920050] |
  • Go back to installer and enjoy
  • [131000920060] |Hope it helps somebody... [131000920070] |I've spent lots of time looking for this solution, until finally coming to it by myself. [131000930010] |Mount samba filesystem into RHEL 5.5 [131000930020] |I have a trial RHEL version for a proof of concept where I was asked to mount a windows filesystem into linux. [131000930030] |I tried [131000930040] |But it gives me: [131000930050] |I get to know I need samba-client to do this. [131000930060] |Question. [131000930070] |After executing [131000930080] |This is what I get: [131000930090] |Does it mean I have samba-client already? [131000930100] |If so, what do I need to to to mount the windows share? [131000930110] |Someone suggested me to try: yum -install samba-client but since this is a trial version, I'm not subscribed to RHN and can't get the update. [131000930120] |How else can I install the client? [131000930130] |Final question, if I can't do this, am I able to still mount for instance other RHEL? ( how is that called? regular mount or somthing? ) [131000930140] |Thanks in advance [131000940010] |You do not need samba-client for that. [131000940020] |What you need is the smbfs or cifs kernel module. smbfs is deprecated and should not be used (unless you can't use cifs for some reason. e.g. your distribution is too old or perhaps you're trying to connect to a Win95 box or something.) [131000940030] |Try: [131000940040] |Then try with mount -t cifs ... as mentioned by Gilles. [131000940050] |If that doesn't work, you can access the files using smbclient (e.g.) instead of mounting the filesystem. smbclient is in the samba-client and gives you an interface similar to a command line FTP client. [131000940060] |To "mount [...] other RHEL", there are various options. [131000940070] |You could use NFS (in which case you would have to set up an NFS server on the machine you want to mount.) [131000940080] |Another possibility is sshfs, in which case all you need on the server is an SSH server, but the client will need sshfs, which needs fuse. [131000940090] |I don't know if RHEL 5.5 supports fuse. [131000940100] |It would also be possible to set up Samba on the other RHEL box and then mount using mount -t cifs ... as if it were a Windows box. [131000950010] |What does the Virtual kernel Memory Layout in dmesg imply? [131000950020] |While going through the "Output of dmesg" I could see a list of values which i am not able to understand properly. [131000950030] |From the values i understand that i have 2GB RAM(Physical memory). [131000950040] |But rest of the things seems to be Magic Numbers for me. [131000950050] |I would like to know about each one (fixmap, pkmap,.. etc.) in brief(if more doubts, I will post each one as a separate Question)? [131000950060] |Could someone explain that to me? [131000960010] |First off, a 32 bit system has 0xffffffff (4'294'967'295) linear addresses to access a physical location ontop of the RAM. [131000960020] |The kernel divides these addresses into user and kernel space. [131000960030] |User space (high memory) can be accessed by the user and, if necessary, also by the kernel. [131000960040] |The address range in hex and dec notation: [131000960050] |Kernel space (low memory) can only be accessed by the kernel. [131000960060] |The address range in hex and dec notation: [131000960070] |Like this: [131000960080] |Thus, the memory layout you saw in dmesg corresponds to the mapping of linear addresses in kernel space. [131000960090] |First, the .text, .data and .init sequences which provide the initialization of the kernel's own page tables (translate linear into physical addresses). [131000960100] |The range where the kernel code resides. [131000960110] |The range where the kernel data segments reside. [131000960120] |The range where the kernel's initial page tables reside. [131000960130] |(and another 128 kB for some dynamic data structures.) [131000960140] |This minimal address space is just large enough to install the kernel in the RAM and to initialize its core data structures. [131000960150] |Their used size is shown inside the parenthesis, take for example the kernel code: [131000960160] |In decimal notation, that's 3'255'914 (3179 kB). [131000960170] |Second, the usage of kernel space after initialization [131000960180] |The lowmem range can be used by the kernel to directly access physical addresses. [131000960190] |This is not the full 1 GB, because the kernel always requires at least 128 MB of linear addresses to implement noncontiguous memory allocation and fix-mapped linear addresses. [131000960200] |Virtual memory allocation can allocate page frames based on a noncontiguous scheme. [131000960210] |The main advantage of this schema is to avoid external fragmentation, this is used for swap areas, kernel modules or allocation of buffers to some I/O devices. [131000960220] |The permanent kernel mapping allows the kernel to establish long-lasting mappings of high-memory page frames into the kernel address space. [131000960230] |These are fix-mapped linear addresses which can refer to any physical address in the RAM, not just the last 1 GB like the lowmem addresses. [131000960240] |Fix-mapped linear addresses are a bit more efficient than their lowmem-colleagues. [131000960250] |If you want to dive deeper into the rabbit hole: Understanding the Linux Kernel [131000970010] |How can I concatenate a shell variable to other other parameters in my command lines ? [131000970020] |How can I concatenate a shell variable to other other parameters in my command lines ? [131000970030] |For example, [131000970040] |I need to concatenate ".sql" to $WEBSITE [131000970050] |thanks [131000980010] |I usually use quotes, e.g. echo "$WEBSITE.sql". [131000980020] |So you could write it like: [131000990010] |Use ${ } to enclosure a variable. [131000990020] |Without curly brackets: [131000990030] |would give [131000990040] |and nothing, because the variable $VARbar doesn't exist. [131000990050] |With curly brackets: [131000990060] |would give [131000990070] |Enclosing the first $VAR is not necessary, but a good practice. [131000990080] |For your example: [131000990090] |This works for bash, zsh, ksh, maybe others too. [131001000010] |Just concatenate the variable contents to whatever else you want to concatenate, e.g. [131001000020] |The double quotes are unrelated to concatenation: here >$WEBSITE.sql would have worked too. [131001000030] |They are needed around variable expansions when the value of the variable might contain some shell special characters (whitespace and \[?*). [131001000040] |I strongly recommend putting double quotes around all variable expansions and command substitutions, i.e., always write "$WEBSITE" and "$(mycommand)". [131001000050] |For more details, see $VAR vs ${VAR} and to quote or not to quote. [131001010010] |cURL access HTTPS website [131001010020] |Hi, [131001010030] |I trying to access the following site with cURL. (https://www.fleetagent.be) I have cURL configured with the following switches -L -k --proxy [username:password] I get the following error. [131001010040] |What switches do need to add to get cURL to get the website? [131001010050] |The url https://www.fleetagent.be is redirected to https://www.fleetagent.be/portal/pls/portal. [131001010060] |Somehow the website is authenticating it self for the redirected portal. how can i simulate this behavior with cURL? [131001010070] |Thanks. [131001010080] |Darrell. [131001020010] |I asume you have an account for this portal. [131001020020] |Add it to your curl call: [131001020030] |You are only submitting username and password for the proxy, but not for the actual website. [131001030010] |Why isn't GNU/Linux SUS v3+ compliant? [131001030020] |I am looking for specific details as to why isn't GNU/Linux currently SUS(Single UNIX Specification) v3 or even better SUS v4 compliant? [131001030030] |What application apis and user utilities does it miss or implement in a non-SUS compliant way? [131001040010] |To get a certification you need to pay, and it's actually really expensive, this is what BSD like and GNU/Linux operating system vendors like don't apply to it. [131001040020] |So there is even not a reason to check whatever or not GNU/Linux is compliant. [131001040030] |http://en.wikipedia.org/wiki/Single_UNIX_Specification#Non-registered_Unix-like_systems [131001040040] |Most of all the GNU/LInux distribution follows the Linux Standard Base, that is free of charge and recognized by almost all the Linux vendors. [131001040050] |http://en.wikipedia.org/wiki/Linux_Standard_Base [131001050010] |Problem with Fedora 14 Virtual Desktops (KDE, Compiz) [131001050020] |I have multiple, random problems with my Virtual Desktops. [131001050030] |I'm running Fedora 14 with KDE and Compiz on a dual-monitor config. [131001050040] |What happens (at random): [131001050050] |
  • I often (almost always) have a problem with the Desktop of my Virtual Desktops (except for the 1st virtual desktop, that works all the time): [131001050060] |
  • Often, the background of the desktop is black and unresponsive (no wallpaper loaded, unresponsive to mouse actions).
  • [131001050070] |
  • Sometimes the background of the desktop is composed of the windows opened in Virtual Desktop #1, but still unresponsive (I can only interact with the windows when I am on the correct VD)
  • [131001050080] |
  • I sometimes have problems with the task bars: [131001050090] |
  • Minimized windows appear on the task bars of all the VDs.
  • [131001050100] |
  • Then, if for example on VD #1 task bar I click on a Window which is opened in VD #2, it will switch to VD #2, displays the window and that window won't appear in other VDs task bars (because it is not minimized anymore).
  • [131001050110] |
  • I installed the plugin rotating cube in compiz (to have hotkey to switch from one VD to another). [131001050120] |But when I try to switch to the next or previous VD, it does the animation, but instead of switching it just stays on the same VD and minimize all the windows...
  • [131001050130] |Any idea? [131001060010] |wireless problem [131001060020] |Hi, I just installed Ubuntu 10.10 to make my dell inspiron 1564 <64bit> dual boot. [131001060030] |But I can't access wi-fi. [131001060040] |I guess, I need to download drivers for wireless. [131001060050] |My system details are: [131001060060] |Any suggestions? [131001070010] |It looks like the wireless device is recognized and the driver is working, otherwise we would not see wlan0 in the list given by iwconfig. [131001070020] |First, look to see if your system has a switch or a function-key for turning off wireless, and make sure it's not activated. [131001070030] |After that, check the Network Manager applet; this is an icon in your notification area. [131001070040] |If you haven't changed your Ubuntu setup, it should be in the upper-right and look like either an up/down arrow or radio waves (concentric arcs). [131001070050] |If you click it, it should show a list of networks, including your wired ethernet and any wifi access points in the area. [131001070060] |If it shows the list, connecting should be as simple as clicking on the your access point and typing in the passphrase. [131001070070] |Here is a good article that shows the Network Manager icon and describes this process. [131001070080] |If there is no access point list in Network Manager, run iwlist wlan0 scan; it should show a list of access points in your area. [131001070090] |If it does show a list of access points, then there is something wrong with Network Manager, and more work is required to either fix Network Manager or get an alternative to Network Manager. [131001070100] |If it doesn't show the list, it would seem that the driver isn't working completely right, and there will be more work to figure out what's wrong. [131001080010] |Inconsistency in behavior of 'rm' when a mounted volume is involved? [131001080020] |If I run the following sequence of commands: [131001080030] |I get this output: [131001080040] |I get the warning because I could simply have issued rm -r link or, better still, rm link. [131001080050] |Regardless, that command did get the job done (i.e. removed the file named "link"). [131001080060] |Things are a bit different when doing such a thing on a mounted volume, where "dir" is replaced with some like "/media/my_movies". [131001080070] |In such a case, the entire volume will be wiped, not just the symlink as in the previous example. [131001080080] |Why is it like that? [131001080090] |Is this some bug in rm, or is this expected? [131001080100] |Why the inconsistency? [131001080110] |UPDATE: Maybe I was dizzy when I was experiencing this because when I try now, "dir" is not getting deleted while its contents are, and in both cases (mounted and local directory). [131001080120] |I'm using Linux 2.6.32, and I think I was using 2.6.37 then. [131001090010] |On my system (Debian; Linux 2.6; rm --version reports GNU coreutils 8.5), whether or not dir is a mount point, the following removes file, but not dir or link, and gives me the same error you saw: [131001090020] |If I'm following you right, your rm -r link/ command doesn't remove file, unless dir/ is a mount point. [131001090030] |If that's the case, I think you're seeing a bug in rm. There's no good reason for a mount point to change its behavior like that. [131001090040] |It would be interesting to know what version of rm you're using. [131001100010] |using brace expansion to change filenames, not extensions? [131001100020] |I have a directory containing a bunch of files with different extensions, but the filename before the extension is all the same. [131001100030] |E.g., file1.txt, file1.jpg, file1.pdf, file1.odt... [131001100040] |I want to change the 'file1' part, but not the extension, so the result would be, e.g., newfilename.txt, newfilename.jpg, newfilename.pdf, newfilename.odt [131001100050] |I can't figure out how to do this without tediously running mv file1.txt newfilename.txt on every one. [131001100060] |I can find lots of tuturials online to change file names with brace expansion if you know all the parts to expand, but nothing to just replace file1 with newfilename no matter what the extension. [131001100070] |Is this possible, or am I barking up the wrong tree? [131001100080] |Thanks [131001100090] |EDIT: I'm sorry, not moments after posting this I found a different page in my Google results that answered the question for me: for f in file1.*; do mv "$f" "${f/file1/newfilename}"; done works perfectly. [131001110010] |I found this just after I posted the question: [131001110020] |for f in file1.*; do mv "$f" "${f/file1/newfilename}"; done [131001110030] |Works like a charm. [131001120010] |You can do that with bash, bu there are other tools more suited for the job. [131001120020] |On most distros: [131001120030] |On Debian and Ubuntu, replace rename with rename.ul. [131001130010] |restore suse grub [131001130020] |I upgraded my ubuntu and that resulted in its grub loader being used. [131001130030] |I have a triboot of windows, ubuntu and suse. [131001130040] |I prefer the suse bootloader which I was using before the ubuntu updates. [131001130050] |I would like to restore the suse boot loader from yast. [131001130060] |How do i do it? [131001140010] |You'll want to boot into SuSE, and run (as root) grub-install /dev/sda (replace /dev/sda with the boot device on your computer. [131001140020] |You'll want to update your /boot/grub/menu.lst in SuSE to include an entry for Ubuntu. [131001150010] |The generic procedure to restore Grub is [131001150020] |
  • Boot into something Linux (either live CD or on disk, but must have Grub commands available) -- I don't know about other *nix
  • [131001150030] |
  • Mount the partition that holds the OS with Grub to be fixed, be sure to mount the separated boot partition if you have it
  • [131001150040] |
  • Issue the following command, remember to replace /mnt/suse and /dev/sda with your mount point and device grub-setup -d /mnt/suse /dev/sda
  • [131001150050] |Alternatively, after step 2, you can chroot to /mnt/suse and from there execute [131001150060] |I find the Ubuntu help page very informative at this. [131001160010] |How to get my USB stick to auto-mount? [131001160020] |I used to be able to have my USB stick auto-mount when I plugged it in, on my GNOME desktop. [131001160030] |After some fiddling with my system, it doesn't happen anymore. [131001160040] |I now have to resort to doing this using the command line. [131001160050] |Here's the Window that appears when I stick it in: [131001160060] |Here's the end of dmesg output: [131001170010] |Looks like your USB stick has a hidden partiton that acts as a CD-ROM drive. [131001170020] |You might need to look for a Windows utility from the manufacturer that can remove that, unfortunately. [131001180010] |So I went and tried mounting the USB stick with pmount /dev/sdb1 /mnt/blah and it it gives a more useful message than the GUI dialogue: [131001180020] |This led me to find that "/etc/fstab" actually has an entry for /dev/sdb1: [131001180030] |The reason for this is that my stick was actually attached while installing Debian Squeeze, and so got automatically added in there. [131001180040] |That's what will happen when you install from the same stick, and now I'm curious how others avoid this problematic situation. [131001190010] |How to re-mount a USB stick after unmounting from Nautilus without disconnecting it? [131001190020] |I find that in order to re-mount a USB stick, I have to physically disconnect it, and then re-connect it. [131001190030] |How can I do this without such tiring physical action? [131001200010] |From my experience in Ubuntu, when you "eject" a USB stick from within Nautilus, the device actually disappears from the system. [131001200020] |I'm not sure why this is, but neither Nautilus nor the command line can get it back. [131001200030] |I guess the logic is that once you eject a USB stick you don't want it back, but are going to disconnect it. [131001200040] |The way I work around this (when needed), is by using umount instead of Nautilus. [131001200050] |You could also just call sync to flush the filesystem buffers to the disk. [131001200060] |Just found a thread which has more info : http://ubuntuforums.org/showthread.php?t=1477247 [131001200070] |So basically either a) Rebuild nautilus from source without that patch (and keep it up to date when you update your system...) or b) use another file manager (at least when unmounting ^^). [131001210010] |How to change keyboard keymap [131001210020] |I accidentally set my keyboard type to US during installation, but it actually is UK type. [131001210030] |How do I change it? [131001210040] |[note] I use Debian Squeeze. [131001220010] |The Debian way is: [131001220020] |To make the change visible in X (else reboot): [131001230010] |set umask to 0002 for sftp and scp [131001230020] |I want files sent to my server using sftp and scp to be group-writable. [131001230030] |How can I do that? [131001230040] |I tried using libpam-umask from http://wiki.debian.org/DebianDesktopHowTo but it didn't work. [131001230050] |EDIT: Is there any way I can troubleshoot pam? [131001230060] |Is there a log? [131001230070] |Is there any common reason why libpam-umask would not work? [131001230080] |Do I have to install something? [131001240010] |I think PAM reads the default umask from /etc/login.defs as of Debian 6.0, but I do not currently have access to a system to check on. [131001250010] |Last time I had umask problem, trying to get all files in a directory to be group readable no matter who created them. [131001250020] |I got a bit stuck at first; I could set the sticky bit on the group, so all files had same group, but could find no way to set permissions consistently and correctly. [131001250030] |The use of a cron job to regularly put it right did not seem satisfactory. [131001250040] |But then someone told be a solution. [131001250050] |Posix ACLs, you can set in a directory properties(users,groups,permissions) to inherit. [131001250060] |You will probably need to install it, and new backup tools (the default ones don't always know about ACLs) [131001260010] |Find the owner of a directory or file, but only return that and nothing else [131001260020] |I am looking for a command that will return the owner of a directory and only that--such as a regex parsing the ls -lat command or something similar? [131001260030] |I want to use the result in another script. [131001270010] |stat from GNU coreutils can do this: [131001270020] |Unfortunately, there are a number of versions of stat, and there's not a lot of consistency in their syntax. [131001270030] |For example, on FreeBSD, it would be [131001270040] |If portability is a concern, you're probably better off using Gilles's suggestion of combining ls and awk. [131001270050] |It has to start two processes instead of one, but it has the advantage of using only POSIX-standard functionality: [131001280010] |Parsing the output of ls is rarely a good idea, but obtaining the first few fields is an exception, it actually works. [131001280020] |Another option is to use a stat command, but the problem with stat from the shell is that there are multiple commands with different syntax, so stat in a shell script is unportable (even across Linux installations). [131001280030] |Note that testing whether a given user is the owner is a different proposition. [131001290010] |One can also do this with GNU find: [131001290020] |This isn't portable outside of the GNU system, but I'd be surprised to find a Linux distribution where it doesn't work. [131001300010] |Sorting by date [131001300020] |Original: [131001300030] |Output: [131001300040] |How could I get the output where the newest file is at the top? [131001310010] |ls -lt [131001320010] |Is that a text file you're trying to sort, or are you trying to view a directory listing by date? [131001320020] |For the latter, use the -t flag to ls. [131001320030] |For the former, see in particular the -M flag to GNU sort, which sorts by three-letter month name abbreviations. [131001320040] |The following command sorts by the 3rd, 1st, 2nd and 4th columns, treating the second sort key as a month name. [131001320050] |Do consider always using Japanese/ISO style dates, always in the order YYYY-MM-DD-HH-MM-SS (i.e. most significant first, constant column width). [131001320060] |This way sorting by date is identical to a lexicographic sort. [131001330010] |If you are not fussy about date format, your best bet is to change it to something that's easy to sort, e.g.: [131001330020] |Add whichever parameter (recursive...) to ls and sort the output of this. [131001330030] |If the date format matters to you, you could use awk or perl to read the date (both awk and perl have powerful date parsing functions) and sort on that basis, but then the standard date format is a pain to parse as it is not always the same number of words, so I'll leave you find that solution. [131001340010] |Give a warning when something is about to be deleted (by root) [131001340020] |I know that root can do anything, but is there a way to at least alert root that they are about to delete a folder that perhaps shouldn't be deleted? [131001340030] |We keep a work directory in our /tmp folder, and from time to time an administrator will come along and purge the /tmp folder with roughly sudo rm -rf *. [131001340040] |Is there a way to give something like a prompt or alert that they are about to delete a specific folder? [131001340050] |Something along the lines of: [131001340060] |I know, the best solution is to move this folder elsewhere (the /tmp folder is called temp for a reason after all!), but that has other problems. [131001340070] |Hence my question. [131001340080] |Asking this question makes me wonder, is it bad practice to actually blindly delete all the contents of the /tmp folder? [131001340090] |Isn't a better approach to only delete files that are more than a certain age? [131001350010] |As the earlier question points out, there is no out of the box solution to this problem. [131001350020] |But you can always opt to do this through a script. [131001350030] |Something like the script first checks for whatever the conditions you set for deletion/delete protection and takes an appropriate action. [131001350040] |Which in case you can rename rm and rmdir to something else. [131001350050] |Create a script by the same in their place. [131001350060] |That script can do whatever you want. [131001360010] |chmod +t /tmp/perm_file [131001360020] |source: http://oldfield.wattle.id.au/luv/permissions.html [131001370010] |Moving your work folder is the solution. [131001370020] |You're right that it is a little bit dangerous to wipe out files in /tmp blindly — normally, it's done either on system boot/shutdown or by using an access-time based deletion program (like tmpwatch). [131001370030] |But by its definition, the space volatile and it's not reasonable to expect otherwise. [131001370040] |If you really want to prevent this, though, SE Linux could do it. [131001370050] |You would give the directory a particular label, and configure it so that root doesn't normally have the unlink permission for objects with that label. [131001370060] |This seems like significantly more work than just moving the directory to a better shared location, though — and since it causes an SE Linux audit message rather than the nice "are you sure y/n" prompt you're imagining, it seems like it'll eventually cause frustrating confusion. [131001380010] |You could change the directory attributes on the directory to be immutable: [131001380020] |Unfortunately, since the directory is immutable, you can't modify it either: [131001380030] |You can have subdirectories that are mutable, but rm -rf will delete the files still. [131001380040] |So this solution will only work if you want read-only content in /tmp. [131001380050] |If you must have RW content in /tmp that's undeletable, why don't you just put it somewhere else more permanent, and create a symlink in /tmp, that can be easily restored. (perhaps automatically if missing?) [131001390010] |Move /bin/rm to another location (like /bin/original/rm) and replace /bin/rm with a script that, if $UID is 0, checks the parameters for specific folders and takes appropriate action, calling /bin/original/rm if needed. [131001390020] |You probably need to check somehow if an interactive user is calling the script, as /bin/rm could be used by system utilities. [131001400010] |Apache and Tomcat integration [131001400020] |I am trying to integrate apache and tomcat. [131001400030] |I thus want apache to forward requests to tomcat. [131001400040] |I am using the mod_jk module for apache to achieve this. [131001400050] |So far I am trying to get tomcat to auto-gen the configuration files for the mod_jk - I add the relevant to my server.xml [131001400060] |This does not however work. [131001400070] |Please could someone that has done this recently give me some direction. [131001400080] |I suspect that a lot of the documentation is for old versions of apache and tomcat. [131001410010] |Okay, I got it. [131001410020] |You have to include the worker.properties before it will generate the mod_jk.conf [131001420010] |How does the shell filename expansion delimit items within a ( * ) list? [131001420020] |I don't understand shell expansion fully yet (hopefully, one day soon I will)... [131001420030] |I saw this comment to a superuser question, but I think I'm still parked at the kerb... [131001420040] |Using Linux without the shell is like driving a Ferrari at 50 km/h through city traffic. [131001420050] |All fun will just go away ... [131001420060] |I don't understand the following example.. [131001420070] |What heirarchy, or whatever, is causing the 2nd example "array item count:" to be different to the 1st example? [131001420080] |What happened to the shell introduced "space"?. or is it the echo which is introducing the space, and the shell is (perhaps) using \0? [131001430010] |From man bash [131001430020] |EXPANSION Expansion is performed on the command line after it has been split into words. [131001430030] |There are seven kinds of expansion performed: brace expansion, tilde expansion, parameter and variable expansion, command substitution, arithmetic expansion, word splitting, and pathname expansion. [131001430040] |The order of expansions is: brace expansion, tilde expansion, parameter, variable and arithmetic expansion and command substitution (done in a left-to-right fashion), word splitting, and pathname expansion. [131001430050] |The reason this gives you 4 entries is because an unquoted $names parameter is further subject to word splitting based on the internal field separator IFS which is by default . [131001430060] |If you were to quote "$names" to inhibit word splitting, then you'll only get one array element with value f 1 f 2, again not what you want. [131001430070] |The above on the other hand is only subject to pathname expansion which happens to be the last expansion performed. [131001430080] |The results are not subject to word splitting thus you get the desired 2 elements. [131001430090] |If you want to make array=( $names ) work then you'll need to somehow separate the file names by a non-space character which also is not contained in the file names. [131001430100] |You'll then need to set IFS to this character. [131001430110] |A more elegant way to do this would be to use the NUL byte \0 as the filename delimiter as that is guaranteed to never be apart of a filename. [131001430120] |To accomplish this we will need to use the find command with its -print0 flag as well as the read builtin delimited on NUL. [131001430130] |We well also need to clear IFS so no word splitting on spaces is performed. [131001430140] |

    Update

    [131001430150] |Expansion is performed on the command line after it has been split into words. [131001430160] |I can see how one would be confused by the quote above only to have it further state that word splitting is the 2nd to last expansion to occur. [131001430170] |A better way to word that quote in my opinion would be: [131001430180] |Expansion is performed on the command line after it has been split into arguments. [131001430190] |The splitting of arguments on the shell is always done by white space, and it's those arguments which are further subject to expansion. [131001430200] |If you want to have white space in your argument you must either use Quoting or Escaping. IFS does not augment argument splitting, only word splitting. [131001430210] |Consider this example: [131001430220] |Notice how setting IFS to # did not alter the fact that the shell still only saw one argument f1#f2; which by the way is then further subject to the various expansions. [131001430230] |I would highly recommend your aquatint yourself with the BashFAQ if you haven't already. [131001430240] |In particular, I would strongly suggest you read the following two supplemental entries: [131001430250] |
  • Arguments
  • [131001430260] |
  • Word Splitting
  • [131001440010] |A shell command (more precisely, a “simple command”) consists of a list of words. [131001440020] |Each word can be an arbitrary string (a shell word can contain spaces and punctuation characters). [131001440030] |When you run echo -n *, the shell performs pathname expansion (also called filename generation or globbing) on *, and replaces it by the list of matching file names. [131001440040] |So after expansion, this command consists of four words: echo, -n, f 1 and f 2. [131001440050] |The command echo is run with two arguments, and it prints its arguments with a space in between (and no terminating newline because of the -n option). [131001440060] |So the output is f 1 f 2. [131001440070] |Exercise: create another file whose name consists of two consecutive spaces, run echo -n *, and make sure you understand the output. [131001440080] |When you run names=$(echo -n * ), the output from the command is stored in the names variable. [131001440090] |Here, that line is equivalent to names='f 1 f 2'. [131001440100] |Now we get to array=( $names ). [131001440110] |That's an array assignment, but it doesn't affect the expansion in this case. [131001440120] |Since $names is an unquoted variable expansion, it's subject to word splitting followed by pathname expansion. [131001440130] |Word splitting means that the value of the variable (which is a string) is split into pieces at each whitespace sequence (for the precise rules, search IFS in your shell's documentation). [131001440140] |You can end up with zero, one or more words; here the string is split into 4 words: f, 1, f and 2. [131001440150] |So the array contains four elements (each a one-character word). [131001440160] |Exercise: with that extra file with two consecutive spaces in its name, what is now the exact contents of the array? [131001440170] |Next, you tried array=( * ). [131001440180] |Here, there's a single word in the array, subject to the usual expansions, the last of which is pathname expansion. [131001440190] |Since there are two matching files, the array contains two words, the names of each file: f 1 and f 2. [131001440200] |In terms of shell programming practice, what advice can we draw from this analysis? [131001440210] |Well, first, there's the usual shell programming principle: always put double quotes around variable expansions, unless you have a good reason not to. [131001440220] |Then, don't store a list in a string variable. [131001440230] |If you want to store a list of file names, put it directly in an array: [131001440240] |Further exercise: create a file whose name is a single asterisk (touch '*') and run these commands again. [131001440250] |Do you understand the output? [131001440260] |Aside: zsh does not perform word splitting or pathname expansion on variable expansions. [131001440270] |This makes it quite a bit saner to program in. [131001450010] |Difference between process group and job? [131001450020] |What's the difference between a process group and a job? [131001450030] |If I type pr * | lpr then is it both a process group as well a job? [131001450040] |What exactly is the difference between a process group ID and a job ID? [131001450050] |Edit: I know it appears similar to What is the difference between a job and a process?, but it is slightly different. [131001450060] |Also, I didn't understand this concept from this thread. [131001460010] |A process group is a unix kernel concept. [131001460020] |It doesn't come up very often. [131001460030] |You can send a signal to all the processes in a group, by calling the kill system call or utility with a negative argument. [131001460040] |When a process is created (with fork), it remains in the same process group as its parent. [131001460050] |A process can move into another group by calling setpgid or setpgrp. [131001460060] |This is normally performed by the shell when it starts an external process, before it executes execve to load the external program. [131001460070] |The main use for process groups is that when you press Ctrl+C, Ctrl+Z or Ctrl+\ to kill or suspend programs in a terminal, the terminal sends a signal to a whole process group, the foreground process group. [131001460080] |The details are fairly complex and mostly of interest to shell or kernel implementers; the General Terminal Interface chapter of the POSIX standard is a good presentation (you do need some unix programming background). [131001460090] |Jobs are an internal concept to the shell. [131001460100] |In the simple cases, each job in a shell corresponds to a process group in the kernel. [131001470010] |Why is LPD not enabled by default in Transmission? [131001470020] |Since version 2.00, Transmission has Local Peer Discovery feature, which seems quite useful. [131001470030] |I was surprised that it wasn't enabled by default though, so I became concerned about any potential issues it might have. [131001480010] |As far as I could investigate there are not major issues with the LPD feature, but maybe the reason is this: [131001480020] |https://trac.transmissionbt.com/ticket/3208 [131001480030] |cheers! [131001490010] |Is there a web based converter between rwx and the octal version? [131001490020] |I can never remember what the conversion is from something like rw-r--r-- to 644. [131001490030] |Is there a simple web based converter between the 2? [131001500010] |http://permissions-calculator.org/ [131001510010] |Octal is used for permissions because it's an easy conversion. [131001510020] |Each group of rwx forms one octal digit. [131001510030] |All you have to remember is the first 3 powers of 2: 4, 2, 1. r = 4, w = 2, x = 1. [131001510040] |rw-r--r-- = 110 100 100 = 4+2+0 4+0+0 4+0+0 = 644 [131001520010] |I have this little alias that you can put in your .bashrc (or equivalent). [131001520020] |DISCLAIMER: I am not the author of the script, and I'm not sure who wrote it... but props to him/her for doing this. [131001530010] |Why do you need octal number in the first place? [131001530020] |I always use: [131001530030] |ugo(a) is easy to remember. [131001530040] |However you can confuse o:=owner? o:=other? but what would be u, if o=owner? u:=user, therefore o=other. [131001530050] |Some comands like numerical permissions only. [131001530060] |Okay, it's not hard to calculate, if you remember the two sequences: ugo + rwx. [131001530070] |Yes, very artificial. [131001530080] |When it comes to s and S I have to consult the manual. [131001530090] |Maybe google next time. :) [131001540010] |Google chat video - Fedora / Google Chrome [131001540020] |The webcam is working, because i can see me with the "Cheese" app. ok..... [131001540030] |I installed: google-talkplugin_current_i386.rpm then i opened chrome, and this is what i see: http://i.imgur.com/cUopi.png [131001540040] |the webcam part is black.. [131001540050] |What can i do, so that "google chat" will recognize my webcam? [131001540060] |I've been on this for hours..and i'm tired now.. :\ can someone help? [131001540070] |i tried to disable all plugins, it's the same i tried it in firefox..it freezez [131001540080] |the only problem is the video part..why can't i see the webcams picutre? [131001550010] |Do you have the latest flash plugin? [131001550020] |Also, you can give Gnash a try, see what happens :) [131001560010] |5.1 speakers on soundblaster x-fi 'extreme audio' [131001560020] |The rear and center channels on my 5.1 speakers don't work. [131001560030] |I've checked the connections a few time, and turned up volume sliders in alsamixer [131001560040] |“System information” in alsamixer correctly identifies the card as [131001560050] |When I try [131001560060] |I receive error: [131001560070] |What is this file, could this be the problem, how do i fix it? [131001560080] |I'm running Debian squeeze amd64. [131001570010] |Most likely it's pulse that's not set-up correctly. speaker-test is a handy utility here. [131001570020] |If pulse is your default audio device then all audio programs including speaker-test will go through it for audio. [131001570030] |Try adding default-sample-channels = 6 to /etc/pulse/daemon.conf to tell pulse to use 5.1 audio. speaker-test -c6 will test all 6 channels individually. [131001570040] |If you want to test your sound card directly instead of going through pulse you may need to call speaker-test -D hw:0,0. [131001580010] |linux.org, what's happen? [131001580020] |Do you know why linux.org is down? [131001580030] |Since a few weeks. [131001590010] |I am failing to delete a partition on a USB drive/stick [131001590020] |I got a partition that is probably created by dd, and is about 200MB on a 4GB USB stick. [131001590030] |I am failing to delete it using GParted (the option is greyed on the right-click menu). [131001600010] |Open a terminal [131001600020] |so sudo fdisk /dev/sdb [131001600030] |then press d [131001600040] |to delete the partition if its the only one there it will auto select otherwise it will prompt for partition number [131001600050] |then press w to write the changes to the disk [131001600060] |done :) [131001610010] |Try unmounting it from commandline: umount /dev/sdb1. [131001610020] |If you cannot delete it in any way, create a similar partition in a loopback device and dd it to that stick. [131001610030] |Then, you must install the programs to create a FAT32 partition again. [131001620010] |How to run AIX in VirtualBox with a Linux host? [131001620020] |I need to learn about AIX, and I only have a laptop with Fedora 14/VirtualBox on it. [131001620030] |Is there any chance that I could run an AIX guest in my VirtualBox? [131001620040] |My laptop has an Intel(R) Core(TM)2 Duo CPU T7100 @ 1.80GHz, and I read that it only runs on RISC architecture. [131001620050] |So there's no way I can run it on my laptop? [131001630010] |The best way to learn AIX would be to obtain an account on a machine that's running it. [131001630020] |Really, part of what sets AIX apart from other unices is that it's designed for high-end systems (with lots of processors, fancy virtualization capabilities and so on). [131001630030] |You won't learn as much by running it in a virtual machine. [131001630040] |If you really want to run AIX on your laptop, you'll have to get an old PS/2 version that runs on an x86 CPU. [131001630050] |I don't know if AIX will run on VirtualBox's emulated hardware (PS/2 is peculiar, it's the same problem as running OSX in a VM), but there are hints that it might (user claiming to run an AIX guest). [131001630060] |It seems that AIX can run in Virtual PC. [131001630070] |Qemu can emulate PowerPC processors, so it might be able to run a recent, PowerPC version of AIX. [131001630080] |But don't get your hopes up. [131001630090] |In summary, getting AIX in a VM would be costly (it's not free software), difficult, and not very useful. [131001630100] |Try and get an account on some big iron, or get a second-hand system (if you can afford it).