[131037190010] |
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] |/etc/NetworkManager/dispatcher.d
when an interface comes up or down.
[131037210030] |In particular, /etc/NetworkManager/dispatcher.d/01ifupdown
runs the ifupdown scripts./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] |/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] |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] |/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] |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.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] |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] |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] |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] |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] |sed
/awk
etc. would need to be checked as wellping
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] |#!
) is typically implemented:
[131037470060] |#!
.argv[1]
), and executes the interpreter./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] |#!
. Let's say the file descriptor for the executable is 3./dev/fd/3
the argument list (as argv[1]
), and executes the interpreter.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] |/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.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.#!/usr/bin/suidperl -wT
instead of #!/usr/bin/perl -wT
, but on most modern systems, #!/usr/bin/perl -wT
is sufficient.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] |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] |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] |man ls
, but did not find any such flag there.
[131037540070] |Also, ls -d
displays only a .
, nothing else.
[131037550010] |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] |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] |~/.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] |/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] |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] |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.1
and 2
( which are stdout and stderr ), what is the meaning and general use of those other "numbers"?command 1>&2 3>&1 2>&3
versus command 2>&3 3>&1 1>&2
63
on a typical Linux box.stdlog
, but it's rarely used (I believe I never saw one).man bash
REDIRECTION.open
and unlink
.
[131037690020] |A tutorial, written using the Python bindings, is available at the FUSE Wiki.
[131037700010] |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] |/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] |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] |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] |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] |+
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 --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] |apt-get install package-name
apt-get update; apt-get upgrade
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] |: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] |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] |/
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] |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] |lspci
that will display the idiosyncracies of my system setup... would that be lsmod
?)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] |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.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] |xwininfo -root -tree
[131038240020] |See the xwininfo man page for more information.
[131038250010] |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] |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] |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] |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 siteyum clean all
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] |-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] |!
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] |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] |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] |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] |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)./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 :
).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.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.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.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] |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] |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] |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] |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] |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.