[131037190010] |Run daemon on startup in Fedora 13 after wireless interface is up [131037190020] |I want to have radvd (the IPv6 router advertisement daemon) run on startup on Fedora 13. [131037190030] |However, the network interface that it will use must be up, otherwise the daemon won't start. [131037190040] |If I run the daemon manually when the system is running everything works fine. [131037190050] |However, I can't figure out how to tell the Fedora 13 init system "run radvd on boot but only after wlan0 is up". wlan0 is managed by NetworkManager and it would be nice if I could keep it that way. [131037190060] |I tried enabling radvd on boot using the GUI system-config-services tool; then radvd tries to start in the boot process (after NetworkManager) but fails because wlan0 does not exist. [131037190070] |I also tried changing ONBOOT=no to ONBOOT=yes in /etc/sysconfig/networking/devices/ifcfg-wlan0 but that also didn't help (I don't understand exactly how the configuration in /etc/sysconfig/networking/ interacts with NetworkManager). [131037190080] |It seems to me that this kind of thing should be straightforward with Upstart but I can't find an Upstart event that tells me "a network interface is up". [131037200010] |I am not too familiar with Fedora, but I know network manager does have a built-in system to run scripts after an interface comes up. [131037200020] |On Arch linux the scripts are located at [131037200030] |/etc/NetworkManager/dispatcher.d [131037200040] |You will need to create a script to say when the interface is up, do this, when the interface is down do this. [131037200050] |In your case, start raddvd when the interface is up, and stop it when the interface is down. [131037200060] |Arch Linux's wiki has a bit more info and an example script that should get your going just fine. [131037200070] |https://wiki.archlinux.org/index.php/NetworkManager#Network_Services_with_NetworkManager_Dispatcher [131037210010] |On Ubuntu (you may have to adapt this for Fedora if it doesn't have the same chain): [131037210020] |
  • NetworkManager runs scripts in /etc/NetworkManager/dispatcher.d when an interface comes up or down. [131037210030] |In particular, /etc/NetworkManager/dispatcher.d/01ifupdown runs the ifupdown scripts.
  • [131037210040] |
  • Ifupdown runs scripts in /etc/network/if-up.d and /etc/network/if-down.d. [131037210050] |In particular, /etc/network/if-up.d/upstart and /etc/network/if-down.d/upstart trigger Upstart events. [131037210060] |Here's how you would catch these events in a service description: [131037220010] |Mount windows Users directory as /home in linux virtual machine [131037220020] |I'm setting up a laptop for a friend and I'm going to put linux on it in a virtual machine and I want to make it as seamless as possible. [131037220030] |I've mounted the \Users\Username directory in a VM before and that's not the hard part. [131037220040] |What the issue is though is that Windows uses NTFS links from say My Documents to \Documents which linux can't see (or at least doesn't display). [131037220050] |My question is what would be the best way to share a user's /home directory with their \Users directory? [131037220060] |Is there an easy way to remove all those links and force windows to not use links to their \Users\whatever directories? [131037220070] |Or my second thought would be to just mount it as a samba share and let the samba file system take care of all that stuff. [131037220080] |Is that a better solution? [131037220090] |The goal here is that I want to make using the linux machine as seamless and painless as possible. [131037230010] |You need to use an NTFS driver for Linux that actually supports symlinks, such as the Advanced NTFS 3G driver. [131037240010] |A NTFS driver will not help in your situation as you will not be mounting the raw file system in linux. [131037240020] |Likewise mounting a windows share using samba will still present you with a link file rather than a shortcut that works. [131037240030] |Perhaps rather than have the linux machine able to access the windows filesystem, it may be easier to have the linux filesystem accessable from windows by running samba on the linux VM. [131037240040] |The observation I would make is however, for your friend, what parts of windows would they miss if you gave them a linux only laptop? [131037240050] |If they only do email, web and chat then they will probably not miss windows. [131037250010] |installing grub 2 on mdadm, which device? [131037250020] |when installing grub(2) to mdadm devices are you supposed to install it to /dev/sdX or /dev/mdX? [131037260010] |You have to install it on /dev/sdX devices because grub runs before you are able to know that that your are using raid devices. [131037260020] |And you should install grub on all active disk that are part of the mdadm. [131037270010] |Fullscreen game messes with my xrandr dual-monitor setup [131037270020] |I have Gentoo Linux, the Awesome window manager and an open-source ATI driver. [131037270030] |Here's my xorg.conf: [131037270040] |And to enable the monitor on the right side I do xrandr --output HDMI-0 --mode 1280x1024 --right-of DVI-0 at system launch. [131037270050] |Good thing, it works. [131037270060] |Bad thing, Altitude game breaks it. [131037270070] |The main (left) monitor loses signal and I can't re-enable it ( while the game itself runs happily on the right screen, in fullscreen mode). [131037270080] |No problems in windowed mode (1024x768), as well as with all other applications (fullscreen flash, VLC, etc), but when I try to change in-game resolution to 1280x1024, it breaks the same way as with fullscreen. [131037270090] |Any ideas? [131037270100] |Edit: It breaks when I close the game as well. [131037270110] |Argh! [131037270120] |Edit2: Probably related to this bug. [131037270130] |Edit3: Investigating this strange behavior with the guys from Nimbly Games (creators of Altitude). [131037270140] |They actually fixed the problem at game exit, so I can at least play in windowed mode now. [131037270150] |As for fullscreen mode, I think it's a problem somewhere in xrandr, or unstable open-source radeon R600 drivers, so that Awesome (window manager) actually restarts when Altitude goes to fullscreen mode/tries to change resolution. [131037280010] |Figured it out. [131037280020] |I should have ran xrandr --output HDMI-0 --mode 1280x1024 --right-of DVI-0 with sudo. [131037280030] |That way normal applications don't have access to Randr's setup (resolution etc.), and so can't break anything. [131037280040] |Edit: Actually, it helped with only one game (Osmos). [131037280050] |For other's, monitor is still losing signal, but I can at least run xrandr again to restore it. [131037290010] |Arch Linux fails to boot from a USB key (cannot mount selected partition) [131037290020] |I tried to install Arch Linux to an USB key. [131037290030] |Things are kind of wobbly (it assumes the system has exactly one drive inside, for example) but everything installed just fine. [131037290040] |Until I rebooted. [131037290050] |(/dev/dsb1/(hd1,0) is a small FAT partition for data storing purposes -- for those locked down lab computers.) [131037290060] |Here's the 'Arch Linux' command sequence: [131037290070] |At the grub console: [131037290080] |I could successfully reboot in my host OS, Ubuntu, and used the Disk Tool to confirm partitioning was successful. [131037290090] |Also, running sudo kvm /dev/dsb resulted in a successful Arch boot once I edited the commands to boot from root (hd0,1) (that is, until Arch tried to mount /dev/dsb2). [131037290100] |What did I do wrong? [131037290110] |I have read the related wiki section but nothing seems to apply: I didn't use GParted or logical drives; everything is on the same partition. [131037300010] |The first thing to check in this situation is if the disk you're trying to boot from is the right one. [131037300020] |The ordering of disks can depend on many factors: [131037300030] |
  • In Grub1, you only get access to two hard disks. [131037300040] |This is a limitation of the BIOS interface. [131037300050] |Which two hard disks you actually get depends on your BIOS settings (look for something like “boot order”) and what disks and other hard-disk-like bootable media (e.g. USB flash drives) you actually have available.
  • [131037300060] |
  • Under Linux, the ordering of sda, sdb, etc., depends on the order in which drives are detected, which at boot time often depends on the order in which the drivers are loaded. [131037300070] |Also, whether some disks appear as sd? or hd? depends on kernel configuration options and udev settings.
  • [131037300080] |Here Grub is reporting a partition with type 7. [131037300090] |While Linux and Grub don't care about partition types (except for “container” partitions such as extended partitions), it is unusual to have a Linux filesystem on a partition with type 7 (which fdisk describes as HPFS/NTFS). [131037300100] |So my guess is that whichever drive your BIOS is offering as the second boot drive (Grub's hd1) is not the disk you want to boot, but some other disk with a Windows partition. [131037300110] |Check if hd0 is the drive you want to boot from; if it's not, you'll have to change your BIOS settings. [131037300120] |If Grub recognizes the filesystem in a partition, you can type something like cat (hd1,1)/ and press Tab to see what files are there. [131037300130] |This is the usual way of figuring out what filesystems you have where when you're feeling lost at a Grub prompt. [131037300140] |The second thing to check would be whether the partition you're trying to access is the right one — Grub1 counts from 0, Linux and Grub2 count from 1, and unusual situations (such as having a BSD installation) can cause further complications. [131037300150] |Adding or removing logical partitions can cause existing partitions to be renumbered in a sometimes non-intuitive way. [131037300160] |If you had the right partition on the right disk, then Filesystem type unknown would indicate that the partition doesn't contain a filesystem that your version of Grub support. [131037300170] |Grub1 supports the filesystems commonly used by Linux (ext2 and later versions, reiserfs, xfs, jfs) but (unless you have a recent patch) btrfs. [131037300180] |Grub1 also doesn't support LVM, or RAID (except RAID-1, i.e. mirroring, since it looks like an ordinary volume when just reading). [131037310010] |I really recommend using grub2 and uuids here. [131037310020] |you can get uuid by [131037310030] |ls -l /dev/disk/by-uuid [131037320010] |How to integrate sound with desktop events? [131037320020] |On Windows (sorry!), the Sounds &Multimedia control panel allows the connection of sound snippets to various operating-system events, like window movements, process start/stop, and start-up/shutdown. [131037320030] |I am using Gnome on Fedora 13, and I have not had any luck discovering any similar functionality. [131037320040] |Does such a function exist? [131037320050] |If so, is it cross-window-manager-compatible or tied to a specific window manager (Gnome, KDE, etc.) or distribution? [131037330010] |This functionality is desktop and window manager specific. [131037330020] |In particular in Gnome, the desktop is implemented independently of your window manager. [131037330030] |Those events that are triggered by Gnome are controlled by the gnome-volume-control program: [131037330040] |If you changed your default window manager configuration, it will depend on the window manager that you have selected. [131037340010] |The sound naming specification is fairly complete at this point. [131037340020] |However, the default GNOME and freedesktop sound theme are not complete (and for some good reasons). [131037340030] |Also, many applications are not making using of sound events, although they could. [131037340040] |On GNOME, libcanberra is commonly used to play sound events. [131037340050] |By adding custom file in $XDG_DATA_DIRS/sounds, you can customize your sound set. [131037340060] |My theme is "ubuntu", I can add a file: in $HOME/.local/share/sounds/ubuntu/stereo/battery-low.oga [131037340070] |and test it with ex: canberra-gtk-play -i battery-low [131037340080] |Read the specs and the gnome theme package for further informations. [131037340090] |More themes are welcome! [131037340100] |We have been looking for help in the past, and ubuntu as well today. [131037350010] |As Miguel de Icaza said in an earlier post: "This functionality is desktop and window manager specific." [131037350020] |In KDE desktop environment you can integrate sounds with desktop events, by going to [131037350030] |Configure Desktop->Application and System Notifications (read this) [131037360010] |How do I view the IO priority of a process? [131037360020] |How can I view the IO priority of a process? like to see for example if something has been ionice-ed. [131037370010] |For example: [131037370020] |This means X is using the none scheduling class (best effort) with priority 0 (highest priority out of 7). [131037370030] |Read more with man ionice. [131037380010] |what does the "a" in chattr +ia do? [131037380020] |what does the a in chattr +ia do? and why would you add the a in combination with the i? note: I know the i is for immutable [131037390010] |from the manpage for chattr [131037390020] |Files with this flag will fail to be opened for writing. [131037390030] |This also blocks certain potentially destructive system calls such as truncate() or unlink(). [131037390040] |This option is designed for log files. [131037400010] |man chattr 1 [131037400020] |chattr - change file attributes on a Linux file system [131037410010] |chattr - change file attributes on a Linux file system [131037420010] |Allow setuid on shell scripts [131037420020] |The setuid permission bit tells Linux to run a program with the effective user id of the owner instead of the executor: [131037420030] |However, this only applies to executables; shell scripts ignore the setuid bit: [131037420040] |Wikipedia says: [131037420050] |Due to the increased likelihood of security flaws, many operating systems ignore the setuid attribute when applied to executable shell scripts. [131037420060] |Assuming I'm willing to accept those risks, is there any way to tell Linux to treat the setuid bit the same on shell scripts as it does on executables? [131037420070] |If not, is there a common workaround for this problem? [131037420080] |My current solution is to add a sudoers entry to allow ALL to run a given script as the user I want it run as, with NOPASSWD to avoid the password prompt. [131037420090] |The main downsides to that is the need for a sudoers entry every time I want to do this, and the need for the caller to sudo some-script instead of just some-script [131037430010] |One way of solving this problem is to call the shell script from a program that can use the setuid bit. its something like sudo. [131037430020] |For example, here is how you would accomplish this in a C program: [131037430030] |Save it as setuid-test2.c. compile Now do the setuid on this program binary: su - nobody [enter password] chown nobody:nobody a.out chmod 4755 a.out Now, you should be able to run it, and you'll see your script being executed with nobody permissions. [131037430040] |But here also either you need to hardcode the script path or pass it as command line arg to above exe. [131037430050] |I hope this will help [131037440010] |You can create an alias for sudo + the name of the script. [131037440020] |Of course, that is even more work to set up, since you then have to setup an alias, too, but it saves you from having to type sudo. [131037440030] |But if you don't mind horrible security risks, use a setuid shell as the interpreter for the shell script. [131037440040] |Don't know whether that'll work for you, but I guess it might. [131037440050] |Let me state that I advise against actually doing this, though. [131037440060] |I'm just mentioning it for educational purposes ;-) [131037450010] |If you want to avoid calling sudo some_script you can just do: [131037450020] |SETUID programs need to be designed with extream care as they run with root privilages and user have large control over them. [131037450030] |They need to sane-check everything. [131037450040] |You cannot do it with scripts because: [131037450050] |
  • Shells are large piece of software with interacts heavily with user. [131037450060] |It is nearly impossible to sane check everything - especially that most of the code is not suppose to run in such mode.
  • [131037450070] |
  • Scripts are mostly quick'n'dirty solution and usually are not prepared with such care that would allow setuid. [131037450080] |Thay have many potentially dangerous features
  • [131037450090] |
  • They depend heavily on other programs. [131037450100] |It is not sufficient that shell was checked. sed/awk etc. would need to be checked as well
  • [131037450110] |Please note that sudo provide some sane-checking but it is not sufficient - check very line. [131037450120] |As a last note - consider using capabilities. [131037450130] |They allow to give process a special privilages that would require normally root privilages. [131037450140] |However for example while ping need to manipulate network it do not need to have access to files. [131037450150] |I'm not sure however if they are inherited. [131037460010] |I prefix a few scripts that are in this boat thus: [131037470010] |Linux ignores the setuid¹ bit on all interpreted executables (i.e. executables starting with a #! line). [131037470020] |The comp.unix.questions FAQ explains the security problems with setuid shell scripts. [131037470030] |These problems are of two kinds: shebang-related and shell-related. [131037470040] |

    Setuid shebang

    [131037470050] |There is a race condition inherent to the way shebang (#!) is typically implemented: [131037470060] |
  • The kernel opens the executable, and finds that it starts with #!.
  • [131037470070] |
  • The kernel closes the executable and opens the interpreter instead.
  • [131037470080] |
  • The kernel inserts the path to the script to the argument list (as argv[1]), and executes the interpreter.
  • [131037470090] |If setuid scripts are allowed with this implementation, an attacker can invoke an arbitrary script by creating a symbolic link to an existing setuid script, executing it, and arranging to change the link after the kernel has performed step 1 and before the interpreter gets around to opening its first argument. [131037470100] |For this reason, most unices ignore the setuid bit when they detect a shebang. [131037470110] |One way to secure this implementation would be for the kernel to lock the script file until the interpreter has opened it (note that this must prevent not only unlinking or overwriting the file, but also renaming any directory in the path). [131037470120] |But unix systems tend to shy away from mandatory locks, and symbolic links would make a correct lock feature especially difficult and invasive. [131037470130] |I don't think anyone does it this way. [131037470140] |A few unix systems (mainly OpenBSD, NetBSD and Mac OS X, all of which require a kernel setting to be enabled) implement secure setuid shebang using an additional feature: the path /dev/fd/N refers to the file already opened on file descriptor N (so opening /dev/fd/N is roughly equivalent to dup(N)). [131037470150] |Many unix systems (including Linux) have /dev/fd but not setuid scripts. [131037470160] |
  • The kernel opens the executable, and finds that it starts with #!. Let's say the file descriptor for the executable is 3.
  • [131037470170] |
  • The kernel opens the interpreter.
  • [131037470180] |
  • The kernel inserts /dev/fd/3 the argument list (as argv[1]), and executes the interpreter.
  • [131037470190] |Sven Mascheck's shebang page has a lot of information on shebang across unices, including setuid support. [131037470200] |

    Setuid interpreters

    [131037470210] |Let's assume you've managed to make your program run as root, either because your OS supports setuid shebang or because you've used a native binary wrapper (such as sudo). [131037470220] |Have you opened a security hole? [131037470230] |Maybe. [131037470240] |The issue here is not about interpreted vs compiled programs. [131037470250] |The issue is whether your runtime system behaves safely if executed with privileges. [131037470260] |
  • Any dynamically linked native binary executable is in a way interpreted by the dynamic loader (e.g. /lib/ld.so), which loads the dynamic libraries required by the program. [131037470270] |On many unices, you can configure the search path for dynamic libraries through the environment (LD_LIBRARY_PATH is a common name for the environment variable), and even load additional libraries into all executed binaries (LD_PRELOAD). [131037470280] |The invoker of the program can execute arbitrary code in that program's context by placing a specially-crafted libc.so in $LD_LIBRARY_PATH (amongst other tactics). [131037470290] |All sane systems ignore the LD_* variables in setuid executables.
  • [131037470300] |
  • In shells such as sh, csh and derivatives, environment variables automatically become shell parameters. [131037470310] |Through parameters such as PATH, IFS, and many more, the invoker of the script has many opportunities to execute arbitrary code in the shell scripts's context. [131037470320] |Some shells set these variables to sane defaults if they detect that the script has been invoked with privileges, but I don't know that there is any particular implementation that I would trust.
  • [131037470330] |
  • Most runtime environments (whether native, bytecode or interpreted) have similar features. [131037470340] |Few take special precautions in setuid executables, though the ones that run native code often don't do anything fancier than dynamic linking (which does take precautions).
  • [131037470350] |
  • Perl is a notable exception. [131037470360] |It explicitly supports setuid scripts in a secure way. [131037470370] |In fact, your script can run setuid even if your OS ignored the setuid bit on scripts. [131037470380] |This is because perl ships with a setuid root helper that performs the necessary checks and reinvokes the interpreter on the desired scripts with the desired privileges. [131037470390] |This is explained in the perlsec manual. [131037470400] |It used to be that setuid perl scripts needed #!/usr/bin/suidperl -wT instead of #!/usr/bin/perl -wT, but on most modern systems, #!/usr/bin/perl -wT is sufficient.
  • [131037470410] |Note that using a native binary wrapper does nothing to prevent these problems. [131037470420] |In fact, it can make the situation worse, because it might prevent your runtime environment from detecting that it is invoked with privileges and bypassing its runtime configurability. [131037470430] |TL,DR: [131037470440] |
  • Setuid shebang is insecure but usually ignored.
  • [131037470450] |
  • If you run a program with privileges (either through sudo or setuid), write native code or perl.
  • [131037470460] |¹ This discussion applies equally if you substitute “setgid” for “setuid”. [131037480010] |Will the system make sure that mdadm is sync-ed before completing a reboot? [131037480020] |This is a follow up to my crazy mdadm problem. [131037480030] |I'm trying to figure out what might have caused sda to get out of sync in the first place. [131037480040] |The only thing I can think of is that I had just run a bunch of updates and was rebooting to reload the kernel upgrade. [131037480050] |Is it possible that both drives hadn't synced? would the system prevent a reboot if there was mdadm syncing going on? could it be made to? any other suggestions as to what might have happened? and how it could be prevented in the further. [131037480060] |Nothing seems to be wrong with the drive. [131037490010] |It certainly does on a clean shutdown: [131037490020] |
  • The Debian mdadm FAQ implies the kernel does the right thing: [131037490030] |​8. [131037490040] |(One of) my RAID arrays is busy and cannot be stopped. [131037490050] |What gives? [131037490060] |It is perfectly normal for mdadm to report the array with the root filesystem to be busy on shutdown. [131037490070] |The reason for this is that the root filesystem must be mounted to be able to stop the array (or otherwise /sbin/mdadm does not exist), but to stop the array, the root filesystem cannot be mounted. [131037490080] |Catch 22. [131037490090] |The kernel actually stops the array just before halting, so it's all well.
  • [131037490100] |
  • The md driver sets all devices as read-only on shutdown (and even gives the physical devices about one second to settle).
  • [131037490110] |Even if your system crashes in the middle of a write, the driver does take care to mark blocks as dirty while they're being written to, and to resync dirty blocks if it starts from an unclean array. [131037490120] |See the comments regarding array states. [131037490130] |The kernel documentation warns that arrays that are both dirty (not cleanly shut down) and degraded (having missing pieces) are not assembled automatically as this wouldn't be safe. [131037490140] |When you assemble a dirty array, you'll (possibly very briefly) see it resync in /sys/block/md99/md/rd0/state. [131037490150] |All in all, the md driver takes care of protecting your data against a total failures of a hardware component (CPU or disk), which is what's expected of it. [131037490160] |What md won't protect you against is data corruption due to a Byzantine failure (i.e. silent flipping of one or more bits) in RAM, CPU, motherboard, or disk. [131037490170] |The disk hardware has checksums, but they're not perfect (see e.g. Zfs promotional literature). [131037490180] |Zfs and Btrfs can protect against storage device corruption. [131037490190] |Btrfs's checksum tree ensures that you will be notified if your hard disk flips a bit. [131037490200] |Zfs offers a choice of checksum (according to Jeff Bonwick's Blog), up to SHA-256 which protects not only against random corruption but even against deliberate attack, at the cost of CPU cycles. [131037500010] |What does file version mean: lsattr -v [131037500020] |lsattr -v gives me the "version number" of given file(s). [131037500030] |What does this mean? [131037500040] |On Redhat 7.3, I could've sworn all the version numbers were 1 except those I changed with chattr -v. [131037500050] |On Fedora 11, they appeared to be random numbers. [131037500060] |Setting version numbers or even having multiple versions of a file could be very useful, so I want to understand how "versioning" works in ext3. [131037510010] |This is not really an answer, but just a interresting find. [131037510020] |I played around with lsattr -v and it seems like each new file you create gets a unique number assigned to it. [131037510030] |Im not sure if this is correct, my expirement is documented below. [131037510040] |This behaviour could be limited to the distribution or the disk format. [131037520010] |lsattr -v invokes the EXT2_IOC_GETVERSION ioctl for the file. [131037520020] |This, in turn, retrieves the inode's i_generation field. [131037520030] |This is a feature primarily intended for use with NFS: each time an inode gets allocated, one has to make sure it gets a new generation. [131037520040] |Otherwise, NFS clients with stale file handles may manage to access data that weren't meant for them. ext2/ext3/ext4 allocates the generation number from a volume-global counter s_next_generation, which is incremented on every allocation. [131037530010] |How can I check which shell I am currently using? [131037530020] |Possible Duplicate: How to test what shell I am using in a terminal? [131037530030] |An echo $SHELL will only display the value of the SHELL variable which would indicate the default shell on the system. [131037530040] |But I might not be always using the default shell on my system: [131037530050] |How can I easily figure out what shell I am using? [131037540010] |How can I list only the directories present in a directory using ls? [131037540020] |Possible Duplicate: Is there any option with 'ls' command that I see only the directories? [131037540030] |I have a directory with a lot of files but only a few directories. [131037540040] |To get a list of only the directories, what I do is this [131037540050] |I know I can alias it to make it faster, but is there some easier way of doing this that I do not know about? [131037540060] |I checked man ls, but did not find any such flag there. [131037540070] |Also, ls -d displays only a ., nothing else. [131037550010] |Shell arithmetic question [131037550020] |I have a problem with a linux shell script (sh). [131037550030] |Im trying to write a script that calculates combinations, but I think I get overflows when trying to calculate faculties. [131037550040] |So, im trying a another technique. [131037550050] |But in this technique I used this: [131037550060] |This is giving errors, and apperently, I cant do this: [131037550070] |How to do it? [131037560010] |You can use dc for arbitrary precision results: [131037560020] |should work in about every Unix variant since 1977 or so. [131037560030] |If you know you have gnu dc available the more concise [131037560040] |can be used. [131037570010] |For your example with parens, you must escape them too: expr \( $var1 + $var2 \) / $var3 (and don't omit the spaces, or expr will complain). [131037570020] |In bash you can also use built-in arithmetic expansion like this: echo $(( ($var1+$var2)/$var3 )) [131037570030] |And for infix calculations there's bc (while dc is for reverse-polish notation). [131037580010] |making ssh hosts global to all the users on the computer [131037580020] |So SSH has these files that configure settings for a specific user. [131037580030] |I'd like to globalise some of these files, like config and known_hosts. [131037580040] |So that other users ( including root ) could share the configured hosts. [131037580050] |What would be the best way to do this? [131037590010] |Since root is all powerful, I would use a root cron job to copy the files form other users. [131037590020] |Known Hosts and authorized keys can simply be appended. [131037590030] |If it's all on one partitions there's the hardlink option. [131037590040] |Not sure if symlinks would work for the files, but you could try that, too, you just have to put them in in a shared, yet secure place. [131037600010] |For ~/.ssh/config you can place relevant system-wide settings in /etc/ssh/ssh_config according to the man page: [131037600020] |ssh(1) obtains configuration data from the following sources in the following order: [131037600030] |
  • command-line options
  • [131037600040] |
  • user's configuration file (~/.ssh/config)
  • [131037600050] |
  • system-wide configuration file (/etc/ssh/ssh_config)
  • [131037600060] |For each parameter, the first obtained value will be used. [131037600070] |The configuration files contain sections separated by “Host” specifications, and that section is only applied for hosts that match one of the patterns given in the specification. [131037600080] |Note that only the first value will be used, which means that the user can always override the system-wide configuration options locally. [131037600090] |For ~/.ssh/known_hosts you can use /etc/ssh/ssh_known_hosts or another file specified by the GlobalKnownHostsFile configuration option: [131037600100] |GlobalKnownHostsFile [131037600110] |Specifies a file to use for the global host key database instead of /etc/ssh/ssh_known_hosts. [131037600120] |I'm unsure if it is possible for the other files, but I imagine you could work something out with symlinks if you really wanted to share private keys among users as well. [131037610010] |back-up database in Linux partition from windows partition!! [131037610020] |Hello I am in a very embarrassing situation, I was trying to upgrade to ubuntu 10.04 from ubuntu 9.10 yesterday and while updating I forgot to put my laptop on charger and the battery ran out. [131037610030] |Since we know that there is no track back process in linux, all I get now is a blank terminal screen at the start up. [131037610040] |Even if I login, I still am stuck on that blank screen. [131037610050] |So the only way I see is to, format and reinstall my windows and linux instances. [131037610060] |So before I format it, I am trying to save all my data that is in the linux partition. [131037610070] |I am using ext2explore to save all my files. [131037610080] |I wanted to know if there was any possible way to export a database or a few tables into a file from my windows partition?? [131037610090] |I need to back up my database in the linux partition using my windows partition!! [131037620010] |If you have database backups, it's probably easiest to use those. [131037620020] |If you really need the databases, and you were using MySQL, then you can find them under /var/lib/mysql/ on the linux partition. [131037620030] |You will probably need all the files in that directory and its subdirectories. [131037620040] |Note that archiving those files from inside Ubuntu is probably a better idea, because that would preserve permissions (there probably is a question on this site already how to do that). [131037620050] |And like said in my comment to your question, it might be possible to continue the upgrade from the commandline instead. [131037630010] |Why use ext2explore if you can boot from Ubuntu LiveCD? [131037630020] |Are you sure you need to reinstall Windows too? [131037630030] |It's unlikely that it get corrupted during the course of installation. [131037630040] |Backup procedures may vary for different database engines, you better check the docs for your database first. [131037640010] |I don't understand why you think you have to reinstall Linux (or Windows, for that matter). [131037640020] |You seem to have had the bad luck that the power loss in the middle of the upgrade made your Linux installation unusable (or at least not easily usable), but that doesn't mean it's not recoverable. [131037640030] |The easiest way to recover would be to boot from a live CD or USB disk (preferably from Ubuntu 10.04, though any recent enough Linux should work). [131037640040] |(It's probably possible to repair your installation by booting it in a particular way, but the live CD approach is a little easier.) [131037640050] |The following commands assume you have a shell (command line) running as root (administrator). [131037640060] |
  • If you have an interface that offers to mount your existing Linux installation, do what it tells you. [131037640070] |Otherwise, do it manually: use fdisk -l to see what partitions you have and locate the system partition. [131037640080] |Mount it to some place. [131037640090] |Also mount procfs and sysfs under it. [131037640100] |For example, if your Linux partition is on /dev/sda99, run [131037640110] |
  • Start a “subsession” in the Linux installation with chroot: [131037640120] |
  • You should now have a shell in your Linux installation. [131037640130] |Run apt-get install or dpkg --configure -a to continue the upgrade. [131037640140] |(Sometimes running these commands a few times can get rid of errors, or at least let a lot of things progress even if a few packages are blocked by an error.) [131037640150] |It's possible that the crash left the system in a state where those commands aren't enough; if so, ask again, reporting the error messages you see.
  • [131037640160] |Note that I do not recommend accessing your Linux partition from Windows if the purpose is to extract important data. [131037640170] |Windows tools for Linux filesystem access are not fully reliable, especially if the filesystem was not unmounted cleanly. [131037650010] |How does file descriptor re-assigment work? [131037650020] |In a way this question is a extension of another question. [131037650030] |In bash you can do pretty neat stuff with file descriptors. [131037650040] |Like [131037650050] |to grep on stderr only. [131037650060] |My Question[s]: [131037650070] |
  • How many levels of descriptors are there. ( How high can the "numbers" go) ?
  • [131037650080] |
  • Appart from 1 and 2 ( which are stdout and stderr ), what is the meaning and general use of those other "numbers"?
  • [131037650090] |
  • Is the order in which they are specified important? e.g. command 1>&2 3>&1 2>&3 versus command 2>&3 3>&1 1>&2
  • [131037660010] |
  • You may well expect them to go up to 63 on a typical Linux box.
  • [131037660020] |
  • There is (was?) stdlog, but it's rarely used (I believe I never saw one).
  • [131037660030] |
  • The order is important: check man bash REDIRECTION.
  • [131037670010] |The number you need is given by the maximum file descriptor count from the ulimit(1) command. [131037680010] |Linux compability file system [131037680020] |I need to develop a file system for Linux for my diploma work. [131037680030] |
  • Where can I find infomation about this theme?
  • [131037680040] |
  • How can I test it and other?
  • [131037690010] |You want to start with FUSE -- all it requires is your implementation of system calls like open and unlink. [131037690020] |A tutorial, written using the Python bindings, is available at the FUSE Wiki. [131037700010] |Recording and charting boot process information in Linux [131037700020] |Hello everyone. [131037700030] |I need to write a command line tool that records the boot process information in Linux, and then renders it in a chart format (a textual chart would do). [131037700040] |How do I programmatically obtain the this boot process information? [131037700050] |Languages that I am allowed to use are C and C++. [131037700060] |Thanks in advance. :-) [131037710010] |Well, if no-one else is writing answer for this question (instead of valid comments), I'll do it. [131037710020] |bootchart.org is tool for doing exactly this. [131037710030] |Bootchart is a tool for performance analysis and visualization of the GNU/Linux boot process. [131037710040] |There is rather good page explaining how it works: Bootchart - How it works?. [131037710050] |In short, it's wrapper for normal init script. [131037710060] |See for example this document for more information on init. [131037710070] |That wrapper script then starts normal init and collects statistics from various places (/proc/stat, /proc/diskstats, /proc/[PID]/stat) as early as possible. [131037720010] |What file to I have to edit to make static dns server in CentOS [131037720020] |Almost every distro I know will wipe /etc/resolv.conf on reboot (I think dhcp does this) and thus the place to add static dhcp entries varies per distro. [131037720030] |How to I add static dns servers to a CentOS server? so that I know that my entries will survive a reboot? [131037730010] |It would really just come down to how you configure your dhcp client. [131037730020] |From the link provided, it seems the relevant file will be [131037740010] |For CentOS it looks like you add PEERDNS=no to /etc/sysconfig/network-scripts/ifcfg-eth0 (see the documentation). [131037740020] |More generically, iIf you're using dhclient then put the following in your dhclient.conf file: [131037740030] |For dhcpcd you add the -R option to the command line to stop it changing /etc/resolv.conf. [131037740040] |Finally pump uses the -d option on the command line to stop it changing /etc/resolv.conf. [131037750010] |immutable-like flag for perms [131037750020] |Is there any chattr flag that would allow me to lock a file's unix permissons, and not change them without resetting the flag? [131037750030] |The file itself should still be modifiable, I just want to prevent ... ignorant people ... from changing the permissions to something wrong accidentally. [131037760010] |There is no such flag with Linux chattr. [131037760020] |You can either make the file immutable or append-only (in either case, the file's permissions and ownership will be locked), or allow the owner of the file and root to change the permissions. [131037760030] |(The immutable attribute on a directory prevents creating or removing files from it but not changing entries' metadata.) [131037760040] |If changing the ownership of the file is acceptable, do it, and use access control lists (or group ownership) to give whoever needs it read and write access to the file. [131037760050] |If this is a social issue where your fellow roots can't be relied on, I don't think you'll find a satisfactory technical issue. [131037760060] |Disallowing the owner of a file to change permissions falls into the category of mandatory access control, which is not something unix traditionally supports. [131037760070] |There are several MAC frameworks on Linux, and the two major ones are SELinux and AppArmor; I don't know whether they do allow what you're trying to do. [131037760080] |If this is a general problem, you could look into using a database for storage. [131037760090] |You can typically give someone the permission to read and write to a table without letting them control the permissions. [131037760100] |A less drastic step than moving to a database would be moving the files to a different filesystem (this may or may not be feasible in your setting). [131037760110] |You could then use symbolic links in the place where the files must exist, and hope the permission changers aren't sophisticated enough to look in the place where the real files are (perhaps that could be made read-only?). [131037760120] |A FUSE filesystem that mirrors file contents but changes metadata is another possibility. [131037760130] |An existing one is bindfs, which can rewrite permissions (-o perms=…) and can ignore chmods (-o chmod-ignore). [131037770010] |How do I delete all files with a given name in all subdirectories? [131037770020] |I want to delete all files with a given name in all the subdirectories of my home directory. [131037770030] |I tried: [131037770040] |in my home directory, but it didn't work because that file doesn't exist in that directory. [131037780010] |find . -name "filename" -delete [131037790010] |as an elaboration on @tante's answer, you may wish to ensure the file list used is correct before deleting those files: [131037790020] |if inspection shows valid list then [131037790030] |another option if wanting this over many directories using a temporary holding directory: [131037790040] |As always, please ensure the accuracy of any scripts before execution and always have a backup ready in-case something goes wrong. [131037800010] |How can I get a base64 encoded shaX on the cli? [131037800020] |sha1sum outputs a hex encoded format of the actual sha. [131037800030] |I would like to see a base64 encoded variant. possibly some command that outputs the binary version that I can pipe, like so: echo -n "message" | | base64 or if it outputs it directly that's fine too. [131037810010] |Since sha1sum doesn't provide an option for binary output you'll likely need to find an utility which does the opposite of od and pipe them. [131037810020] |Taking suggestion by fschmitt to use xxd with 'reverse' and 'plain dump' flags it will look like this: [131037810030] |sha1sum | cut -f1 -d\ | xxd -r -p | base64 [131037820010] |I'm not completely sure I understand what you want, but I think something like the following should work: [131037820020] |Basically, I take the hex output, use sed to make it a string of escaped hex values, and then use echo -en to echo the bytes into base64. [131037820030] |We can confirm that the final output corresponds to the same hash with the following exercise: [131037820040] |Visual inspection shows that our base64 value matches the original hex. [131037820050] |Note that if you use hexdump rather than xxd you may have to play with the format settings a bit to get the output you expect. [131037830010] |Perl has a base64 module (in the base distribution since 5.7.1). [131037830020] |If you have the Digest::SHA module (in the base distribution since 5.9.3), or the older Digest::SHA1 module, you can do the whole computation in perl. [131037830030] |As of perl 5.10.1, b64digest doesn't pad the base64 output; if you need padding the easiest way is to use MIME::Base64. [131037840010] |If you have the command line utility from OpenSSL, it can produce a digest in binary form, and it can even translate to base64 (in a separate invocation). [131037850010] |Deleting lots of files [131037850020] |I accidentally created 8 million files and every time I'm trying to delete them the server almost dies because of the rm process eating all disk IO (the server is remote without console). [131037850030] |Should something like this work i.e. invoking ionice? [131037860010] |I'd do something like this: [131037870010] |I would do it like this... [131037870020] |the + is more xargs like (I think), and thus more efficient at very large numbers of files. putting ionice on the whole command should make every sub command also ioniced, as well as the search itself. [131037870030] |Have you tried this? [131037870040] |you could also make it really nice nice -n 19 ionice -c 3 programname though it shouldn't be necessary. [131037870050] |or taking a cue from @alex you could [131037880010] |Maybe too silly. [131037880020] |What about deleting the whole directory structure? [131037890010] |Find out if the OS is running in a virtual environment [131037890020] |Is there any way to find out if the OS i'm running (actually installing) is running in a VMWare machine. [131037890030] |I need to disable ntp settings if the automated install is done on a virtual machine but keep them enabled if installing on bare metal. [131037900010] |The best idea would probably to look at the hardware: At least with Virtualbox you can easily determine that you are on a virtual machine due to the names of some of the hardware devices (for example /sys/block/sda/device/model will say "VBOX HARDDISK"). [131037900020] |Since all your machines are VMware, just pick one of those things and check that. [131037910010] |Using dmidecode or lshw and greping seems to be to be the best way to find out. [131037920010] |red-green color blindness compatible vim theme [131037920020] |I am looking for a vim theme accessible to users with red green color blindness. [131037920030] |In particular, the red text on a dark terminal background all but disappears. [131037920040] |Do any of you know of a good theme? [131037920050] |Or have resources useful for designing one? [131037930010] |In my .vimrc I added: [131037930020] |That helped a lot. [131037940010] |I am not colorblind so I don't really know what works and what doesn't. [131037940020] |I use the desert color scheme which works great for me, but your best guess would be to go to http://code.google.com/p/vimcolorschemetest/ and just check them all out. [131037950010] |GRUB on USB Drive -- adding OSes [131037950020] |Hi All, [131037950030] |Some Background: [131037950040] |
  • Coming from a largely Windows background (though I'm familiar with Ubuntu, etc.) and using a Windows 7 machine to complete this task
  • [131037950050] |
  • Have gotten GRUB installed successfully to the MBR of the USB drive (8 GB FAT32 drive):
  • [131037950060] |
  • Have created a basic structure on the drive: /boot/grub, /boot/img, /boot/kernel
  • [131037950070] |Question: [131037950080] |I have some basic, beginner questions, but ones that I've had trouble finding answers to through Google / StackExchange, etc. [131037950090] |
  • I understand that the /boot/img/[SystemName] folder will store the image for a specific system, which may use various (or the same) versions of linux kernels stored in the /boot/kernel directory (at least, that's how I'd like to set it up)
  • [131037950100] |
  • However, most of these systems just have a kernel in their directories called "linux" (not stating the version). [131037950110] |I can search out which kernel these all use, but what's the bst place to get the kernels themselves to copy to /boot/kernel?
  • [131037950120] |
  • After I get the kernels, I imagine the rest is mostly copying the device to /boot/img/ and creating the proper entry in menu.lst, correct? [131037950130] |I can do that on a system by system basis once I can get the kernels to refer to.
  • [131037950140] |Overall Goal: [131037950150] |I'm attempting to create an 8GB usb flash drive that will allow me to boot multiple OSes from a GRUB boot menu. [131037950160] |To add or subtract OSes, I would like only to have to copy the appropriate files to a /boot/img/[SystemName] and a /boot/kernel folder as appropriate and then edit the menu.lst file. [131037950170] |So, this first step is about finding the kernels that many of these OSes share, as I'm hoping to reduce duplication. [131037950180] |I might be confused as to how the process works or terminology, but I promise I've worked in IT generally for 7+ years. [131037950190] |Appreciate any help that you can give! [131037960010] |Here's two guides: [131037960020] |
  • One guide in Unity Linux forum
  • [131037960030] |
  • And another one in PClos
  • [131037960040] |I think both use separate partitions for each kernel. [131037960050] |The entries in "/boot/grub/menu.lst" are like this: [131037970010] |It really depends of what distros you are putting there. [131037970020] |Some of them do some nasty stuff in the initramfs so it gets difficult. [131037970030] |Some live distros search for a label, some search for uuid. [131037970040] |You cannot provide that. [131037970050] |The solution is not easy, you should build new customised ramdisks for your live distros. [131037970060] |i hope i didn't get it wrong :D [131037980010] |You will certainly need some kind of userspace to go with each of these kernels. [131037980020] |(Programs, configuration, the works.) [131037980030] |Traditionally, you would use at least one partition for each separate OS, and the GRUB partition would itself be mounted as /boot (so you would not, in fact, have boot as a subdirectory of this partition; it would be the root directory, with grub/ as a subdirectory.) [131037990010] |What you are trying to achieve is stretching boot technology :) However I think it is possible, though I am not knowledgable enough to give a complete walkthrough. [131037990020] |First, like said before, distros have very different requirements. [131037990030] |Second, the good thing on the other hand, you can also find distros which need minimal requirements. [131037990040] |I would recommend to use GRUB4DOS as bootloader. [131037990050] |See this link how to use it with USB (because it has the find --set root -- command, which is important if you have mobile device like usb). [131037990060] |Then you have to decide how many partitions you will use. [131037990070] |Standard "Full install" is always in a single partition. [131037990080] |So if you have a 8 GB USB stick and take 4 GB partition (which allows minimal installation) you would be limmited to 2 different "Full Installs" of main distros like debian or fedora. [131037990090] |However there are some small and specialized Linux distributions. [131037990100] |For example "Puppy Linux" is very small and has a special "Frugal Installation" mode. [131037990110] |It comes in many flavors (e.g. there is MacPup with tries to implement an Apple like Desktop, or Fatdog64 which is a 64-bit Linux). [131037990120] |In this "Frugal installation" mode it just uses exactly 1 directory and can be installed in parallel to an existing Linux or Windows on the harddisk (or USB). [131037990130] |I am sure there are other distributions that support similar modes. [131037990140] |Since Puppy Linux is small (< 150 MB) and assuming you reserve a small savefile for each installation (512 MB), you could easily install like 10 different Operating Systems on the USB stick. [131037990150] |There are even smaller Linuxes (Slitaz, Tinycore), which you could use. [131037990160] |As example I attach the menu.lst (GRUB4DOS) file from my current PC-install, The first 8 entries are all different Puppy Linux installation on hd0,2 (i.e. the 3rd partition on the 1st hardisk), then there is a minimal debian installation in a small extra partition and also the original Windows-XP. [131037990170] |The menu.lst on your USB could look similar, the GRUB4DOS command find --set-root --ignore-floppies /lupq511/initrd.gz (looks for this file in all drives) could be very useful if you use USB, so you don't have to use fixed entries for your drive. [131037990180] |With the above information some comments on your original questions: [131037990190] |Q: * I understand that the /boot/img/[SystemName] folder will store the image for a specific system, which may use various (or the same) versions of linux kernels stored in the /boot/kernel directory (at least, that's how I'd like to set it up) [131037990200] |A: I am not sure if that is going to work, since most of the major distributions expect to have exclusive right of their partition and install a specific directory structure for their files. [131037990210] |In my opinion it is better to respect the default setup and provide what the distribution expects, i.e. some need an exclusive partition, some will be happy with just a directory on a shared partition. [131037990220] |I don't say it not possible to install multible OSES to 1 partition in a non default way, but it is begging for troubles and in my opinion not practical for a linux-newcomer. [131037990230] |A possible workaround I mention at the bottom of my post ("Wubi-like" installs). [131037990240] |Q: * However, most of these systems just have a kernel in their directories called "linux" (not stating the version). [131037990250] |I can search out which kernel these all use, but what's the best place to get the kernels themselves to copy to /boot/kernel? [131037990260] |A: I think the kernels should go exactly there where the distributions usually have them. [131037990270] |There is no need to store them in a seperate /boot/kernel folder, and I also would not recommnend to try to share them between distributions. [131037990280] |Storage space is minimal for a kernel (like 2-3 MB). [131037990290] |There are really a lot of versions and subversions and sometimes there are even specific patches applied to kernels of distributions. [131037990300] |To plugin in a different/untested kernel is an unneeded experiment. [131037990310] |Q: * After I get the kernels, I imagine the rest is mostly copying the device to /boot/img/ and creating the proper entry in menu.lst, correct? [131037990320] |I can do that on a system by system basis once I can get the kernels to refer to. [131037990330] |A: As mentioned before, better create seperate partitions for those distributions which need them and mix in the not so greedy distributions in their own folders. [131037990340] |Treat kernel, initrd and rest of the distro as a unit. [131037990350] |One last idea. [131037990360] |If you dont want to use different partitions you could try something like "WUBI" installs for the distros demanding a full install to its own partition. [131037990370] |This means that you create large files with its own ext2/ext3 filesystems on the USB, then mount them as "drives" and install the OS into it. [131037990380] |(I call it WUBI, because this is the best known application). [131037990390] |the following should be a Grub4dos menu.lst entry to boot a "Wubi install". [131037990400] |From here. [131037990410] |You see, there are 2 "set root" commands, the second after "root.disk" which contains the Linux, is mounted as loop0. [131037990420] |I hope I could give some ideas, although it is no complete walkthrough, best Emil [131038000010] |Ubuntu [131038000020] |

    Philosophy

    [131038000030] |The goal of the Ubuntu project is to provide a free computer environment, centered on a Linux distribution and complemented by online services. [131038000040] |

    Releases

    [131038000050] |The core of the Ubuntu distribution contains a Gnome-based desktop environment which is tightly integrated to the system, in particular providing a GUI for hardware management and system administration. [131038000060] |The supported core also includes other desktop environments such as KDE, although their integration is managed by side projects such as Kubuntu. [131038000070] |Ubuntu includes a small amount of non-free software such as drivers. [131038000080] |Ubuntu offers a large amount of packages directly taken from Debian's unstable distribution, in the form of the universe repository. [131038000090] |There is a release of Ubuntu every six months. [131038000100] |One in four is a long-term support (LTS) release. [131038000110] |

    Derivatives

    [131038000120] |Side projects of Ubuntu include: [131038000130] |
  • Edubuntu: for use in teaching.
  • [131038000140] |
  • Kubuntu: managing the integration of KDE into Ubuntu.
  • [131038000150] |
  • Mythbuntu: for media centers.
  • [131038000160] |
  • Ubuntu Studio: for multimedia production.
  • [131038000170] |
  • Xubuntu: managing the integration of Xfce into Ubuntu.
  • [131038000180] |

    Documentation

    [131038000190] |
  • Official documentation
  • [131038000200] |
  • Community documentation
  • [131038000210] |
  • Bug reports
  • [131038000220] |
  • Available packages
  • [131038000230] |
  • Third-party package repositories
  • [131038000240] |
  • Manual pages (e.g. man(1) in 10.04)
  • [131038000250] |
  • Support sources
  • [131038000260] |

    Common tasks

    [131038000270] |
  • Install a package: apt-get install package-name
  • [131038000280] |
  • Apply updates: apt-get update; apt-get upgrade
  • [131038010010] |Ubuntu is a Linux distribution with an emphasis on ease of use and installation [131038020010] |A Linux distribution combines the Linux kernel with other software to make a complete operating system. [131038020020] |The term “distribution” is sometimes used for other operating systems. [131038020030] |

    Linux (desktops and servers)

    [131038020040] |
  • arch-linux Arch Linux aims at keeping simple, light-weight and flexible.
  • [131038020050] |
  • centos CentOS is a community-supported, freely available distribution based on Red Hat
  • [131038020060] |
  • debian Debian has a large number of packages, many supported architectures, a slow release cycle and many derivatives.
  • [131038020070] |
  • fedora Fedora is a Red Hat-sponsored community-managed distribution with a short release cycle.
  • [131038020080] |
  • gentoo Gentoo aims at being highly modular and customizable.
  • [131038020090] |
  • mandriva Mandriva
  • [131038020100] |
  • opensuse OpenSUSE is a freely available, community-managed distribution sponsored by Novell (SuSE owner).
  • [131038020110] |
  • redhat rhel Red Hat Enterprise Linux is a commercial Linux distribution. [131038020120] |The company sponsors many Linux-related projects.
  • [131038020130] |
  • slackware Slackware is one of the oldest Linux distributions, once the leader of the field, supplanting the now-defunct SLS.
  • [131038020140] |
  • suse SuSE Enterprise Linux is the oldest existing commercial Linux distribution.
  • [131038020150] |
  • ubuntu Ubuntu provides a tightly integrated core aimed at being simple to install and use; it is based on Debian.
  • [131038020160] |

    Linux (lightweight and embedded)

    [131038020170] |
  • maemo Maemo is developed by Nokia for their smartphones; it is to be superseded by MeeGo.
  • [131038020180] |
  • meego MeeGo targets smartphones and other mobile devices.
  • [131038020190] |
  • puppy Puppy Linux is a lightweight distribution for PCs, focusing on ease of use; it runs from RAM and includes a GUI.
  • [131038020200] |
  • slitaz SliTaz is a lightweight distribution for desktop and server PCs.
  • [131038020210] |
  • webos WebOS is developed by Palm for their PDAs.
  • [131038020220] |
  • openwrt The WRT family of distributions (DD-WRT HyperWRT, OpenWRT, Tomato, …) targets networking equipment, primarily home routers.
  • [131038020230] |

    BSD

    [131038020240] |
  • freebsd FreeBSD has a large array of features and packages.
  • [131038020250] |
  • netbsd NetBSD focuses on portability.
  • [131038020260] |
  • openbsd OpenBSD focuses on security.
  • [131038020270] |
  • osx darwin Mac OS X is the operating system of Apple computers of today (mobile devices use a derivative called iOS. [131038020280] |It is based on a core derived from FreeBSD called Darwin.
  • [131038020290] |

    Related reading

    [131038020300] |
  • distribution-choice Choosing a distribution given particular requirements
  • [131038020310] |
  • How do you choose a distribution?
  • [131038030010] |Linux comes in the form of many different distributions [131038040010] |I need help with a cronjob to watch for runaway processes and kill them. [131038040020] |I have an interesting situation, I have a runaway ruby process - I know exactly how I trigger it. [131038040030] |Point is, it got me thinking about runaway processes (CPU usage or memory usage). [131038040040] |
  • How would one monitor runaway processes with cron? grep / top / ulimit?
  • [131038040050] |
  • Can one notify the user via the command line if something like this happens?
  • [131038040060] |
  • What alternatives are there to Monit?
  • [131038050010] |Instead of writing a script yourself you could use the verynice utility. [131038050020] |Its main focus is on dynamic process renicing but it also has the option to kill runaway processes and is easily configured. [131038060010] |The more conventional way to do this would be by imposing hard limits via ulimit -- it can even stop a forkbomb. [131038060020] |As Marcel Stimberg said, verynice is a similar utility but focuses solely on nice value rather than, say, limiting memory usage which was included in your question. [131038070010] |How to turn off permanent highlighting of all braces (not just pairs) in vim [131038070020] |I have no idea how I modified vim such that all braces are highlighted, not just matching ones, but I want to turn it off now. [131038070030] |How do I do that? [131038070040] |The usual highlighting of matching braces works fine. [131038080010] |Did you do a search for a brace? [131038080020] |If you did then you can either search for gibberish, or you can do a :set nohlsearch to turn off highlighting. [131038090010] |It could be a plugin called pi_paren. [131038090020] |You should be able to turn it off by executing NoMatchParen (and DoMatchParen to turn it back on). [131038090030] |If you want to turn it off permanently, add (to your .vimrc): [131038100010] |How to uninstall RHEL from a dual-boot system? [131038100020] |I had RHEL 5 and WinXP on dual-boot and then from WinXP I deleted those partitions which were allocated to RHEL. [131038100030] |Now I am not able to start my computer. [131038100040] |The booting process stops at grub. [131038100050] |I tried installing XP again so that it repairs the MBR for XP but the bootable CD is not initiating the installation process. [131038100060] |How can I recover my winXP? [131038100070] |Edit : I will not mind formatting the drive where XP is installed (in my case it's in C drive). [131038100080] |Problem solved : Thank you guys for your help and support. [131038100090] |I tried the RHEL cd and then in the command mode I tried fdisk -l and it showed that 1 partition was being used by Linux. [131038100100] |I deleted that and then booted through WinXP CD and followed the steps which zypher suggested and it worked. [131038110010] |If you boot to your windows installation CD, you should see an option called "repair console" or something similar. [131038110020] |Select that, it will bring up a dos prompt. [131038110030] |Type the following commands: [131038110040] |fixboot then fixmbr and reboot, you should be good after that unless there is something wrong with your windows install. [131038120010] |How do I see what symlinks exist for a given directory? [131038120020] |I want to do some housekeeping in a directory, and I want to see if a given directory has any symlinks pointing to it. [131038120030] |I can easily enough see what directory a symlink points to, but now I want to see the relationship in reverse. [131038130010] |You'll need to search from / using find(1) and the -type l option to identify all links, followed by a grep(1) to isolate the links of interest. [131038140010] |Symbolic links are not tracked, so you'll have to perform an exhaustive search. [131038140020] |Furthermore, symbolic links are textual, so they keep “existing” even if the filesystem they reside on is unmounted (and they may have a different target if mounted in a different place or if you rename directories). [131038140030] |So the most you can do is find the symbolic links pointing to a particular file (or directory), say /target, in a particular directory hierarchy, say /haystack. [131038140040] |(Note that I assume you are really looking for symbolic links to a particular directory. [131038140050] |Finding symbolic links pointing into a directory (i.e. to a file or subdirectory of that directory) or accross a directory (i.e. that may become dangling if you remove the directory) are much harder problems.) [131038140060] |With some versions of find (e.g. on (recent enough) Linux, FreeBSD or Mac OS X), you can easily look for symbolic links whose target is /target: [131038140070] |On systems whose find command doesn't have the -samefile primary, you can use ksh or bash instead, if available. [131038140080] |Remove -xtype if it's also not supported; then the command will also list the target itself (or any hard link to it). [131038140090] |Doing this with only POSIX tools is a lot harder, due to the lack of POSIX ways to test same-file-ness or obtain information about symbolic links. [131038140100] |Here's a solution for directories; it assumes there are no newlines in any filename. [131038140110] |With some shells, you may need to replace pwd by exec pwd for proper symbolic link following. [131038140120] |And here's my obligatory zsh solution. [131038150010] |How to get touchpad functional, again? [131038150020] |I messed something up and can't get my touchpad functional at all on GNOME 2.30 any more. [131038150030] |I looked at Mouse Preferences on the Touchpad tab, and can't find the magic switch. [131038150040] |The touchpad works on the Virtual Terminals, and on LXDE. [131038150050] |Here's output from dmesg, after running sudo modprobe psmouse: [131038160010] |This is probably a problem with GConf. [131038160020] |With gconf-editor, reach the /desktop/gnome/peripherals/touchpad "folder" and make sure touchpad_enabled is ticked. [131038160030] |I've set this value as mandatory because for some reason this value kept getting disabled. [131038160040] |This hasn't happened since. [131038170010] |No sound from cli apps or from zsnes [131038170020] |Some programs don't have sound, in particular ZSNES and anything I run from the command line. [131038170030] |So my question has two parts: [131038170040] |
  • How can I diagnose this problem? [131038170050] |(I'm thinking of a command like lspci that will display the idiosyncracies of my system setup... would that be lsmod?)
  • [131038170060] |
  • What do I need to install/modify to fix this?
  • [131038180010] |There are several different sound framework under many unix variants. [131038180020] |Typically the framework used by the program talks to the framework that can talk to the hardware. [131038180030] |If some programs have sound and others don't, the most likely explanation is that the non-working programs are using a sound system that is not working. [131038180040] |Commands like lspci and lsmod might be helpful if you had a hardware problem, but they're not likely to be relevant if you have a sound framework problem. [131038180050] |Common sound frameworks include OSS (older Linux kernel interface), ALSA (newer Linux kernel interface), Pulseaudio (the default on Ubuntu, supported by more and more programs), aRts (mostly used by older versions of KDE), ESound (esd) (older versions of Gnome and many older programs), JACK (supported directly only by a few high-end applications), and more. [131038180060] |Here is some information that you should include in a question like this one. [131038180070] |
  • Your operating system (e.g. Ubuntu 10.04, OpenBSD 4.7, …). [131038180080] |This is something you should always indicate when asking a unix question (even on a distribution-specific forum, indicate the version).
  • [131038180090] |
  • What sound framework(s) you've installed and how you configured it/them. [131038180100] |(“Whatever is installed by default, I didn't knowingly change anything” is a valid answer.)
  • [131038180110] |
  • What sound framework the non-working program is using. [131038180120] |This may be hard for you to figure out; if you can't find the answer, give as much data as you can (e.g. [131038180130] |“I'm using the binary downloaded from http://​example.com/foo.zip”), so that people can look it up for themselves or suggest more places for you to look. [131038180140] |
  • This may be mentioned in the program's documentation.
  • [131038180150] |
  • It may depend on compile-time options, so check the place where you got the program.
  • [131038180160] |
  • The program may have a way to switch between sound frameworks on the command line or in a configuration file.
  • [131038180170] |
  • If the program came in a package (deb, rpm, pkg, etc.), the package's dependencies should include a sound framework.
  • [131038180180] |
  • Try ldd /path/to/executable. [131038180190] |This command will display the shared libraries the program is using; hopefully one of them corresponds to the sound framework.
  • [131038180200] |
  • If there are any error messages, report them (copy and paste). [131038180210] |Check if the program has a log file somewhere, or if there's an option for it to produce more detailed error messages.
  • [131038180220] |If you give more information and I have more to contribute, I'll edit this answer. [131038190010] |forwarding DHCP packets [131038190020] |I've got this configuration: [131038190030] |And I want to add another computer (computer2) connected by cable to computer1. [131038190040] |Is it possible then to configure computer1 to forward all packets from/to computer2 with DHCP packets too? [131038190050] |And if yes, how? [131038200010] |As for DHCP your going to have a difficult time. [131038200020] |You might have to start a DCHP server on computer 1's Ethernet Connection. [131038200030] |You should checkout this question. [131038200040] |It seems to be related to what you are trying to do. [131038200050] |Except that computer 2 and computer 1 IP's are manually set.... [131038210010] |What you are looking for is called DHCP Relay there is an agent for that! [131038220010] |Getting the number and names of windows in Xvfb [131038220020] |Hi, [131038220030] |I am currently working with Xvfb to grab the screenshots of my programs. [131038220040] |Is there a way to determine the number and the names of the windows that are currently "displayed" in Xvfb? [131038220050] |I also appreciate some reading resources! [131038220060] |Thanks, Heinrich [131038230010] |If you run a window manager on the Xvfb display, you can use whatever features it has to list window information. [131038230020] |On the command line, wmctrl can show some window information. [131038240010] |xwininfo -root -tree [131038240020] |See the xwininfo man page for more information. [131038250010] |/etc/cron.daily/foo : Send email to a particular user instead of root? [131038250020] |I'm running CentOS 5.5. [131038250030] |We have several cronjobs stored in /etc/cron.daily/ . [131038250040] |We would like the email for some of these cronjobs to go to a particular email address, while the rest of the emails in /etc/cron.daily/ should go to the default email address (root@localhost). [131038250050] |Cronjobs in /etc/cron.daily/ are run from the /etc/crontab file. /etc/crontab specifies a 'MAILTO' field. [131038250060] |Can I override this by setting MAILTO in my /etc/cron.daily/foo cronjob? [131038250070] |What's the best way to handle this? [131038260010] |Setting MAILTO=user@example.org in /etc/cron.daily/foo does not work. [131038260020] |The script output is not sent to user@example.org . [131038260030] |The page at http://www.unixgeeks.org/security/newbie/unix/cron-1.html also suggests a simple solution: [131038260040] |The file /etc/cron.daily/foo now contains the following: [131038260050] |This will send an email to 'stefanl@example.org' with the subject which is equal to the full path of the script (e.g. /etc/cron.daily/foo). [131038260060] |Here's what Unixgeeks.org says about this: [131038260070] |Output from cron [131038260080] |As I've said before, the output from cron gets mailed to the owner of the process, or the person specified in the MAILTO variable, but what if you don't want that? [131038260090] |If you want to mail the output to someone else, you can just pipe the output to the command mail. e.g. [131038260100] |cmd | mail -s "Subject of mail" user [131038270010] |Assuming you have SA access on this machine, you can create a new user account, add the tasks to this accounts cron tasks. [131038270020] |The mail for this user can then be forwarded using a .forward file in this accounts home folder. [131038270030] |You may have to set up permisions for this user if the cron tasks require privilaged access. [131038270040] |Whether this or Stefan's answer suits best really depends on how much hassle you want in setting it up and whether you want error messages to go to the root email or to the people that normally monitor the daily output. [131038270050] |Good luck [131038280010] |How to do a print screen or capture an area of the screen [131038280020] |Is there an equivalent of the Window's Print Screen + Paste (or better yet the Mac OS Cmd+Shift+4, Space) in gnome? [131038290010] |There are tons. [131038290020] |I personally use import, from ImageMagick. [131038290030] |It has the ability to capture the whole screen, a given window, or to let you select an area of the screen and just capture that [131038290040] |

    Whole screen

    [131038290050] |

    Individual window

    [131038290060] |First you need to find out the X window ID: [131038290070] |Then you can run import: [131038290080] |

    Specific area

    [131038290090] |import will let you draw an area with the mouse to capture: [131038290100] |You can use xbindkeys to bind those commands to the Print Screen key; I use a script called screenshot, so my configuration looks like: [131038300010] |Hit print screen and if gnome is setup correctly, a screenshot utility will pop up. [131038310010] |Gnome should have screenshot abilities built already in. [131038310020] |However, the default trigger is the Print key, which your keyboard may lack. [131038310030] |You can remap this shortcut with gnome-keybinding-properties. [131038320010] |Enable kwebkitpart in Konqueror [131038320020] |in KDE SC 4.5.0 it's possible to use a webkit part for rendering in konqueror. [131038320030] |I don't think it's on by default (could be wrong?) I believe I've installed all the requirements for it... how do I enable it? [131038320040] |UPDATE [131038320050] |I figured out how to switch it... [131038320060] |but you must be on a web page first. [131038320070] |Problem is that this setting doesn't stick. [131038320080] |I can't find a permanent setting, does one exist? [131038330010] |I might be wrong here, but I think Konqueror always has WebKit enabled. [131038330020] |It's where WebKit started after all. [131038330030] |Usually your User-Agent environment variable reveals the rendering engine as well. [131038330040] |You can see your User-Agent var here, for example. [131038340010] |I just found an article posting how to do it for kubuntu. [131038340020] |The short of it is configure the file association for text/html (embedding) and set the first as webkit. [131038340030] |I'm sure you should do it for application+xml/xhtml too. [131038340040] |Maybe some others. [131038350010] |Why are updates pushed to Fedora's updates-testing repos initially invisible? [131038350020] |I follow various bugs on Red Hat Bugzilla, and I just received a notification from the Fedora Update System that a new package was available for testing that supposedly fixes a bug I was interested in. [131038350030] |I wanted to test it, so I tried to follow the instructions. [131038350040] |Unfortunately, although the packages are described as having been "pushed to updates-testing", I see no evidence that they are actually there yet. [131038350050] |It seems somewhat silly to publish a command for testing an update that initially doesn't work, but this is apparently what they are doing on a regular basis! [131038350060] |I tried a couple of things: [131038350070] |
  • Commented out mirrorlist and uncommented base-url in /etc/yum.repos.d/fedora-updates-testing.repo to make it use (what I believe to be) the "master" public download site
  • [131038350080] |
  • yum clean all
  • [131038350090] |but these made no difference to the outcome - still no new packages available, according to yum. [131038350100] |Details: It's mesa-libGL (and the other mesa packages) for Fedora 14. [131038360010] |By default, you can use: [131038360020] |...which will show you both the last time that Fedora updated (in the metalink/updated row) and the last time you updated (in the repo-updated row). [131038360030] |As a quick check you can also just run "yum repolist" on it's own, and any rows that start with a '*' do not have the latest metadata locally. [131038360040] |AIUI Fedora post the messages about packages being pushed as they are approved ... but it can still be a non-trivial amount of time after that before they are in the Fedora repo. (and longer for your local mirror to sync.) [131038370010] |Number of files per directory [131038370020] |I have a directory with about 100000 small files (each file is from 1-3 lines, each file is a text file). [131038370030] |In size the directory isn't very big (< 2GB). [131038370040] |This data lives in a professionally administered NFS server. [131038370050] |The server runs Linux. [131038370060] |I think the filesystem is ext3, but I don't know for sure. [131038370070] |Also, I don't have root access to the server. [131038370080] |These files are the output of a large scale scientific experiment, over which I don't have control. [131038370090] |However, I have to analyze the results. [131038370100] |Any I/O operation/processing in this directory is very, very slow. [131038370110] |Opening a file (fopen in python), reading from an open file, closing a file, are all very slow. [131038370120] |In bash ls, du, etc. don't work. [131038370130] |The question is: [131038370140] |What is the maximum number of files in a directory in Linux in such a way that it is practical to do processing, fopen, read, etc? [131038370150] |I understand that the answer depends on many things: fs type, kernel version, server version, hardware, etc. [131038370160] |I just want a rule of thumb, if possible. [131038380010] |As you surmise, it does depend on many things, mostly the filesystem type and options and to some extent the kernel version. [131038380020] |In the ext2/ext3/ext4 series, there was a major improvement when the dir_index option appeared (some time after the initial release of ext3): it makes directories be stored as search trees (logarithmic time access) rather than linear lists (linear time access). [131038380030] |This isn't something you can see over NFS, but if you have some contact with the admins you can ask them to run tune2fs -l /dev/something |grep features (perhaps even convince them to upgrade?). [131038380040] |Only the number of files matters, not their size. [131038380050] |Even with dir_index, 100000 feels large. [131038380060] |Ideally, get the authors of the program that creates the files to add a level of subdirectories. [131038380070] |For no performance degradation, I would recommend a limit of about 1000 files per directory for ext2 or ext3 without dir_index and 20000 with dir_index or reiserfs. [131038380080] |If you can't control how the files are created, move them into separate directories before doing anything else. [131038390010] |Also, see this http://stackoverflow.com/questions/466521/how-many-files-in-a-directory-is-too-many [131038400010] |Forcing emacs to run with `-nw` when called from terminal [131038400020] |note: This question might have been asked before ( I think I saw it somewhere), but a quick search did not reveal anything. [131038400030] |I would like to tell the difference when a command is run from a shell. [131038400040] |Emacs can be initialized with the -nw flag to disable the gui window, and I want this to be the default behaviour. [131038400050] |However if emacs is run from a non-shell environment, ( e.g. from the Open With in your filemanager, a desktop configured hotkey, or even from bashrun ), it should not be called with the -nw flag. [131038400060] |update: This should be a global change, running sudo emacs in Terminal should'nt suddenly open a gui. [131038400070] |Where do I make these changes? [131038410010] |Say this: [131038410020] |Log out, then log back in, and you will get the behavior you are asking for. [131038410030] |The alias applies only to Bash. [131038420010] |I think you want to determine if a command is run in a terminal. [131038420020] |If you want this to always happen when you run Emacs, put it in a script and invoke that script instead. [131038420030] |You can call the script /usr/local/bin/emacs (assuming Linux) if you want it to be called emacs and invoked in preference to the “real” emacs executable in /usr/bin. [131038420040] |Note that to edit files as root, you should use sudoedit (benefits: the editor runs as you so you get all your settings; the edited file is put into place atomically when you finish editing, reducing the chance of a mishap). [131038420050] |You can also edit files as root directly inside Emacs by opening /sudo::/path/to/file. [131038430010] |Using find to find symlinks that point to a certain pattern of files [131038430020] |I have several directories that all have various symlinks in them. [131038430030] |I want find (or another program) to find based on where the symlinks point to. [131038430040] |For example this is how it currently works: [131038430050] |This is what I'd like to be able to do [131038440010] |-L means follow symbolic links and according to man it takes properties from this file. [131038440020] |Alternativly you can write: [131038440030] |The second option will work with broken links. [131038450010] |understanding the exclamation mark (!) in bash [131038450020] |Hi, [131038450030] |I used [131038450040] |to get the lines of previous commands and from the numbers on the left hand side I found the line I wanted repeated (eg. 22) and did [131038450050] |at the command prompt and it worked executing the set of commands on the line I did at that time. [131038450060] |I cannot figure out where the exclamation mark is used, what does it represent in terms of actions taken by bash, and where to use it. [131038450070] |From the documentation I do not see an explanation that is 'tangible'. [131038450080] |Best, [131038460010] |! is a feature that originally appeared in the C shell, back in the days before you could count on terminals to have arrow keys. [131038460020] |It's especially useful if you add the current number to the prompt (PS1="\!$ ") so you can quickly look at your screen to get numbers for past commands. [131038460030] |Now that you can use arrow keys and things like Ctrl-R to search the command history, I don't see much use for the feature. [131038460040] |One variant of it you might still find useful is !!, which re-executes the previous command. [131038460050] |Personally, I don't find that any faster than just Up Arrow Enter. [131038470010] |If there isn't a longer answer here there's certainly one on Super User, since I've read one recently. [131038470020] |The man page has a huge section titled HISTORY EXPANSION on the matter. [131038470030] |You can do a whole host more than just run the last command, or command number X. You can do things like !cat to run the last command that started with cat. [131038470040] |Or !!:s/bash/csh/ runs the last command containing bash but replaces it with csh. [131038480010] |A friend of mine emailed me this: [131038480020] |It's part of GNU history library. [131038480030] |In bash it is used to re-run commands in your history. [131038480040] |If you want to be hardcore, grep for history_expansion_char in bash-4.1/lib/readline/histexpand.c for implementation details. [131038490010] |How to enable killing Xorg with Ctrl+Alt+Backspace [131038490020] |I don't remember why they did this, but at one point X.org decided that disabling CtrlAltBackspace to kill it was a good idea. [131038490030] |I know there's a way to re-enable it but I don't remember how. [131038490040] |Can someone refresh my memory? [131038500010] |you can try following ( I have tried it on my Ubuntu) : [131038500020] |Add the following lines to your xorg.conf file, making sure that when you paste it, it is NOT using smart quotes. [131038500030] |sudo gksudo gedit /etc/X11/xorg.conf [131038500040] |you can also try dontzap tool [131038500050] |sudo apt-get install dontzap [131038500060] |Open Terminal and type to enable [131038500070] |sudo dontzap --enable [131038500080] |for disable [131038500090] |sudo dontzap --disable [131038510010] |Modify /etc/X11/xorg.conf with the following. (note: it is ok if this is all you have in your xorg.conf as xorg will still auto-detect the rest (note: that is if auto-detect works for you without it)) [131038520010] |http://who-t.blogspot.com/2009/04/zapping-server.html explains the change and how to change it back. [131038530010] |Bacula + bat on Ubuntu Maverick [131038530020] |Hey all, [131038530030] |Okay, so I have a goal, and I'm unsure of the best steps to take to get there. [131038530040] |Goal: [131038530050] |
  • Set up a Linux VM in VirtualBox (Host: Windows Server 2008 R2)
  • [131038530060] |
  • Setup Bacula in a Linux environment
  • [131038530070] |
  • Get Bacula to backup to a NAS device (preferably a Drobo as it's less expensive for us than other NAS solutions appear to be and we don't have time to build something like FreeNAS / ZFS)
  • [131038530080] |Steps taken so far: [131038530090] |
  • Created VirtualBox VM of Ubuntu Server (Maverick) as the guest
  • [131038530100] |
  • Installed KDE on Ubuntu
  • [131038530110] |
  • Updated packages, etc.
  • [131038530120] |
  • Installed Bacula -- no configuration, etc.
  • [131038530130] |Steps that need to be taken, to my knowledge: [131038530140] |
  • Install and run Bacula Administration Tool (bat)
  • [131038530150] |
  • Configure Bacula (either via bat or .conf files) -- backup to USB external HDD (to test backups, schedules, clients, etc.)
  • [131038530160] |
  • Re-configure Bacula storage daemon to backup to a network-attached Drobo device (i.e. Drobo FS)
  • [131038530170] |Questions so far: [131038530180] |
  • I see the following errors in the terminal and the bat tool when it starts -- why?
  • [131038530190] |Terminal output: [131038530200] |And on the console I receive: "bat: ABORTING due to ERROR in console/console.cpp:155 Failed to connect to localhost-dir for populateLists" [131038530210] |First Troubleshooting Avenues [131038530220] |This seems to me like bacula-dir isn't started? [131038530230] |No configuration has been done, and I certainly don't pretend to know how to start Bacula properly. [131038530240] |I've tried consulting the documentation, to no avail for this particular implementation. [131038530250] |Any help? [131038530260] |Thanks! [131038540010] |I think that your first problem is related to bat running at root rather than as your "normal" user account. [131038540020] |I'm guessing you started it using [131038540030] |or something similar. [131038540040] |That is giving the warning messages that you see but I'm not sure that this is causing things to go badly wrong for you. [131038540050] |Nothing in those messages tells me that bacula-dir is not running. [131038540060] |If you installed bacula using the Ubuntu packaged version then you can find out if the director is running using [131038540070] |If you are just trialling things then I suggest that you start with the bacula-director-sqlite3 package. [131038540080] |That doesn't need a separate database setup so it is much easier to get going. [131038540090] |For production use you should use either the postgresql or mysql version. [131038540100] |Configuring a basic setup of bacula is fairly simple using the files installed by the Debian/Ubuntu packaging. [131038540110] |Look in /etc/bacula directory. [131038540120] |I'm not sure that bat actually allows configuration. [131038540130] |Once you have the director configured and started try your bat again (you need to make sure that /etc/bacula/bat.conf is configured too). [131038540140] |If it still doesn't work and you suspect the errors due to it being run via sudo then try copying the bat.conf file into your own account and start bat using [131038540150] |That should get rid of the permissions errors. [131038540160] |If you have general configuration problems then the best place to ask for help is on the bacula-users mailing list that can be found via www.bacula.org [131038550010] |Find the disk-space usage of a directory and all it's files [131038550020] |Possible Duplicate: How to know the size of a directory? [131038550030] |If I run [131038550040] |then any given directory is just shown as 4.0K. How can I can make it consider the files the directory refers to as well? [131038560010] |Use du -h and all directories and their subdirectories are being aggregated. [131038560020] |(The -h makes it human readable as in useful units like MB, GB or KB) [131038570010] |How to stop cursor from blinking [131038570020] |How to I make the cursor stop blinking when in TTY? ( or anywhere else ). [131038570030] |BONUS Points for one universal setting that stops the cursor blinking almost everywhere. [131038580010] |This gives you a solid yellow block (nonblinking) as a cursor: [131038580020] |For more info check these references: Linuxgazette and EmacsWiki as well as the file /usr/src/linux/Documentation/VGA-softcursor.txt (if present on your system) [131038590010] |Put [131038590020] |\033[?17;0;127c [131038590030] |to your PS1 variable and you'll stop blinking constantly. [131038590040] |E.G: [131038590050] |export PS1='\033[?17;0;127c\u:\w\$ ' [131038600010] |There is a standard control sequence to turn off cursor blinking on terminals. [131038600020] |However many terminals do not implement this setting, so read on. [131038600030] |There is a more widely implemented standard terminal setting for switching cursor visibility between high visibility, normal visibility and invisibility. [131038600040] |Some terminals don't make a difference between normal and high, and there's no guarantee that one or the other will or will not blink. [131038600050] |In terminfo, emit the cvvis, cnorm or civis string (e.g. tput cvvis). [131038600060] |The corresponding termcap entries are vs, ve and vi. [131038600070] |These setting will not survive a terminal reset, so you may find that it doesn't survive the launching of many full-screen applications. [131038600080] |You can overcome this difficulty by adding the cursor configuration changing sequence to your terminal's reset string. [131038600090] |
  • On a terminfo-based system using ncurses, save your terminal's terminfo settings to a file with infocmp >>~/etc/terminfo.txt. [131038600100] |Edit the description to change the rs1 (basic reset) sequence, e.g. replace rs1=\Ec by rs1=\Ec\E[?12l. [131038600110] |With some programs and settings, you may need to change the rs2 (full reset) as well. [131038600120] |Then compile the terminfo description with tic ~/etc/terminfo.txt (this writes under the directory $TERMINFO, or ~/.terminfo if unset).
  • [131038600130] |
  • On a termcap-based system, grab the termcap settings from your termcap database (typically /etc/termcap). Change the is (basic reset) and rs (full reset) sequences to append your settings, e.g. :is=\Ec\E[?12l:. [131038600140] |Set the TERMCAP environment variable to the edited value (beginning and ending with :).
  • [131038600150] |Some terminals and other applications give you more options: [131038600160] |
  • The xterm cursor blinks if the cursorBlink resource is set to true or the -bc option is passed on the command line. [131038600170] |The blink rate is customizable through the cursorOnTime and cursorOffTime resources.
  • [131038600180] |
  • Some other GUI terminal emulators can blink the cursor; check their configuration dialog box.
  • [131038600190] |
  • The Linux PC (VGA) console has a number of cursor settings; their exact meaning and applicability depends on the underlying VGA implementation (Linux framebuffer or video card). [131038600200] |If your default cursor blinks, try turning the hardware cursor off and the software cursor on with something like printf '\033[17;127?c' (the first parameter 17 gives you the software cursor without a hardware cursor, and the second parameter set to 127 makes it essentially inverse video). [131038600210] |See above regarding terminal resets.
  • [131038600220] |
  • In Emacs, M-x blink-cursor-mode toggles the cursor's blinking. [131038600230] |Put (blink-cursor-mode 0) in your ~/.emacs to turn it off. [131038600240] |This is a global setting and does not apply in a text terminal.
  • [131038600250] |See also Juri Linkov (Jurta)'s No Blinking page for how to turn off blinking in Lesstif, Tk, Gtk (Gnome), Qt (KDE), Firefox, and more. [131038610010] |apt-get - How to complain on failed upgrade? [131038610020] |I'm trying to write a script to upgrade a bunch of remote machines and would like to verify that one package in particular is upgraded. [131038610030] |With yum, I could say yum upgrade specific-package, and it would complain if it fails to upgrade the package. [131038610040] |With apt, as far as I know, I can only say apt-get upgrade, and if apt fails to find the new version or fails to resolve the dependencies for the new version, it will silently decide not to install it. [131038610050] |Is there any way to get apt-get to complain if it decides to not upgrade a package (short of scripting a call to dpkg --compare-versions)? [131038620010] |You can use apt-get install to do what you want. [131038620020] |The apt-get manpage says the following: [131038620030] |This is also the target to use if you want to upgrade one or more already-installed packages without upgrading every package you have on your system. [131038620040] |Unlike the "upgrade" target, which installs the newest version of all currently installed packages, "install" will install the newest version of only the package(s) specified. [131038620050] |Simply provide the name of the package(s) you wish to upgrade, and if a newer version is available, it (and its dependencies, as described above) will be downloaded and installed. [131038620060] |If you are wanting to install a known version of a package you can specify that on the commandline too. [131038630010] |How to merge all (text) files in a directory into one? [131038630020] |I've got 14 files all being parts of one text. [131038630030] |I'd like to merge them into one. [131038630040] |How to do that? [131038640010] |This is technically what cat ("concatenate") is supposed to do, even though most people just use it for outputting files to stdout. [131038640020] |If you give it multiple filenames it will output them all sequentially, and then you can redirect that into a new file; in the case of all files just use * (or /path/to/directory/* if you're not in the directory already) and your shell will expand it to all the filenames [131038650010] |What repositories do I need to install heartbeat and haproxy on RHEL? [131038650020] |So I am now managing two RHEL machines that I need to install haproxy and heartbeat on. [131038650030] |When I follow instructions to do so I get the following: [131038650040] |I imagine I just need to add some repository or other to some yum configuration file or other. [131038650050] |What is my best bet? [131038650060] |I've tried a few things I've found in Google so far; but they don't seem to help. [131038650070] |I'm new to RHEL I don't want to just spray packages in to my system on accident! [131038650080] |I miss Ubuntu server already... [131038660010] |http://fedoraproject.org/wiki/EPEL had them both. [131038660020] |You can add it like so: [131038670010] |How to pass parameter to alias? [131038670020] |For bash script, I can use $@. [131038670030] |What's the equivalent when I use alias? [131038680010] |You don't have to do anything, actually; aliases do this automatically. [131038680020] |For instance: [131038680030] |You will see foo.txt's first page, and less will quit at EOF (-e), searches will be case-insensitive (-i), etc. [131038690010] |Aliases are like commands in that all arguments to them are passed as arguments to the program they alias. [131038690020] |For instance, if you were to alias ls to ls -la, then typing ls foo bar would really execute ls -la foo bar on the command line. [131038690030] |If you want to have actual control over how the arguments are interpreted, then you could write a function like so: [131038700010] |When I schedule a command with 'at', can I change where the output is mailed to? [131038700020] |When I schedule a job/command with at to be executed in the future, the standard output and error of the command is "mailed" to the user that did the scheduling. [131038700030] |So after my job runs, I get a message in the command prompt [131038700040] |You have mail in /var/spool/mail/mattb [131038700050] |which I can then read with mail. [131038700060] |Is it possible to have the output instead sent to my corporate mailbox (i.e. mattb@company.com), rather than the local user's /var/spool/mail? [131038700070] |How does at know which address to email the output of the command, or does it only know how to place a message in the user's /var/spool/mail? [131038700080] |(I would tag this question at but I don't have enough rep on this SE site for that yet) [131038710010] |at will typically use your installed mail transport agent (MTA) to deliver the mail. [131038710020] |If you do not use local mail on the box at all, you can configure your MTA to forward all mail to another server. [131038710030] |Alternatively you can use a .forward file for a single user. [131038710040] |If you put "mattb@company.com" in ~mattb/.forward then your MTA should forward your email there. [131038720010] |What is this construct in bash? mycommand(){dosomething;} [131038720020] |I actually found following one-liner on commandfu.com: [131038720030] |cmdfu(){ curl "http://www.commandlinefu.com/commands/matching/$@/$(echo -n $@ | openssl base64)/plaintext"; } I have not come across a similar use of the () in bash before. [131038720040] |It seems that it creates the command cmdfu temporarily within the bash environment. [131038720050] |Am I correct here? [131038720060] |Or is it actually stored somewhere? [131038720070] |Is there a name for this construct so I can read up on it? [131038730010] |This is a shell function. [131038730020] |If you create it at the command line, it will exist only for the current shell invocation. [131038730030] |You can add the definition to a shell startup file (.bashrc, .bash_profile, etc) and it will make it "permanent". [131038730040] |If you search the bash(1) manpage for "Shell Function Definitions" you can see the syntax for defining shell functions. [131038730050] |The section "FUNCTIONS" goes into more details of functions themselves.