[131074720010] |Force title on GNU screen [131074720020] |By default, the title of a screen session is the name of the last command entered, which is fine for me, but in some cases I'd like to change it. [131074720030] |I know the command Ctrl-A A, but it only changes the title until the next command, and I'd like it to stay there until I decide otherwise. [131074720040] |EDIT: Here's the preexec function I found in my .zshrc [131074730010] |Depends how things are set up, but by default, something like this should work. [131074730020] |Then run: [131074730030] |settitle NEWTITLE. [131074730040] |See screen title docs and GNU screen faq for more details. [131074730050] |Given Ctrl+A A is only changing it until the next command, it's probably being set by $PS1 (all shells), or $PROMPT_COMMAND/DEBUG trap (bash only) or precmd/preexec (zsh only). [131074730060] |You should look for any place that \e or \033 appears with k or \\ after it, basically like my settitle example above. [131074730070] |UPDATE [131074730080] |You said you had a custom preexec. [131074730090] |Why not change it to this: [131074730100] |Then you can set a custom title by running: [131074730110] |and unset the title by running [131074730120] |Don't forget to change precmd and $PS1 as well if necessary. [131074730130] |ASIDE [131074730140] |You could even extend this to all terminals (e.g. xterm, gnome-terminal, etc.) by not hard coding the \ek and \e\\. [131074730150] |This is how I do it: [131074730160] |Then you can change your preexec to: [131074740010] |If your window title reflects the application currently running in the window, it's because your shell is doing that. [131074740020] |If it's doing that, it's because your distribution, your system administrator or you configured it to. [131074740030] |If the command appears as the window title while the command is running, this is done by the preexec function (in zsh), or an emulation thereof under bash. [131074740040] |If the title changes when each command completes, this is done by the precmd function in zsh, the PROMPT_COMMAND parameter in bash, or as part of the prompt (PS1 parameter) in any shell. [131074740050] |(The command to change the title is an escape sequence emitted by any application as part of the terminal's output stream, so it can be embedded in a prompt.) [131074740060] |Look for an escape sequence like \e]0;new title\a, \e]2;new title\a or \eknew title\e\\ in your shell initialization file (~/.bashrc, ~/.zshrc, …). [131074740070] |If there's nothing relevant, the setting may be in a system file (e.g. /etc/bash.bashrc, /etc/zsh/zshrc); then overwrite that parameter or function in your own initialization file. [131074740080] |See Mikel's answer for an overridable title setting in preexec. [131074750010] |Finding a substring in files across subdirectories with a single built-in command? [131074750020] |In Windows, if I wanted to find a string across all files in all subdirectories, I would do something like [131074750030] |However, in Linux (say, Ubuntu) I have found no other way than some piped command involving find, xargs, and grep (an example is at this page: How can I recursively grep through sub-directories?). [131074750040] |However, my question is different: is there any single, built-in command that works through this magic, without having to write my shell script? [131074760010] |No. find -name \*.h -print0 | xargs -0 grep -l 'the regex' is as magic as it gets. [131074770010] |GNU grep allows searching recursively through subdirectories: [131074780010] |Recreated VG. Is it possible to add existing LVs to it? [131074780020] |I had a CentOS 5.5 server with two drives in it (sda, sdb) using LVM. sda had a combination of physical partitions and LVs. sdb had one volume group named data with multiple logical volumes. [131074780030] |There were no logical volumes or volume groups that spanned the two disks. [131074780040] |Last week I decided to reinstall the OS including formatting /, /root, /boot and rebuilding the LVs on sda. sdb was not touched during the reinstallation as it contains all of the data I want to keep. [131074780050] |After the installation the physical volume on sdb was not listed as active by LVM. [131074780060] |Running (as best I can tell from looking at my history) pvscan activated the physical volume. [131074780070] |Unfortunately, none of the existing volume groups on sdb were being listed. [131074780080] |I then ran vgcreate data /dev/sdb which I thought would either give errors reporting an existing volume group existed with this name or would somehow activate the data volume group. [131074780090] |Unfortunately for me, neither of these things happened. [131074780100] |At this point I haven't touched anything on /dev/sdb since I would like to recover the existing logical volumes that are defined on that drive. [131074780110] |Is there anyway to reactivate those volumes? [131074790010] |If you've somehow ended up with two volume groups with the same name, use vgrename to rename one of them. [131074790020] |In your situation the two volume groups should have distinct UUIDs, and you can pass a UUID to vgrename to make sure it acts on the desired group. [131074790030] |Now, if I understand your question correctly, you now have two volume groups, A (new) and B (old), and you have some logical volumes in B that you'd like to be in A. First run vgscan and perhaps vgchange -ay to make sure all your volume groups are active. [131074790040] |Then run vgmerge to merge the two volume groups into one, or vgsplit to move some physical volumes from B to A. [131074790050] |If this doesn't help, please post the output of pvs, lvs and vgdisplay. [131074800010] |If you had a backup of /etc/lvm/backup/data or perhaps even /etc/lvm/archive/data_* from before the reinstall it would help a great deal. [131074800020] |You could use vgcfgrestore with the old config to rebuild the VG. [131074800030] |At any point before the vgcreate, you could probably have run vgscan and "vgchange -a y" to activate data and get it running again. [131074800040] |Now that you ran vgcreate, the options are more limited... [131074800050] |I am assuming that vgs now shows an empty data VG. [131074800060] |Another option, if you happen to know the exact layout of the volumes on /dev/sdb, it is possible to create LVs in those exact positions and sometimes mount filesystems that are there... but it's tricky and I wouldn't want to do it unless I had no other choice, because the PEs have to be used in the exact same order. [131074810010] |Ssh login hook? [131074810020] |Is there a way to run a script/command every time a user connects using ssh? [131074810030] |Can it be configured globally (i.e run the script when any user login)? [131074810040] |I came across this question on Identica, but there is no answer yet and would like to know it anyway. [131074820010] |For all users, or a particular user? [131074820020] |For a single user, set it in their .bashrc file; for all users, check out pam_exec. [131074820030] |If the users are coming in from sshd, you'll want to check the /etc/pam.d/sshd; other files depending on their source. [131074830010] |there's another way which only influences users using ssh not local ones (which might be better in emergency situations) [131074830020] |see the snippets from the ssh man page below. [131074830030] |in this case the users can usually modify the files themselves (a bit like .bashrc) [131074830040] |and this is global and not modifiable by the normal user [131074830050] |HTH Marcel [131074840010] |Attempting to update Amazon Route53 using a script, but domain is not being updated [131074840020] |I have several Amazon EC2 instances, running Ubuntu 10.04, with which I'd like to use Amazon's Route53. [131074840030] |I setup a script as described in Shlomo Swidler's article, but I'm still missing something. [131074840040] |When the script runs, it doesn't return any output, which I initially assumed meant it ran correctly. [131074840050] |However, when I check the DNS records using MyR53DNS, there are no entries for my instances. [131074840060] |Here's my script: [131074840070] |Does anyone see a problem with this script? [131074840080] |If its not the script, what else could be preventing my Route53 domain from being updated? [131074840090] |I am using the Security Groups to IP-restrict the instances. [131074840100] |I've tried opening port 53, but that didn't seem to have an effect. [131074840110] |Is there another port that Route53 uses? [131074840120] |I'd appreciate any help or guidance the Unix &Linux community can offer. [131074840130] |Let me know if you need any further info. [131074840140] |Here is the results of running: tcsh -f -x /etc/cron.route53/aws-route53.sh [131074840150] |I receive the same output whether the last 7 lines are commented or uncommented. [131074850010] |Aha! [131074850020] |Your script is missing a newline at the end. [131074850030] |Unix text files (such as scripts) are sequences of line, and each line (even the last) must be terminated by a newline. [131074850040] |Most modern unix tools can cope with malformed text files, but tcsh doesn't count as modern: it looks like it ignores the last, unterminated, logical line (everything after the last newline that's not preceded by a backslash). [131074850050] |A good editor (such as Emacs or Vi(m)) automatically makes sure that csh scripts are terminated by a newline.¹ It looks like your editor is not doing the right thing, so make sure your scripts do end with a newline (cat /path/to/script must show the last script line above the next prompt, not next to it). [131074850060] |¹ In a really good editor, such as Emacs, this doesn't apply to other kinds of files that may legitimately be not newline-terminated. [131074860010] |Theming in tiling window managers? [131074860020] |I am trying out tiling window managers like scrotWM, and have noticed that GUI programs start with a "theme" (or lack, thereof) that looks like the bland Redmond theme. [131074860030] |Is there a way to specify the appearance/themes of windows in a tiling window manager? [131074860040] |Or is it window manager OR GUI toolkit specific? [131074860050] |Is there anything I can do? [131074860060] |Thanks. [131074870010] |Yes, theming is specific to each particular application (window manager or otherwise). [131074870020] |Applications that use the same GUI toolkit usually use the same configuration mechanism to select a theme, so they'll look the same. [131074870030] |Many tiling window managers are designed to have a low visible footprint, so there's not much room for visual theming. [131074870040] |Maybe that's why you consider them bland. [131074880010] |For GTK applications themes can be set in the file ~/.gtkrc-2.0. [131074880020] |Mine is [131074880030] |and that makes various applications use the gnome icons. [131074880040] |You can see a list of available icon themes in /usr/share/icons/. [131074890010] |IP to Country console command [131074890020] |Is there a console command that takes an IP address as an input and shows its geographical information like city, country, ISP, etc.? [131074900010] |The command is the easy part, the difficult part is having access to a database. [131074900020] |For example, Ubuntu has a free database with a command line query tool (geoiplookup) in the geoip-bin package. [131074900030] |But it only shows country information, and uses a static (hence out-of-date) database. [131074900040] |This tool can also query the MaxMind GeoIP database, if you have a subscription there. [131074900050] |There are various GeoIP databases that you can look up. [131074900060] |They're generally meant to be viewed through a web browser, but you can look for a scraping script. [131074900070] |For example, here's a ruby script to retrieve data from the MaxMind database. [131074900080] |Note that scraping may be against the database's terms of service. [131074910010] |What distributions have rolling releases? [131074910020] |I was browsing DistroWatch and was looking for a list of distributions that offer rolling releases and a little bit more about them. [131074910030] |However, it doesn't seem to be possible to select only the rolling releases on DistroWatch. [131074910040] |Perhaps the Linux community can offer some insight into what distributions are available that offer rolling releases. [131074910050] |I've made this question a community wiki with the hopes that I'll get one distribution per answer with a brief description of the distro and what it offers and a link to the distribution's home page and/or DistroWatch entry. [131074910060] |Then, people can vote up/down the distributions to rate them in terms of something (best/worst, pure popularity). [131074910070] |(Also, if someone can clean up the tags on this, that would be great. [131074910080] |I wanted to create the "rolling-release" tag, but can't.) [131074920010] |Arch Linux "Arch Linux is an independently-developed i686/x86-64 community distribution, based on a rolling-release model and targeted at competent GNU/Linux users which offers large binary repositories and full-featured package management as well as a ports-like packaging system. [131074920020] |Development focuses on a balance of minimalism, elegance, code correctness and modernity. [131074920030] |Version 0.1 (Homer) was released March 11, 2002. " from the Arch Linux wiki [131074920040] |The Arch wiki, download page are at http://www.archlinux.org/ [131074930010] |Gentoo is a source based linux distribution that will seemingly run on anything (as long as you're willing to compile it). [131074930020] |It's package management system portage is based on FreeBSD's ports, and has a unique concept of use flags which allow you to customize how things are configure-ed easily as well as what files are installed and a few other things. [131074930030] |Gentoo is a ... upstream distribution. [131074930040] |Meaning that it is not derived from another distribution (e.g. like Ubuntu is derived from Debian, and Debian is the 'upstream distribution'). [131074930050] |It has derived distributions that I'm aware of Sabayon and Funtoo. [131074930060] |Sabayon is more release based, but can be converted to rolling. [131074930070] |Funtoo is rolling. [131074940010] |Debian's Testing and Unstable ('Sid') branches can both function as rolling releases. [131074940020] |I've run Sid as my desktop for many years, with regular package upgrades, and had problems with it less frequently than I would have had to do release upgrades. [131074940030] |The 'unstable' moniker refers to the fact that package versions come and go as the distribution developers upload them. [131074940040] |The individual pieces are almost always stable upstream releases or release candidates. [131074940050] |The Testing branch acts as the staging ground for the Stable release. [131074940060] |Packages migrate into it from Unstable if they don't pick up any release-critical bug reports after a delay period of a few days. [131074940070] |It's generally a little bit behind on the latest versions of software, but users can trust that at least the brown-paper-bag bugs have been flushed out. [131074940080] |Note that many Debian Developers run one or the other of these on their primary systems. [131074940090] |This generally means that they're careful not to introduce packages that will break things, because there's an expectation that the system as a whole will work after upgrading. [131074940100] |It has actually also led to complaints that the Developers don't care enough about Stable releases actually happening, because they're generally not users of Stable. [131074950010] |Gentoo and Arch provide full rolling releases, for every part of the system. [131074950020] |Debian and openSUSE provide a stable base system, and for specific parts (e.g. KDE, X11, Firefox) you can add additional repositories which do have rolling releases. [131074950030] |It allows you to keep a stable base system, and yet use the latest software you like. [131074960010] |I posted a comment on DistroWatch suggesting a list rolling release distros. [131074960020] |Let's start our own page on Wikipedia! [131074960030] |They have a very small page for "Rolling Release" only. [131074960040] |Let's start a page "List of Rolling Release Linux Distributions". [131074960050] |I would be happy to help with such as I too have been trying to find a good guide to all rolling release distros. [131074960060] |If you would be willing to help me do such either create the page &I will contribute to it or email my screen name at gmail if you like the idea. [131074960070] |I will get myself a Wikipedia account so that I can contribute and help start the page. [131074960080] |I would like to collaborate on the page though as I've only used Linux for a year or so &am still something of a newbie. [131074960090] |PS In regards to the question, here's a short list; [?]=not-sure BTW: [131074960100] |Arch based: Chakra; ArchBang; KahelOS; &Arch of course. [131074960110] |Debian based: Aptosid [f.k.a. Sidux]; antiX; LMDE (Note: antiX &LMDE are based on Testing so "cycle" rather than "roll"). [131074960120] |Mandriva forks: PCLOS; Unity; Mageia[?] [131074960130] |(Mageia is still discussing whether to roll). [131074960140] |Gentoo base: Funtoo; Sabayon; Toorox*, Calculate[?]; &Gentoo of course. [131074960150] |[*BTW I emailed the Toorox dev. &he said the Toroox wrapper is not rolling] [131074960160] |Misc source based: Lunar; Sorcerer; SourceMage [described as a wrapper around LFS]. [131074960170] |Others: Yoper; Foresight; OpenSuSE-Tumbleweed. [131074960180] |Also: Most dev. branches are "psuedo-rolling". [131074960190] |Future: Debian &Fedora may at some point release a seperate rolling distro. [131074960200] |There has been some slight talk on their dev.-wikis about this. [131074960210] |With LMDE, OpenSuSE-Tumbleweed (and maybe Mageia), Debian &Fedora may decide to go ahead with such... [131074970010] |terminal - having "$" instead of MyComputer:~ me$ [131074970020] |Right now in my MacOS X terminal I have MyComputer:~ me$ before all the commands. [131074970030] |In some vidos I saw they have just $ - that's much less clutter, how is it done? [131074980010] |This text is printed by your shell, and it's called a prompt. [131074980020] |Your shell is probably bash. [131074980030] |The prompt is set in bash's initialisation file, which is .bashrc in your home directory. [131074980040] |Specifically, the prompt is set by the PS1 variable. [131074980050] |Its value can contain escape sequences that are replaced by some value when the prompt is displayed. [131074980060] |For example, MyComputer:~ me$ results from a prompt setting like [131074980070] |Try adding the following line at the end of your .bashrc (create it if it doesn't exist): [131074980080] |If this doesn't change anything, it's because you have a login shell and no proper .bash_profile. [131074980090] |See Difference between .bashrc and .bash_profile for an explanation. [131074980100] |Short story: create a .bash_profile containing [131074990010] |What is the minimum version for liblgrp support on Solaris [131074990020] |What is the minimum version of Solaris SunOS that supports liblgrp? [131075000010] |It is documented in Solaris 9 but not in Solaris 8. [131075010010] |avoid IPv6 link local address on interface [131075010020] |Hi, [131075010030] |I have a setup with virtual Xen hosts connected to a set of VLAN-s. [131075010040] |On Dom0, I have set up a bridge for each of my VLAN-s to connect DomU-s to. [131075010050] |Bridges are set up in /etc/network/interfaces like this: [131075010060] |For most of these interfaces, I don't want Dom0 to be reachable, I just want it to bridge. [131075010070] |However, with IPv6, each interface automatically gets a link local address on the fe80::/64-network, which effectively breaks my security by letting Dom0 be available on all interfaces/VLAN-s. [131075010080] |I guess I can block all incoming packets with iptables, but avoiding any IPv6-address altogether seems like a cleaner solution. [131075010090] |Is there anyway to take an interface up on the link-layer but not on the IP-layer? [131075010100] |This is linux/debian (sorry I missed this detail initially...) [131075020010] |It looks like you are running a Debian variant, and at least Linux. [131075020020] |You could drop a file in /etc/sysctl.d to disable IPv6 on the interface or all interfaces. [131075020030] |I have enabled IPv6, but this is the file I used to disable IPv6. [131075020040] |Initially, I disabled everything, then I disabled individual interfaces while I brought up IPv6. [131075020050] |You should be able to just disable your bridge. [131075030010] |How to reconnect a logically disconnected USB device? [131075030020] |It is possible for a USB storage device to become logically disconnected: the device is still plugged in, but is invisible from the operating system (e.g. it's not listed under /proc/bus/usb). [131075030030] |Maybe this can happen to other kinds of USB or other removable devices as well. [131075030040] |This can happen for example: [131075030050] |
  • after Nautilus has unmounted a USB storage device;
  • [131075030060] |
  • after VirtualBox has claimed a USB storage device (the device disappears from the Linux host when it is attached in the guest, and does not automatically reappear if it is detached from the host).
  • [131075030070] |What is going on in the driver or in the hardware, and most importantly, (how) can the device be logically reconnected (without physically plugging it out and back in)? [131075030080] |Note that this question is not about mounting. [131075030090] |In the “logically disconnected” state, the kernel believes there is nothing on the USB bus (and so of course there is no entry under /dev). [131075040010] |It is sometimes possible to do a power cycle on branch of the USB bus where the device is plugged : [131075040020] |The 1-1 should be adjusted to your configuration. [131075040030] |You can see to which part of the USB tree your device is plugged by running lsusb -t before ejecting it. [131075040040] |You can find detailed information on the linux-usb mailing-list, this thread for example. [131075050010] |I'm uncertain that I'm properly understanding your question, but on my system if a usb device is plugged in but not mounted I can 'see it' by [131075050020] |$> fdisk -l [131075050030] |That tells me what device it's associated with (i.e. /dev/sdd1 or something), then I manually mount it. [131075060010] |ls pagination on MontaVista with BusyBox [131075060020] |I'm logged into an IP Phone running MontaVista with a very stripped down BusyBox binary (by stripped down, I mean the OEM has removed almost all of its functionality, except the basics like cat, ls etc). [131075060030] |I'm doing an ls -l on a directory and there are thousands of files. [131075060040] |I need to be able to pause the file list on the end of each page of results. [131075060050] |Normally I would do this with ls -l|more or even ls -l|less but of course, more and less are not present on this phone. [131075060060] |Are there any other low-level ways of making ls paginate? [131075060070] |My only other option is to write the output to a file and then tftp it off the server and open it on a proper computer, but this is a very roundabout (and slow) method of doing it. [131075070010] |If you are accessing the device through a terminal, you can use GNU Screen to connect; you can then use Screen's scrolling to see the output. [131075070020] |If the system has vi installed, you can try outputting the command to a file and reading it with vi. [131075070030] |If those don't suffice, you can make a bash script to output a screen's worth then pause. [131075070040] |This prints 50 lines and waits for you to press enter before printing the next 50. [131075080010] |Change the icon of an executable file from command line [131075080020] |I want to change the icon image of the executable files from the command line. [131075080030] |I'm using KDE. [131075080040] |Can any one help me in this regard. [131075090010] |Multiple X startup profiles [131075090020] |I run XMonad window manager and use .XSession to startup things like Dropbox and launch other apps I need, at login manager i select User Defined Session. [131075090030] |I like to know is there a login manager where I can have .XSession1, .XSession2 and .XSession3 where I have different profiles. [131075090040] |So 1st one 'daily dev', 'just browsing' and thirdly 'offline' ? [131075100010] |I've been using KDM for a while, and I have a whole raft of custom login profiles. [131075100020] |KDM looks in /usr/share/xsessions for a bunch of .desktop files, which tells it what application to execute to spawn the session. [131075100030] |cat /usr/share/xsessions/awesomex.desktop [131075100040] |On my machine, /usr/bin/awesomex is a fully customised Xsession startup script that spawns awesomewm with a few of my own programs. [131075100050] |The best part of this, is KDM remembers which session I used last time, and then re-uses it each time I log-in until I decide otherwise. [131075100060] |( I believe other login-managers, perhaps GDM, also recognise these files, but not sure ) [131075110010] |Is there a robust command line tool for processing csv files? [131075110020] |I work with CSV files and sometimes need to quickly check the contents of a row or column from the command line. [131075110030] |In many cases cut, head, tail, and friends will do the job; however, cut cannot easily deal with situations such as [131075110040] |Here, the first comma is part of the first field, but cut -d, -f1 disagrees. [131075110050] |Before I write a solution myself, I was wondering if anyone knew of a good tool that already exists for this job. [131075110060] |It would have to, at the very least, be able to handle the example above and return a column from a CSV formatted file. [131075110070] |Other desirable features include the ability to select columns based on the column names given in the first row, support for other quoting styles and support for tab-separated files. [131075110080] |If you don't know of such a tool but have suggestions regarding implementing such a program in Bash, Perl, or Python, or other common scripting languages, I wouldn't mind such suggestions. [131075120010] |Sounds like a job for Perl with Text::CSV. [131075120020] |See the documentation for how to handle column names. [131075120030] |The separator and quoting style can be tuned with parameters to new. [131075120040] |See also Text::CSV::Separator for separator guessing. [131075130010] |You can use Python's csv module. [131075130020] |A simple example: [131075140010] |Or, you could try some awk magic. [131075140020] |Howewer, I'm not a good awk user and cannot confirm this would work properly, and how to do it. [131075150010] |Jump to start of the line in `bash`'s `vi` mode [131075150020] |I'm using bash vi mode (aka set -o vi). [131075150030] |Still I miss the Ctrl-A shortcut from emacs mode, which is very handy. [131075150040] |Many times I'm retrieving the last command and append an echo to the beginning of the line in order to save it to a file. [131075150050] |Is there a convenient way to jump to the start of the line while in insert mode? [131075150060] |And by convenient I mean that it's accessible by two sensible buttons shortcut. [131075150070] |So Esc,I is not good enough, because Esc is too far, and Ctrl+[,I is not good because I need to type three consecutive letters, not sleek enough. [131075160010] |Press the Home key if it's not too far. [131075160020] |Or bind Ctrl+A: [131075170010] |Many times I'm retrieving the last command and append an echo to the beginning of the line in order to save it to a file. [131075170020] |An alternative is: [131075180010] |Coreutils timeout used with pipe results in longer execution time [131075180020] |When coreutils timeout is used with pipe, the execution time becomes the timeout threshold. [131075180030] |The following example is done with debian package timeout, not the coreutils timeout, but the idea is the same. [131075180040] |If we use timeout 5 sleep 1, we expect this command finishes after 1 second, and it does. [131075180050] |However, if we pipe the previous command, like grep in this example, suddenly it takes 5 seconds to finish. [131075180060] |I used htop to monitor the processes, and found that after 1 second, there is only grep process there, not sleep nor timeout. [131075180070] |If the process providing stdin for grep is gone, grep should know the pipe breakage and terminate, so I don't understand why this happens. [131075180080] |I used strace to try to get more info about this anomaly, but couldn't understand the output. [131075180090] |The wait4(-1, [{WIFEXITED(s) &&WEXITSTATUS(s) == 1}], 0, NULL) = 12762 line takes 4 seconds. [131075190010] |Remove dot from your search path. [131075190020] |In by debian6 it is: PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/opt/Eiffel66/studio/spec/linux-x86/bin It should not be: PATH=.:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/opt/Eiffel66/studio/spec/linux-x86/bin as this leads to your problem and security issues PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/opt/Eiffel66/studio/spec/linux-x86/bin:. can also lead to problems, though you will have to run local scripts like this ./timeout if you have a ~/bin, then add it to end of PATH, add ~/bin-override to beginning of path but don't put any thing in it (well not much). [131075200010] |Theme config files for programs of common GUI toolkits [131075200020] |As a follow up to my previous question, I learned that theming in windows (when using a tiling window manager) could be achieved by modifying config files for the different GUI toolkits, for instance GTK is ~/.gtkrc-2.0 [131075200030] |What are the config files for others like GNOME, KDE, QT, and others? [131075200040] |And how do I set them up? [131075200050] |Thanks. [131075210010] |I suggest you use gtk-chtheme to set the GTK2 options, and qt-config (part of Qt) to set Qt options. [131075210020] |KDE will use the Qt theme if you havn't set anything else, but you should be able to run kcontrol and set a theme/fonts etc, if you want. [131075210030] |GNOME saves its configuration in their little registry. [131075210040] |KDE saves in the Qt .ini format, under ~/.kde/ somewhere - can't remember or dig it up at the moment. [131075210050] |The GNOME and KDE enviroments rely on daemons running in the background. [131075210060] |You can start the GNOME/KDE services yourself at login time, or just let them start when an application needs them. gnome-settings-daemon is the GNOME one, I'm not sure if you need to start any KDE daemons except having dbus available. [131075220010] |How to print using a Lexmark 5630 printer [131075220020] |I want to print using a Lexmark 5630 printer, and it appears they only have drivers for Mac and Windows. [131075220030] |Does CUPS support it, with maybe some reverse-engineered driver, or am I at a loss? [131075230010] |I would start by looking at the Open Printing website. [131075240010] |Can root kill init process? [131075240020] |Can root kill init process (the process with pid 1)? [131075240030] |What would be its consequences? [131075250010] |No, you cannot kill init. [131075250020] |(The 30 character minimum is really annoying...) [131075260010] |By default, no, that's not allowed. [131075260020] |Under Linux (from man 2 kill): [131075260030] |The only signals that can be sent to process ID 1, the init process, are those for which init has explicitly installed signal handlers. [131075260040] |This is done to assure the system is not brought down accidentally. [131075260050] |Pid 1 (init) can decide to allow itself to be killed, in which case the "kill" is basically a request for it to shut itself down. [131075260060] |This is one possible way to implement the halt command, though I'm not aware of any init that does that. [131075260070] |On a Mac, killing launchd (its init analogue) with signal 15 (SIGTERM) will immediately reboot the system, without bothering to shut down running programs cleanly. [131075260080] |Killing it with the uncatchable signal 9 (SIGKILL) does nothing, showing that Mac's kill() semantics are the same as Linux's in this respect. [131075260090] |At the moment, I don't have a Linux box handy that I'm willing to experiment with, so the question of what Linux's init does with a SIGTERM will have to wait. [131075260100] |And with init replacement projects like Upstart and Systemd being popular these days, the answer could be variable. [131075260110] |UPDATE: On Linux, init explicitly ignores SIGTERM, so it does nothing. @jsbillings has information on what Upstart and Systemd do. [131075270010] |Technically yes, root can issue a SIGKILL to init. init, however, differs from most, nearly all in fact, other processes in that it is permitted to trap and ignore the signal. [131075270020] |You can, loosely, kill init by issuing a kill -TERM 1 which would be analogous to issuing a halt or shutdown in that init will pass the signal to all children, essentially all other processes, before honoring the signal itself. [131075270030] |Please note: performing this command will shutdown your system. [131075270040] |For flavor; one type of other process that can "ignore" a SIGKILL is one in uninterruptible sleep, such as one waiting for i/o. [131075270050] |Such a process could be found by issuing a ps axo stat,comm where processes with a status 'D' are uninterruptible. [131075280010] |The SysV init ignores SIGKILL or SIGTERM signals. [131075280020] |The only signal that causes a change in state is SIGPWR as far as I can tell, which schedules a power-related shutdown. [131075280030] |It appears that Upstart and Systemd also do not respond to SIGKILL, and from my test, it appears that a SIGTERM causes upstart and systemd to re-exec. [131075280040] |I'm not sure what the other answerers are running but I'm pretty sure you can't kill -9 (SIGKILL) or kill -15 (SIGTERM) init (pid 1). [131075280050] |Most likely, if you were able to, you'd get a kernel panic because init unexpectedly exited with a non-zero exit code, which would be less than ideal. [131075280060] |It doesn't shut down your computer, or cause it to reboot. [131075290010] |You can restart the init process. [131075290020] |This is useful for making changes to inittab without having to reboot. [131075290030] |Source: http://www.cyberciti.biz/faq/linux-unix-kill-hup-1-reread-etcinittab-file/ [131075300010] |How to make files created by a specific user to have specific permissions by default [131075300020] |Here's a sequence of commands and the resulting output: [131075300030] |What must I do so that when a user follows that sequence, I get this output instead: [131075310010] |You need to set the umask for that user to 0002. [131075310020] |Right now, it's probably 0022. [131075310030] |You can define it in your ~/.bash_profile with 'umask 0002'. [131075320010] |Under bash, umask sets the file-creation mask. [131075320020] |With umask 002 you get the permissions you want. [131075320030] |You can put this in .bash_profile locally or globally. [131075330010] |POSIX defines the utility umask which sets the file mode creation mask, either for the current instance (without subshells), or for every newly invoked shell (over .bash_profile, .bashrc, etc.). [131075330020] |Show the currently set mask in octal or symbolic form: [131075330030] |The octal numbers indicate the values which are getting removed from the full access: [131075340010] |rename directory of images numeric [131075340020] |I'm trying to rename a directory full of images like so: [131075340030] |test.jpg funny.gif sad.png filename.PNG filenaaskjas.JPG [131075340040] |to: [131075340050] |1.jpg 2.gif 3.png 4.png 5.jpg [131075340060] |I've got it working except for the uppercase --> lowercase conversion: [131075340070] |I also want jpeg to become jpg. [131075350010] |You can use ${parameter/pattern/string} to search/replace and ${parameter,,pattern} to convert to lowercase. [131075360010] |Try something like [131075360020] |or for fixed length file names. [131075360030] |c [131075370010] |Two steps: [131075370020] |convert extensions: [131075370030] |number files: [131075380010] |If you have (p)rename, you can write this: [131075390010] |What is/are the standard CLI program(s) to manage users and groups? [131075390020] |As the title says, I'm basically asking about user management from the command line (e.g. on a system where there are no graphical tools available). [131075390030] |In the past I've used several different programs to add or delete users and groups or to modify their attributes: adduser, useradd, usermod, gpasswd, and perhaps others I've forgotten. [131075390040] |I've also heard a couple times that some of these programs are low-level and should be avoided for general use, but I can never remember which. [131075390050] |So I'd like to get a definitive answer for which programs are the recommended ones for at least the following tasks: [131075390060] |
  • Create a new user
  • [131075390070] |
  • Add a user to a group
  • [131075390080] |
  • Remove a user from a group
  • [131075390090] |
  • Change a user's primary group
  • [131075390100] |
  • Change a user's login shell or home directory
  • [131075390110] |
  • Delete a user
  • [131075390120] |I'm looking for standard tools which I can expect to be available on pretty much any Linux system (of any distribution). [131075400010] |Sadly, none of those operations were ever standardized. [131075400020] |Some operating systems offer this functionality as part of the OS, like Linux, but even if your Linux system includes them, over time and across Linux distributions the tools and their names changed so you can not really depend on a standard set of tools to do those tasks. [131075400030] |You need to have a per-operating system set of tools. [131075410010] |On Debian (and derived) systems, adduser and deluser are higher-level wrappers around useradd and related functionality. [131075410020] |The cover user creation, group membership addition and subtraction, and user deletion. [131075410030] |The corresponding commands from making/deleting groups are, sensibly enough, addgroup and delgroup. usermod appears to cover the remaining use case you name. [131075420010] |In many situations, knowing how to edit "/etc/passwd" is still useful. [131075430010] |You mention Linux in the last part of your question, but since the title is generic I'll answer for FreeBSD. [131075430020] |FreeBSD has similar commands as Linux but they are commands passed to the pw utility: [131075430030] |and so on. [131075430040] |However, one can parse the command into two parts: user and mod; a noun and a verb. [131075430050] |Moreover, one can also use group and del: [131075430060] |to, for example, delete a group. [131075430070] |So here's what I think is really cool: the order doesn't matter, nor does the spacing! [131075430080] |What this means, is that you can remember what to call by thinking about what you want to do (in English anyway): [131075430090] |and more! [131075430100] |The pw utility also lets you lock and unlock accounts: [131075430110] |Options and any parameters that you pass are all standardized (although don't always apply to call commands) so memorization is minimized. [131075430120] |All in all a nice way to do things. [131075430130] |Note: the ellipses in the above examples represent options and paramters passed to pw not additional users or groups. [131075440010] |All of these tools are ultimately built to edit text files for you. [131075440020] |If you want to know how to manage users and groups over systems, you should get familiar with these underlying text files. [131075440030] |Lucky for you, there's just two of them, /etc/passwd and /etc/group. [131075440040] |There are also complementary /etc/shadow and /etc/gshadow files for shadowing passwd and group respectively. [131075450010] |Just for completeness, in the low-level end of the spectrum I'd mention vipw(8) and vigr(8), just above "vi /etc/passwd" and "cat >/etc/passwd" but right below "useradd". [131075450020] |Oh, and they exist in most Unix variants. [131075460010] |If your question was limited to [131075460020] |any Linux system (of any distribution) [131075460030] |but all of the systems have network access to a single server. [131075460040] |You could use something like NIS or YP. [131075460050] |So this answer is limited to admins within a single organization. [131075460060] |You still have the issue where almost every distribution has slightly different ways to configure YP, but configuration only happens once. [131075460070] |Also, this type of network is not trivial. [131075460080] |Within a single site/network you will gain a lot doing this. [131075460090] |In combination with automount, my favorite is being able to SSH to any *nix machine and have all my home files and tools available to me. [131075460100] |To the point, the distribution you choose for the master is the system you use for managing users. [131075460110] |You then will have a single set of tools/documentation to manage users and groups. [131075460120] |It is even possible to use something like LDAP and samba tools on the master. [131075460130] |Using samba also allows me to have my home files available to me on windows machines. [131075470010] |If you are using a backend other than the default local machine backend - OpenLDAP being the most common - then cpu (change password utility) might be the command you are looking for. [131075470020] |It can be run on machines other than the LDAP master if configured correctly, and it's syntax is mostly just the same as useradd etc with a prefix of cpu. [131075470030] |So to add myself I could do [131075470040] |See the cpu man page for more details. [131075480010] |The closest thing to a standard you'll get is vi /etc/passwd, vi /etc/shadow, and vi /etc/groups. [131075480020] |(Heretics may substitute emacs.) [131075480030] |Everything since then that I've found will only work on some systems. [131075480040] |Seriously, find out what tools your OS has, and use them. [131075480050] |Just don't expect them to work the same on all systems. [131075480060] |It would be nice if they were standardized, but they aren't. [131075490010] |Linux - How to split the terminal into more than one "view"? [131075490020] |From vi, if you issue the command :sp, the screen splits into two "views", allowing you to edit more than one file from the same terminal. [131075490030] |Along those same lines, is there a way to have multiple shells open in the same terminal? [131075500010] |You can do it in screen the terminal multiplexer. [131075500020] |
  • To split vertically: ctrla then |.
  • [131075500030] |
  • To split horizontally: ctrla then S (uppercase one).
  • [131075500040] |
  • To unsplit: ctrla then Q (uppercase one).
  • [131075500050] |
  • To switch from one to the other: ctrla then tab
  • [131075500060] |EDIT, basic screen usage: [131075500070] |
  • New terminal: ctrla then c.
  • [131075500080] |
  • Next terminal: ctrla then space.
  • [131075500090] |
  • Previous terminal: ctrla then backspace.
  • [131075500100] |
  • N'th terminal ctrla then [n].
  • [131075500110] |
  • Send ctrla to the underlying terminal ctrla then a.
  • [131075510010] |If you want a program that just splits a terminal¹, there's splitvt. [131075510020] |There are programs that split a terminal and do a lot of other stuff besides, such as Screen, Tmux, Emacs, … [131075510030] |¹ It's the terminal you're splitting, not the shell. [131075520010] |screen + vim -- Any way to automatically set screen window name to open vim filename? [131075520020] |I have a pretty nice screen rc file that shows me the open screen windows almost like tabs at the bottom of the terminal. [131075520030] |Currently the windows are named according to my prompt which is not so useful. [131075520040] |Is there a way to automatically name the windows based on the filename of an open vim session currently in the window? [131075520050] |I think this would make a supreme multi window editor if it were possible. [131075530010] |Set the title option. [131075530020] |This works out of the box for me in xterm and the like but not in screen. [131075530030] |This tip works: [131075530040] |A different approach is to write a preexec function in your shell that sets the window title to the command being run. [131075530050] |Zsh supports preexec natively, and bash can do it too. [131075530060] |Here's a zsh example. [131075540010] |Can't ping broadcast [131075540020] |We're running four computers connected to a hub (yes a hub not a switch) on Fedora 13. [131075540030] |They were installed using images from a colleague that has recently left us to go back to school, they may have been set to somehow block the use of the broadcast, but we'd like to continue using this image. [131075540040] |We've setup the static IPs for each computer using ifconfig (we've also tried ip addr add) to 10.0.1.11/24 through 10.0.1.14/24, using these settings we can't seem to ping the broadcast which is indeed set correctly to 10.0.1.255, using tcpdump we see nothing except outgoing ping requests from the computer that calls the ping request. [131075540050] |Does anyone have any ideas or am I missing something entirely? [131075550010] |Broadcast amplification was used to mount DOS (Denial of Service) attacks. [131075550020] |As a result most IP stacks now turn off echo responses to broadcast ping. [131075550030] |This is normal behavior now. [131075560010] |echo 0 >/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts - as root. [131075560020] |You may need to also use the -b option with ping and it will most likely require root permissions. [131075570010] |How could I remember how to use redirection ? [131075570020] |I know what [131075570030] |does. [131075570040] |It redirects the output to /dev/null and 2>&1 means to redirect the error output in the same place where the output is sent. [131075570050] |My problem is I always have to google it because I never remember it. [131075570060] |So, I try &2>1, 1>2&, 1>&2... [131075570070] |I try every combinaison until I google it... [131075570080] |What's the trick to remember it easily ? [131075580010] |Output is better than error so it comes first (1 vs 2). [131075580020] |>is shorthand for 'goes to'. [131075580030] |On the left is what I want to send and on the right is where I want to send it. [131075580040] |Since 'where' is (almost) always a file, something like [131075580050] |would redirect to a file named 1. [131075580060] |Thus, the ampersand modifies the file to file descriptor. [131075580070] |Unfortunately, I haven't come across nor developed my own mnemonic, but when I was first learning *nix, I found this logical way to work well. [131075580080] |After a few run-throughs, it becomes second nature. [131075590010] |Actually, it depends on what shell you're using. [131075590020] |Bash is usually very forgiving and you can just do: [131075600010] |Seeing the &as a knot might help : think about what you want to do as taking the output of 2, so 2>, and tying it together with 1, so 2>&1 [131075610010] |Draw it in your wallpaper :) [131075610020] |Now, seriously, this and other basic stuff I kept forgetting, so I added a quick tips menu to an app I developed and that I use daily. [131075610030] |You might want to give it a try or use something like gnote to keep a note. [131075620010] |Network Filesystem + Local Access [131075620020] |I need to set up a network fs, so that I can mount a directory from Box A on to Box B and Box C. [131075620030] |However, I need those files to not be transferred from Box A upon every access request; basically, I need the files cached locally, and only updated when "pushed" from Box A. [131075620040] |Any suggestions? [131075630010] |Can you run rsync on Box A whenever you need to push the files to the other 2 boxes? [131075630020] |Something like: [131075630030] |rsync will only copy changed files as required. [131075630040] |If you need to automate the push, you could always use cron to start the rsyncs. [131075640010] |You might benefit from using NFS and CacheFS. [131075640020] |It should be available on most modern Linux distros. [131075650010] |You can serve the files over FTP, HTTP(S) or SFTP, and access them through LftpFS. [131075650020] |where /etc/local/A.ftp contains something like [131075660010] |How does Linux manage fonts? [131075660020] |When I used Windows (a very very long time ago!), and Mac OS X, there was always a central "repository" of fonts shared and accessed by the OS and all programs (the font folder in Windows, and Font Book in Mac OS X). [131075660030] |How are fonts managed in Linux? [131075660040] |Is there also a central store for fonts that all programs (the shell with no X, with X, window managers, other GUI software) can use? [131075660050] |Or are fonts managed separately? [131075660060] |What can I do to efficiently and easily manage my fonts in Linux? [131075670010] |Console fonts and X fonts are two separate things in linux. [131075670020] |Use the command setfont to change your font, and showconsolefont to see what it looks like. [131075670030] |Each distro has it's own way of setting the default console font. [131075670040] |Read the setfont man page for the location of the console fonts. [131075670050] |For my Fedora 14 system, it's /lib/kbd/consolefonts/. [131075670060] |Console fonts are a file format that define EGA/VGA console fonts. [131075670070] |X Fonts are a different format than console fonts. [131075670080] |They are typically handled by definitions in your X config (with FontPath in the Files section), or through a Font server (xfs), which is also set in the Files section with FontPath. [131075670090] |You can also add FontPaths by running xset +fp path. [131075670100] |My system has all it's X fonts in /usr/share/X11/fonts. [131075680010] |There are two mechanisms for fonts in X land: server-side and client-side. [131075680020] |The traditional way to render fonts is for the client to tell the server “render foo at position (x,y) in font F” (where a font specification includes a face, size, encoding and other attributes). [131075680030] |Either the X server itself, or a specialized program called a font server, opens the font file to build the description of each glyph. [131075680040] |The fonts can be bitmap or vector fonts, but the vector fonts are converted to bitmaps before rendering. [131075680050] |Most modern programs use client-side font rendering, often through xft and fontconfig. [131075680060] |A new mechanism was needed because the server-side font rendering didn't support anti-aliasing. [131075680070] |Outside X (i.e. on a VGA console), there are VGA fonts, which are bitmap fonts of specific sizes. [131075680080] |But compared to X11, no one uses the VGA console, so not much effort is spent on them. [131075680090] |In practice, you'll want to configure fonts in two ways: [131075680100] |
  • For older-style programs: the font directories are listed via FontPath directives in xorg.conf and can be manipulated with xset fp commands by the user running X. If you install new fonts, you may need to run mkfontdir.
  • [131075680110] |
  • For newer-style programs, including all Gtk (Gnome, etc.) and Qt (KDE, etc.) programs: fonts are in the directories indicated by directives in /etc/fonts/fonts.conf, ~/.fonts.conf and a few other places. [131075680120] |See the fontconfig documentation for more information. [131075680130] |If you install new fonts, you may need to run fc-cache.
  • [131075690010] |I can't delete a file that I have write permissions for as a group member [131075690020] |What is missing? [131075700010] |Deleting a file means you are making changes to the directory it resides in, not the file itself. [131075700020] |Your group needs rw on the directory to be able to remove a file. [131075700030] |The permissions on a file are only for making changes to the file itself. [131075700040] |This might come off as confusing at first until you think about how the filesystem works. [131075700050] |A file is just an inode, and the directory refers to the inode. [131075700060] |By removing it, you're just removing a reference to that file's inode in the directory. [131075700070] |So you're changing the directory, not the file. [131075700080] |You could have a hard link to that file in another directory, and you'd still be able to remove it from the first directory without actually changing the file itself, it would still exist in the other directory. [131075710010] |Working with rar files [131075710020] |I have a directory full of rar files, with extensions ranging from .r00 to .r30. [131075710030] |It also has one file with .rar extension. [131075710040] |From all of this must come a video file. [131075710050] |How do I do it? [131075720010] |You can use the unrar program. [131075720020] |From how-to-open-a-rar-file-in-linux: [131075720030] |If you need to uncompress a .rar archive in Linux, you can download a program called unrar. [131075720040] |If you are using Ubuntu or Debian, you can install unrar by opening a terminal and typing sudo apt-get install unrar. [131075720050] |Then read the instructions by typing man unrar. [131075720060] |[UPDATE: to install unrar in Ubuntu you need the Multiverse Repository enabled.] [131075720070] |Basically, to unrar a file in Linux, just navigate to the directory where your rar archive is and type unrar x [filename.rar], replacing [filename.rar] with the name of your rar archive. [131075720080] |For a series of files, you should be able to just specify the one with the .rar extension. [131075720090] |Update - this is confirmed by wikihow: [131075720100] |If a RAR file is broken into smaller files, they are named .rar, .r00, .r01 and so on. [131075720110] |Point your unrar utility at the .rar file and it will automatically put the pieces back together. [131075730010] |If you only have rar program, the command x would accomplish the task: [131075730020] |The program automatically searches for the appropriate parts of the archive. [131075730030] |Note: sometimes the naming can be .part##.rar. [131075740010] |Compatible Wireless Router? [131075740020] |Hi! [131075740030] |I'm looking for a wireless router for personal use. [131075740040] |I have a small apartment and need the router primarily for my android phone connection. [131075740050] |I might need it for streaming video as well. [131075740060] |I'm running Kubuntu on a Thinkpad T61p. [131075740070] |My wireless card is: [131075740080] |Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection (rev 61) [131075740090] |I'm looking for a reasonably feature-rich router that I will not have to change in the next 2-3 years. [131075740100] |Some of the brands I've been recommended so far are: NetGear such as WNR3500L or 3500 D-Link such as DIR 655 Linksys [131075740110] |Any ideas? [131075740120] |Or any up2date list? [131075740130] |Thanks! [131075750010] |You may want to read Jeff's article Because Everyone Needs a Router to get some ideas. [131075750020] |In the end, he chose the Buffalo Nfiniti Wireless-N High Power Router. [131075760010] |What does it mean when code is executed in [kernel|user] mode ? [131075760020] |The title says everything. [131075770010] |It's the distinction of whether the currently executing code is allowed to interact directly with various pieces of hardware. [131075770020] |Kernel mode code can write to device buses, change memory mappings, switch running processes, and so forth. [131075770030] |User mode can do computation, and it can make system calls into the kernel to interact with the rest of the world. [131075780010] |Kernel Mode [131075780020] |A program running in this mode has full access to the underlying hardware. [131075780030] |It can execute any CPU instruction, access any memory address and essentially do anything it wants. [131075780040] |User Mode Code executing in this mode is restricted to hardware modification via the OS's API. [131075780050] |It cannot access the hardware directly at all. [131075780060] |The interesting thing here is that on the common architectures, this is enforced via hardware--not just the OS. [131075780070] |In particular, the x86 architecture has protection rings. [131075780080] |The big advantage to this kind of separation is that when a program crashes running in user mode, it isn't always fatal. [131075780090] |In fact, on modern systems, it usually isn't. [131075780100] |Check out Jeff's writeup. [131075780110] |It's his usual good stuff. [131075790010] |The short answer is: it just tells you where programs are spending their time at. [131075790020] |For a longer answer, I'll explain this in two steps. [131075790030] |First: [131075790040] |1. Entering kernel mode [131075790050] |Every regular code you write, runs in "user mode". [131075790060] |Programs can use libraries to do common tasks for them. [131075790070] |This is also user mode code. [131075790080] |At some point, the program may require a core function from the system. [131075790090] |For example: [131075790100] |
  • accessing file contents from disk
  • [131075790110] |
  • reserving a part the free memory
  • [131075790120] |
  • getting video frame from a webcam driver
  • [131075790130] |
  • sending image data to the graphics card.
  • [131075790140] |
  • sending a network packet.
  • [131075790150] |This essential - close to hardware - functionality is part of the kernel. [131075790160] |That's the central program behind everything on your computer. [131075790170] |It manages everything programs need in order to function. [131075790180] |To use a function in the kernel, the program execution path literally makes a jump from User mode to Kernel code. [131075790190] |The kernel does it's job, and folds the execution path back to user mode. [131075790200] |When a program spends a lot of time in kernel mode, it often means it's doing a lot of hardware related activity. [131075790210] |For example, disk seeks or video streaming. [131075790220] |The hardware could also be malfunctioning; making the processing slow and causing the program to spend an unusual amount of time in kernel space. [131075790230] |2 the difference [131075790240] |Code in kernel space is high performant. [131075790250] |The other parts of the kernel can call it directly, and the code has direct access to every resource of the system, without any boundary checking. [131075790260] |The switching between kernel/user mode is also an expensive operation, which is completely avoided by running everything in kernel code. [131075790270] |Inside the kernel however, there isn't much room for security checking, protection against crashes, or writing to the wrong parts of memory. [131075790280] |These are services the kernel can provide to other programs. [131075790290] |It tricks programs to believe the world looks different (programs live in a virtual, sandboxed/restricted environment) and therefore everything that comes in/out of programs can be translated and guarded. [131075790300] |The kernel itself can't have much protection because there is nothing behind it to protect it. [131075790310] |It is the heart of the system, and when that stops, everything ends. [131075790320] |You get a kernel panic, or on Windows, the famous BSOD. [131075790330] |That's also the risk of kernel based code, and the reason more subsystems with low performance requirements are being moved to userspace. [131075790340] |Essential hardware related parts however, are typically kernel code which is not going to change any time soon. [131075800010] |What packages are required to install vim on Fedora? [131075800020] |What RPM packages are required to install vim on a recent version of Fedora? [131075810010] |On a modern Fedora, run [131075810020] |or [131075810030] |to get a recursive list of packages on which your specified package depends, in a nice tree format. [131075810040] |Note that vim-minimal only installs /bin/vi with no modern enhancements nor online help, for use when only the root partition is available. [131075810050] |I guess you want vim-enhanced or vim-X11. [131075810060] |If you only want a list of the direct dependencies, you could run [131075810070] |to get the packages list or [131075810080] |to get the required capabilities. [131075820010] |Why is the US international keyboard layout on Debian/Ubuntu different? [131075820020] |Possible Duplicate: Why is the US international keyboard layout on Debian different? [131075820030] |I asked this question on askubuntu.com recently but I was not satisfied with any answer. [131075820040] |I realized that the "problem" was not only in Ubuntu but in Debian itself and Ubuntu just inherited it and now I decided to try my luck here to a broader audience. [131075820050] |So, if you don't want to click the link, here is what I'd like to know: [131075820060] |I have been using Linux on and off for 10 years, and more recently I have spent more time with OSX. [131075820070] |But, I still remember that in the beginning I'd choose the US international keyboard layout and it would have exactly the same output as the Windows keyboard layout (and most recently, the OSX US international layout). [131075820080] |However, a few years ago when I installed Ubuntu, I noticed that the cedilla wasn't printed anymore (ç or Ç). [131075820090] |This is a combination of the following keys: ' + c. Instead, what I get is the ć letter. [131075820100] |When did it start to happen, and why the difference to the behavior on the other OSes? [131075820110] |What puzzles me even more is that there is even an "US International alternative" keyboard layout, which prints exactly the same keys! [131075820120] |So, what's it alternative to? [131075820130] |This has been reported as a bug back to Canonical (can't find the link now), but the keyboard layout has never changed back to what I'd expect. [131075820140] |I know the workarounds to fix it to what I need, but I just would like to know why/when it has become different. [131075830010] |How to create a copy of DVD that is larger than maximum size of file on filesystem? [131075830020] |How to create copy of DVD, which ISO image size is larger than maximum size of file on filesystem? [131075830030] |There is only one DVD drive. [131075840010] |As long as you don't mind that the intermediate storage won't be usable as such: [131075850010] |Why is the US international keyboard layout on Debian different? [131075850020] |Edit: I realized that the "problem" was not only in Ubuntu but in Debian itself and Ubuntu just inherited it, so I had this migrated from Ask Ubuntu [131075850030] |I have been using Linux on and off for 10 years, and more recently I have spent more time with OSX. [131075850040] |But, I still remember that in the beginning I'd choose the US international keyboard layout and it would have exactly the same output as the Windows keyboard layout (and most recently, the OSX US international layout). [131075850050] |However, a few years ago when I installed Ubuntu, I noticed that the cedilla wasn't printed anymore (ç or Ç). [131075850060] |This is a combination of the following keys: ' + c. Instead, what I get is the ć letter. [131075850070] |When did it start to happen, and why the difference to the behavior on the other OSes? [131075850080] |What puzzles me even more is that there is even an "US International alternative" keyboard layout, which prints exactly the same keys! [131075850090] |So, what's it alternative to? [131075850100] |This has been reported as a bug back to Canonical (can't find the link now), but the keyboard layout has never changed back to what I'd expect. [131075850110] |I know the workarounds to fix it to what I need, but I just would like to know why/when it has become different. [131075860010] |From http://disi.unitn.it/~vitorsouza/linux/ubuntu-linux-10-10-maverick-meerkat/ and http://disi.unitn.it/~vitorsouza/linux/ubuntu-linux-10-04-lucid-lynx/: [131075860020] |Problem with cedilla: [131075860030] |Some nice fellow decided that an accented c (“ć”) is more importante than the c with a cedilla (“ç”), so the default behavior for pressing ‘ + c in international keyboards with deadkeys is now “ć”. [131075860040] |Since I’m Brazilian and not Romanian or something, that definetly bothers me. ‘ + c used to output “ç” once upon a time. [131075860050] |To fix it, edit as root the file /usr/lib/gtk-2.0/2.10.0/gtk.immodules, find this line: [131075860060] |And add :en after :wa, so it looks like this: [131075860070] |To fix it also for non-GTK applications, edit as root the file */usr/share/X11/locale/en_US.UTF-8/Compose* and change all instances of ć with ç, and all instances of Ć with Ç. [131075860080] |You might need to repeat one or both operations from time to time, when you upgrade your system and it takes the configuration files back to their original contents. [131075870010] |Summary [131075870020] |
  • If you are using Ubuntu, it probably changed around 2005, when the default character set changed from ISO 8859-1 to UTF-8.
  • [131075870030] |
  • US Alternative International adds some dead keys.
  • [131075870040] |The dead key settings depend on your locale and character set. [131075870050] |For example: [131075870060] |
  • en_US.UTF-8 is defined in /usr/share/X11/locale/en_US.UTF-8/Compose
  • [131075870070] |
  • ISO 8859-1 is defined in /usr/share/X11/locale/iso8859-1/Compose
  • [131075870080] |If you look in them using grep, you can see there is a difference: [131075870090] |Namely: [131075870100] |
  • Latin1 encoding: ', c = ç
  • [131075870110] |
  • UTF-8 encoding: ', c = ć
  • [131075870120] |The git logs ((en_US.UTF-8) (iso8859-1)) show it has been this way since at least 2004. [131075870130] |The difference between US International and US Alternative International is defined in /usr/share/X11/xkb/symbols/us. [131075870140] |Namely, the US Alternative International layout adds these extra AltGr dead keys: [131075870150] |
  • dead_macron: on AltGr-minus
  • [131075870160] |
  • dead_breve: on AltGr-parenleft
  • [131075870170] |
  • dead_abovedot: on AltGr-period
  • [131075870180] |
  • dead_abovering: on AltGr-0
  • [131075870190] |
  • dead_doubleacute: on AltGr-equal (as quotedbl is already used)
  • [131075870200] |
  • dead_caron: on AltGr-less (AltGr-shift-comma)
  • [131075870210] |
  • dead_cedilla: on AltGr-comma
  • [131075870220] |
  • dead_ogonek: on AltGr-semicolon
  • [131075870230] |
  • dead_belowdot: on AltGr-underscore (AltGr-shift-minus)
  • [131075870240] |
  • dead_hook: on AltGr-question
  • [131075870250] |
  • dead_horn: on AltGr-plus (AltGr-shift-equal)
  • [131075870260] |
  • dead_diaeresis: on AltGr-colon (Alt-shift-semicolon)
  • [131075870270] |For example: [131075870280] |
  • US International: AltGr+- = ¥
  • [131075870290] |
  • US Alternative International: AltGr+-, a = ā
  • [131075870300] |UTF-8 became the default encoding: [131075870310] |
  • Red Hat 8.0 "Psyche", released September 30, 2002 reference
  • [131075870320] |
  • Ubuntu 5.04 "hoary", released April 8, 2005 reference
  • [131075870330] |
  • Debian 4.0 "etch", released as "stable" April 8, 2007 reference 1 reference 2
  • [131075880010] |*nix working on eBox 3300 [131075880020] |I'm not sure if hardware questions are alright here, I didn't see many. [131075880030] |I am trying to install any Linux operating system on an eBox 3300. [131075880040] |I am having trouble, and the only thing I have been able to get to work is Ubuntu's Netbook Remix. [131075880050] |I would rather have fedora/ Debian/ or just about anything else. [131075880060] |What I really want to know is has anybody here encountered one of these devices and/or used them yourself? [131075880070] |If so, what steps did you take to get it going? [131075880080] |Update for phunehehe's comment: [131075880090] |The processor is a Vortex86MX, which is a i586 chip, so we have to specifically find i386 images instead of i686 (which is slightly more troublesome than one would think). [131075880100] |The network card is the R6040 from RDC, which I been unable to get Ubuntu Netbook Remix to recognize. [131075880110] |A couple distros (I forget which ones) would not recognize the SD card slot, which is what we are using for storage. [131075880120] |The specific model is eBox 3300MX-C. [131075890010] |My company evaluated this box as a deployment platform for some of our software. [131075890020] |We were able to get Fedora working on these boxes, however the box required a BIOS update from the vendor in order to get it to boot from flash memory. [131075890030] |I assume this is what you are trying to do as well? [131075890040] |We also had other problems with this box that ultimately led us to drop it. [131075890050] |For example, USB devices plugged into one of the front ports had intermittent data errors. [131075890060] |These are nice little boxes, but I do not trust them for anything other than simple, personal use. [131075900010] |Backtrack panels issue. [131075900020] |I accidentally hid the bottom panel and created another panel on the right side of the screen. [131075900030] |That panel is on top of the button to show the bottom panel again. [131075900040] |The panel on the right is unclickable and I cant figure out how to delete it. [131075900050] |Is there some config file i can edit to delete that panel? [131075900060] |Can i reset my desktop to default settings? [131075900070] |Thanks, giodamelio [131075910010] |You can remove the panel settings by deleting ~/.kde4/share/config/plasma-desktop-appletsrc. [131075910020] |I have tried moving the panel and deleting the file does restore the default settings. [131075910030] |If that doesn't work you can try looking for the correct config file and delete it. [131075910040] |Well-behaved applications should recreate the file with default settings. [131075910050] |If you don't mind losing customized settings, a sure-to-work way is to remove the KDE settings folder ~/.kde. [131075920010] |NFS permissions and slow copy. [131075920020] |Hi, [131075920030] |I have an NFS share on an OpenBsd server. [131075920040] |When I assess the share from my Ubuntu box I don't seem to have all permission eg write. [131075920050] |Also copying a file from the NFS share to the Ubuntu machine can take >1 hour for a 44mb file. [131075920060] |Any suggestions? [131075920070] |I exported the share through /etc/exports [131075920080] |And mounted the share the following. [131075920090] |Thanks [131075930010] |Skype error in ubuntu 10.10 [131075930020] |I am using Ubuntu 10.10 version. [131075930030] |Recently i am finding this error. [131075930040] |When i used to close the skype client then it used to go up to the desktop. ( The above panel where time and date are generally displayed.) [131075930050] |Now when i am closing it get's closed and i don't know where it's located. [131075930060] |Then when i try to sign in again it says Another Skype version is running. [131075930070] |Any ideas on how to rectify this. [131075940010] |You might accidentaly have removed the "system tray" from the top panel. [131075940020] |Do other applications still show their icons at the top? [131075950010] |Emacs text-scale-adjust causes line numbers column to incrementally shrink and disappear. [131075950020] |I've set up emacs to display line numbers (global-linum-mode 1), and it works until I start enlarging the text via text-scale-adjust [131075950030] |The line numbers column starts to shrink, and disappears entirely after a few increments. [131075950040] |When it has fully disappeared, further increments have no more effect on the left edge. [131075950050] |Is this a know issue? [131075950060] |Is there a workaround? [131075950070] |Using GNU Emacs 23.1.1 in Ubuntu 10.04 (and I'm an emacs newb). [131075960010] |Fastest RDP client on linux [131075960020] |I currently use KRDC on CentOS, but mouse pointer is a little slow and I'm sure that this is not caused by my internet line speed, because the windows RDP client works and everything is fine. [131075960030] |Which RDP client is the fastest on CentOS (or any other Linux OS)? [131075970010] |KRCD and I suspect all other Linux RDC clients use rdesktop under the hood. [131075970020] |I'd encourage you to play with the settings of rdesktop, I myself have used it without any speed issues. [131075970030] |It's very possible that your windows RDP connection uses different options, espescially the -x paramter to rdesktop: [131075980010] |I cannot comment on performance/speed of various RDP clients. [131075980020] |However I recently came across the FreeRDP project that describes itself as follows [131075980030] |FreeRDP is a fork of the rdesktop project that intends to rapidly start moving forward and implement features that rdesktop lacks the most. [131075980040] |I have not use KRDC but I have used both rdesktop and xfreerdp clients from the commandline on Ubuntu 10.10 and they are both usable. xfreerdp accepts the same -x option as @gnud mentions and that option is likely to make the biggest difference in performance. [131075990010] |I've taken to using Remmina lately. [131075990020] |I use it mostly because it manages a list of hosts and their settings quite nicely, and can set up an SSH tunnel automatically. [131075990030] |It does VNC too. [131075990040] |I haven't had performance problems with RDP in general though, and haven't used KRDC, so I couldn't say it would necessarily be any different from that point of view. [131075990050] |I don't know if Remmina is available in CentOS's repository. [131076000010] |OK, we find the problem :) [131076000020] |It seems that rdp client have some trouble with win7, so we try KRDC on others OS (centos, ubuntu and XP) and it work great... [131076000030] |Conclusion: The problem is not in RDP Client, but on the system on which we want to connect... [131076000040] |Thanks for your answers! [131076010010] |Using parallel on Ubuntu [131076010020] |I am having an issue trying to use parallel command on Ubuntu 10.04. [131076010030] |I looked up the parallel documentation and few of the commands seem to run. [131076010040] |In all cases I just get the command prompt back without any action being taken. e.g. [131076010050] |I was trying to compress a bunch of files using bzip2 [131076010060] |Neither of these commands worked. [131076010070] |Nor was there any error. [131076010080] |The example given in the man file worked fine though. [131076010090] |What am I doing wrong? [131076020010] |I assume you are trying to run both bzip2 ::: *fastq and ls *fastq|parallel bzip2 {} in parallel. [131076020020] |Any compelling reason you don't just open up two terminal windows and run them each in their own window? [131076030010] |Your first try is closest to being correct, but why the :::? [131076030020] |If you change ::: to --, it will do what you want. [131076030030] |parallel has a specific, unusual structure to its command line. [131076030040] |In the first half, you give it the command you want to run multiple times, and the part of the command line that will be the same every time. [131076030050] |In the second half, you give it the parts that will be different each time the command is run. [131076030060] |These halves are separated by --. [131076030070] |Some experimentation shows that if parallel doesn't find the second half, it doesn't actually run any commands. [131076030080] |It's probably worth re-reading the man page carefully. [131076030090] |Man pages have a terse, information-dense style that can take some getting used to. [131076030100] |Also try reading some pages for commands you're already familiar with. [131076040010] |Which kernel does reboot load? [131076040020] |I am using ssh to remotely access some machines. [131076040030] |These machines have a custom kernel installed (based on the 2.6.28 source). [131076040040] |However, whenever I try to reboot the machines using sudo reboot, the system uses kexec and loads the 2.6.28-19-generic kernel, which is also intalled on the machine. [131076040050] |So how can I specify which kernel image to load after reboot? [131076040060] |EDIT: I have ubuntu 9.04 installed on the machine, with grub 1.something. [131076040070] |The custom kernel is based on the 2.6.28 source with the name being 2.6.28.10-custom-1.1. [131076040080] |Two other kernels are installed on the machine 2.6.28-19-generic and 2.6.28-6-386. [131076040090] |I have checked that after calling reboot, the machine does not actually reboot but uses kexec to load the 19-generic kernel, even if the current kernel was the custom one. [131076050010] |Normally, when you reboot, the machine will return to grub and either allow you to select a kernel via the keyboard, or boot the default configured kernel. [131076050020] |However if you have kexec-tools installed, the reboot command will short circuit this behaviour and directly kexec into a kernel. [131076050030] |You can disable this behaviour, and return to grub in reboot, by uninstalling kexec tools or editing the file [131076050040] |and setting: [131076050050] |Alternatively, to keep kexec active and have it reboot into the kernel of your choice, try a command line like this to load your desired kernel: [131076050060] |then when 'kexec -e' is later run, the configured kernel in the kexec line as well will be run. [131076050070] |As I believe the reboot script eventually just calls 'kexec-e' I believe the kernel change should take effect then. [131076060010] |I found a pretty nifty post here. [131076060020] |It contains a script to call kexec manually. [131076060030] |Reposting script here: [131076070010] |Book on Linux kernel driver development [131076070020] |What good books are there out there for Linux kernel driver development? [131076070030] |Preferably targeting a rather new kernel release. [131076070040] |Which one is best in you opinion? [131076070050] |
  • Essential Linux Device Drivers
  • [131076070060] |
  • Linux Device Drivers
  • [131076080010] |Linux Device Drivers should help. [131076080020] |By the way, I'm no driver coder. [131076090010] |Linux Kernel Development by Robert Love covers linux-2.6.34 [131076100010] |You should opt for LDDv3, as it is one of the fundamental books on the same topic. [131076100020] |After you grab this book, go and look for Understanding the Linux Kernel. [131076100030] |These two book suffice to fulfill your thirst for kernel (driver) development. [131076110010] |Startup log file for RHEL? [131076110020] |When I start up my Red Hat box I see a progress meter in the center of the screen that has a button that says "Show Details...". [131076110030] |When I click on this button, I see a console like screen that shows the starting up of the services and such. [131076110040] |After the startup has completed and after I log in, is there some log file that I can look at to see what I saw during the startup? [131076110050] |If so, where is that log file? [131076120010] |After the system starts up, /var/log/boot.log should contain this information. [131076120020] |If the system has been online for awhile, the information may be moved into another boot.log.* file in the same directory. [131076120030] |Also, you can check /var/log/messages for any other messages that may have been generated during system startup. [131076130010] |"Linux supports the dynamic loading of kernel modules. " [131076130020] |I read in a book written by Robert Love that: [131076130030] |Linux supports the dynamic loading of kernel modules. [131076130040] |He said this is the difference between Linux and Unix, but I seem to recall there is also KLD in FreeBSD? [131076130050] |So can KLD also be seen as dynamic loading of kernel modules? [131076140010] |KLD is indeed dynamic kernel modules. [131076140020] |In fact, many old school Unixen also have loadable kernel modules nowadays. [131076140030] |Your book must be quite old :) [131076150010] |You're not giving enough context, but I suspect he meant the historical Unix implementation (from the late 60s to early 80s), which indeed didn't have loadable modules. [131076150020] |Linux was one of the first unices to get loadable modules, but I think SunOS (then not called Solaris) was there first. [131076160010] |Dynamic Symlinks [131076160020] |I have built my app for different architectures and would like to create a "dynamic symlink" which takes me to the right version based on a variable. [131076160030] |If the machine I am currently logged in to, is x86, then the symlink should take me to that build. [131076160040] |A mocked example of what I want to do: [131076160050] |Is this possible? [131076160060] |I know I can use cd $(uname -i), but want something simpler. [131076170010] |symlink is essentially a file with special flag which contains some path, and this path interpreted as is, so you can not make one symlink to point to other locations in that way. [131076170020] |But you still may write script that will run apropriate build. [131076180010] |If you just want a simpler syntax to type than: [131076180020] |You could put it in a variable like: [131076180030] |in your login script, so you can just do [131076180040] |When you want to cd [131076190010] |Symbolic links are static: the filesystem just stores a string, and accesses to the symbolic link are redirected to the file whose name (relative to the location of the symlink) is that string. [131076190020] |It would be simple to write a FUSE filesystem exposing such dynamic symlinks, but I don't know of an existing one. [131076200010] |I assume this is binaries, so I would do it with a PATH variable rater than symlink. [131076200020] |PATH=$PATH:/base/$ARCH/bin. [131076200030] |If you are using a tool like cfengine or puppet. [131076200040] |A symlink to the appropriate directory can be created based on the system architecture. [131076210010] |This feature is supported by DragonFly BSD, where it is called variant symlinks. [131076210020] |See man varsym and man ln for details. [131076220010] |I no longer have smart bash completion for normal user [131076220020] |I created a new user on our Ubuntu server and I no longer have the bash auto/smart completion (pressing tab once finishes your current phrase if possible. [131076220030] |Two tabs give you a ls). [131076220040] |Smart complete works fine as root, but I want to enable it for my user. [131076230010] |Does doing . /etc/bash_completion as your user enable completion? [131076230020] |If so, you can put it in your ~/.bash_profile file so that it gets run when you login. [131076240010] |Setting set disable-completion On in /etc/inputrc (or ~/.inputrc) will disable readline's autocomplete. [131076240020] |That would cause the Tab key to just tab. [131076240030] |Possibly having a shell other than bash could cause autocomplete to not work. [131076250010] |Improving OpenOffice speed [131076250020] |Hello people. [131076250030] |I'm looking for some tips and tricks on how to improve the performance of OpenOffice on my desktop. [131076250040] |Any ideas, tutorials or articles on this? [131076250050] |Thanks in advance! [131076260010] |Does your harddisk-LED burn after startup of OOorg? [131076260020] |Then you're probably depending on swap, which is always slow. [131076260030] |Buy more RAM if possible. [131076270010] |Im not using it anymore but there are some tips: [131076270020] |- reduce graphics cache (number of objects and memory per object) [131076270030] |- turn off font preview in font list [131076270040] |- turn off icons in menus [131076270050] |- reduce cache wherever is possible [131076270060] |I know that it may sound generic but it helps and speeds up OpenOffice a little (i used it in v2.x and v3.0). [131076270070] |If you find OOo too heavy, try to use GoogleDocs online (if you have broadband connection) in smaller browser window (it speeds up drawing of all elements in browser so try to use it in non-full screen). [131076280010] |Debian 6 installation DVD required [131076280020] |Hello. [131076280030] |I just want to install the operating system and SSH printserver . [131076280040] |I just burned the first DVD of the 8 avaible for the amd64 architecture. [131076280050] |How many DVDs should i burn in order the operating system to install ? [131076280060] |Note: Connection is slow as hell that is why i choose DVD solution [131076290010] |Only the first is enough. [131076290020] |It will even have at least one complete Desktop environment, GNOME. [131076290030] |The way the content is organised is such that the most popular packages (according to popcon) are in the earlier discs. [131076300010] |what could cause large pagefault latencies in linux? [131076300020] |I'm running a Linux netbook with an SSD. [131076300030] |Since the SSD is slow (and I don't want to wear it out) I've been running without swap. [131076300040] |So far this has been great, but I recently put a new kernel on (2.6.37) and noticed some slowdown. [131076300050] |During this the disk drive light on my netbook stays on. [131076300060] |LatencyTOP is only partially helpful in this, while one 3s (that's seconds not ms) delay is for 'disk write (synchronous),' one is 2s for 'page fault.' [131076300070] |I don't understand why there would be much of a penalty for a page fault at all since I'm not using swap to begin with (and seem to have a lot of free/cached memory). [131076300080] |What could be the cause of this, and is there a way to resolve it? [131076300090] |Is such a high latency for page faults even harmful or is the problem elsewhere? [131076310010] |Maybe the answers on this question may help you out. [131076310020] |Page faults occur even on the absence of swap, when the program tries to access a part of the virtual memory that is mapped but not yet on the physical memory like data from an on-disk file. [131076310030] |The correct term for that technique is Demand Paging. [131076320010] |Volume up/down function keys limited to gnome-volume-control "Unamplified 100%" level. [131076320020] |Using GUI gnome-volume-control: [131076320030] |the volume can be adjusted at will. [131076320040] |When using the keyboard volume-up and volume-down function keys the volume may be lowered at will but raising the volume is limited to the "Unamplified 100%" level. [131076320050] |Is there a way around this limitation? [131076320060] |Linux road 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 21:21:01 UTC 2011 i686 GNU/Linux [131076330010] |Currently, I don't think there is any way around this. [131076330020] |It seems like the integration between the pulseaudio and gnome-media volume settings is still problematic. [131076330030] |See for example: [131076330040] |
  • http://ubuntuforums.org/showthread.php?t=1358021
  • [131076330050] |
  • https://bugs.launchpad.net/ubuntu/+source/gnome-media/+bug/325215
  • [131076330060] |
  • http://ubuntuforums.org/showthread.php?t=1677681
  • [131076330070] |Seems like the only way to fix this is for someone to write a patch for gnome-media's gnome-volume-control. [131076340010] |Some people told me FreeBSD is NOT Unix, is that right? confused. [131076340020] |Some people told me FreeBSD is NOT Unix, is that right? confused. [131076340030] |I checked some articles, the expressions are pretty vague. [131076340040] |Need clarification. [131076340050] |Thank you all. [131076350010] |The word Unix is actually a trademark name that refers to System V Unix. [131076350020] |So "legally" it is not Unix. [131076350030] |But it is related and "looks" like Unix, so it is often called Unix, or Unix-like. http://en.wikipedia.org/wiki/Unix [131076360010] |It all come down to whether you are speaking legally, or from a technology viewpoint. [131076360020] |Legally, FreeBSD, like Linux, cannot use the trademarked term Unix. [131076360030] |From a technology point of view, FreeBSD is as much Unix as Solaris, HP-UX, or any of the other commercial versions that have paid to be able to be legally called Unix. [131076370010] |Execute a command once per line of piped input? [131076370020] |I want to run a java command once for every match of ls | grep pattern -. [131076370030] |In this case, I think I could do find pattern -exec java MyProg '{}' \; but I'm curious about the general case - is there an easy way to say "run a command once for every line of standard input"? [131076370040] |(In fish or bash.) [131076380010] |That's what xargs does. [131076390010] |In Bash or any other Bourne-style shell (ash, ksh, zsh, …): [131076390020] |read -r reads a single line from standard input (read without -r interprets backslashes, you don't want that). [131076390030] |Thus you can do either of the following: [131076400010] |I agree with Keith, xargs is the most general tool for the job. [131076400020] |I usually use a 3 step approach. [131076400030] |
  • do the basic stuff until you have something you would like to work with
  • [131076400040] |
  • prepare the line with awk so it gets the correct syntax
  • [131076400050] |
  • then let xargs execute it, maybe with the help of bash.
  • [131076400060] |There are smaller and faster ways, but this ways almost always works. [131076400070] |A simple example: [131076400080] |the 2 first lines selects some files to work with, then awk prepares a nice string with a command to execute and some arguments and $1 is the first column input from the pipe. [131076400090] |And finally I make sure that xargs sends this string to bash that just execute it. [131076400100] |It is a little bit overkill, but this recipe has helped me in a lot of places since it is very flexible. [131076410010] |When dealing with potentially unsanitized inputs, I like to see the entire job 'spelled out' line by line for visual inspection before I run it (especially when it's something destructive like cleaning people's mailbox's). [131076410020] |So what I do is generate a list of parameters (ie. usernames), feed it to a file in one-record-per-line fashion, like this: [131076410030] |Then I open the list in vim, and mangle it with search and replace expressions until I get a list of full commands that need to get executed, like this: [131076410040] |This way if your regex is incomplete, you will see in what command will have potential problems (ie. /bin/rm -fr johnnyo connor). [131076410050] |This way you can undo your regex, and try it again with a more reliable version of it. [131076410060] |Name mangling is notorious for this, because it's hard to take care of all the edge cases like Van Gogh, O'Connors, St. Clair, Smith-Wesson. [131076410070] |Having set hlsearch is useful for doing this in vim, as it will highlight all the matches, so you can easily spot if it doesn't match, or matches in an unintended way. [131076410080] |Once your regex is perfect and it catches all the cases you can test for/think of, then I usually convert it to a sed expression so it can be fully automated for another run. [131076410090] |For cases where the number of lines of input prevents you from doing a visual inspection, I highly recommend echoing the command to the screen (or better yet, a log) before it executes, so if it errors out, you know exactly which command caused it to fail. [131076410100] |Then you can go back to your original regex and adjust once more. [131076420010] |GNU Parallel is made for that kind of tasks. [131076420020] |The simplest usage is: [131076420030] |Watch the intro video to learn more: http://www.youtube.com/watch?v=OpaiGYxkSuQ [131076430010] |What file systems on Linux store the creation time? [131076430020] |Are there any (good known, reliable) file systems on Linux that store the creation time of files and directories in the i-node table? [131076430030] |If there are, is the "changed" time replaced by the creation time of an i-node in a stat call? [131076440010] |The ext4 file system does store the creation time. stat %W can show it to you. [131076450010] |Run process with higher priority [131076450020] |I want to run mplayer with higher priority than any other processes, including the IO-processes. [131076450030] |How can I do that? [131076460010] |To set niceness (CPU bound) use nice. To set IO niceness (IO bound) use ionice. [131076460020] |Refer to the respective man pages for more information. [131076460030] |You can use them together as follow: [131076460040] |Note: the lowest level of niceness (lower means more favorable) you can define is determined by limits.conf. [131076460050] |On my computer the file is located at /etc/security/limits.conf. [131076470010] |In general, as a non-root user, you can only decrease the priority of your tasks, not increase them. [131076470020] |So, one approach would be to lower the priority of everything else. [131076470030] |Or, you can set up something at the system level which handles your priorities. [131076470040] |If you're using a relatively modern Linux distribution, the most powerful way would be with control groups. [131076470050] |This is in its infancy so basically you'd have to configure everything by hand, but in short what you want is to configure the categorizer to put different processes into different CPU control groups, and then to give the mplayer process more CPU shares. [131076480010] |Virtual packages like 'mono-common' can't be removed. [131076480020] |Any ideas? [131076480030] |I'm trying to install mono as per these instructions: http://blog.ruski.co.za/page/Install-Mono-on-Ubuntu.aspx [131076480040] |I need to be able to run the second command apt-get remove mono-common but I'm tripping up at that first hurdle! [131076480050] |Thanks a lot [131076490010] |You're trying to build mono-2.4 yourself? [131076490020] |This article seems heavily outdated. [131076490030] |On Ubuntu Maverick (10.10): [131076490040] |should get you mono-2.6.7 [131076500010] |How do I profile the kernel? [131076500020] |I'm having issues with a kworker process during system boot and I'd like to get such a nice call graph like Linus Torvalds posted here. [131076500030] |How would I do this? [131076510010] |He used Perf to create this but I can't tell you exactly how Linus created the graph (which parameters etc.). [131076520010] |Use [131076520020] |$ perf-record -g [131076520030] |It will create the cal graph in a file called perf.data. [131076520040] |and then use following commadn to view report. [131076520050] |$ perf report [131076520060] |See man page of perf-record and report for details.