[131074720010] |
preexec
function I found in my .zshrc
[131074730010] |Depends how things are set up, but by default, something like this should work.
[131074730020] |Then run:
[131074730030] |settitle NEWTITLE
.
[131074730040] |See screen title docs and GNU screen faq for more details.
[131074730050] |Given Ctrl+A A is only changing it until the next command, it's probably being set by $PS1
(all shells), or $PROMPT_COMMAND
/DEBUG trap
(bash only) or precmd
/preexec
(zsh only).
[131074730060] |You should look for any place that \e
or \033
appears with k
or \\
after it, basically like my settitle
example above.
[131074730070] |UPDATE
[131074730080] |You said you had a custom preexec
.
[131074730090] |Why not change it to this:
[131074730100] |Then you can set a custom title by running:
[131074730110] |and unset the title by running
[131074730120] |Don't forget to change precmd
and $PS1
as well if necessary.
[131074730130] |ASIDE
[131074730140] |You could even extend this to all terminals (e.g. xterm
, gnome-terminal
, etc.) by not hard coding the \ek
and \e\\
.
[131074730150] |This is how I do it:
[131074730160] |Then you can change your preexec
to:
[131074740010] |If your window title reflects the application currently running in the window, it's because your shell is doing that.
[131074740020] |If it's doing that, it's because your distribution, your system administrator or you configured it to.
[131074740030] |If the command appears as the window title while the command is running, this is done by the preexec
function (in zsh), or an emulation thereof under bash.
[131074740040] |If the title changes when each command completes, this is done by the precmd
function in zsh, the PROMPT_COMMAND
parameter in bash, or as part of the prompt (PS1
parameter) in any shell.
[131074740050] |(The command to change the title is an escape sequence emitted by any application as part of the terminal's output stream, so it can be embedded in a prompt.)
[131074740060] |Look for an escape sequence like \e]0;new title\a
, \e]2;new title\a
or \eknew title\e\\
in your shell initialization file (~/.bashrc
, ~/.zshrc
, …).
[131074740070] |If there's nothing relevant, the setting may be in a system file (e.g. /etc/bash.bashrc
, /etc/zsh/zshrc
); then overwrite that parameter or function in your own initialization file.
[131074740080] |See Mikel's answer for an overridable title setting in preexec
.
[131074750010] |find
, xargs
, and grep
(an example is at this page: How can I recursively grep through sub-directories?).
[131074750040] |However, my question is different: is there any single, built-in command that works through this magic, without having to write my shell script?
[131074760010] |No. find -name \*.h -print0 | xargs -0 grep -l 'the regex'
is as magic as it gets.
[131074770010] |GNU grep allows searching recursively through subdirectories:
[131074780010] |pvscan
activated the physical volume.
[131074780070] |Unfortunately, none of the existing volume groups on sdb were being listed.
[131074780080] |I then ran vgcreate data /dev/sdb
which I thought would either give errors reporting an existing volume group existed with this name or would somehow activate the data volume group.
[131074780090] |Unfortunately for me, neither of these things happened.
[131074780100] |At this point I haven't touched anything on /dev/sdb since I would like to recover the existing logical volumes that are defined on that drive.
[131074780110] |Is there anyway to reactivate those volumes?
[131074790010] |If you've somehow ended up with two volume groups with the same name, use vgrename
to rename one of them.
[131074790020] |In your situation the two volume groups should have distinct UUIDs, and you can pass a UUID to vgrename
to make sure it acts on the desired group.
[131074790030] |Now, if I understand your question correctly, you now have two volume groups, A (new) and B (old), and you have some logical volumes in B that you'd like to be in A. First run vgscan
and perhaps vgchange -ay
to make sure all your volume groups are active.
[131074790040] |Then run vgmerge
to merge the two volume groups into one, or vgsplit
to move some physical volumes from B to A.
[131074790050] |If this doesn't help, please post the output of pvs
, lvs
and vgdisplay
.
[131074800010] |If you had a backup of /etc/lvm/backup/data or perhaps even /etc/lvm/archive/data_* from before the reinstall it would help a great deal.
[131074800020] |You could use vgcfgrestore with the old config to rebuild the VG.
[131074800030] |At any point before the vgcreate, you could probably have run vgscan and "vgchange -a y" to activate data and get it running again.
[131074800040] |Now that you ran vgcreate, the options are more limited...
[131074800050] |I am assuming that vgs now shows an empty data VG.
[131074800060] |Another option, if you happen to know the exact layout of the volumes on /dev/sdb, it is possible to create LVs in those exact positions and sometimes mount filesystems that are there... but it's tricky and I wouldn't want to do it unless I had no other choice, because the PEs have to be used in the exact same order.
[131074810010] |.bashrc
file; for all users, check out pam_exec.
[131074820030] |If the users are coming in from sshd
, you'll want to check the /etc/pam.d/sshd
; other files depending on their source.
[131074830010] |there's another way which only influences users using ssh not local ones (which might be better in emergency situations)
[131074830020] |see the snippets from the ssh man page below.
[131074830030] |in this case the users can usually modify the files themselves (a bit like .bashrc)
[131074830040] |and this is global and not modifiable by the normal user
[131074830050] |HTH Marcel
[131074840010] |cat /path/to/script
must show the last script line above the next prompt, not next to it).
[131074850060] |¹ In a really good editor, such as Emacs, this doesn't apply to other kinds of files that may legitimately be not newline-terminated.
[131074860010] |~/.gtkrc-2.0
.
[131074880020] |Mine is
[131074880030] |and that makes various applications use the gnome icons.
[131074880040] |You can see a list of available icon themes in /usr/share/icons/
.
[131074890010] |geoiplookup
) in the geoip-bin
package.
[131074900030] |But it only shows country information, and uses a static (hence out-of-date) database.
[131074900040] |This tool can also query the MaxMind GeoIP database, if you have a subscription there.
[131074900050] |There are various GeoIP databases that you can look up.
[131074900060] |They're generally meant to be viewed through a web browser, but you can look for a scraping script.
[131074900070] |For example, here's a ruby script to retrieve data from the MaxMind database.
[131074900080] |Note that scraping may be against the database's terms of service.
[131074910010] |configure
-ed easily as well as what files are installed and a few other things.
[131074930030] |Gentoo is a ... upstream distribution.
[131074930040] |Meaning that it is not derived from another distribution (e.g. like Ubuntu is derived from Debian, and Debian is the 'upstream distribution').
[131074930050] |It has derived distributions that I'm aware of Sabayon and Funtoo.
[131074930060] |Sabayon is more release based, but can be converted to rolling.
[131074930070] |Funtoo is rolling.
[131074940010] |Debian's Testing and Unstable ('Sid') branches can both function as rolling releases.
[131074940020] |I've run Sid as my desktop for many years, with regular package upgrades, and had problems with it less frequently than I would have had to do release upgrades.
[131074940030] |The 'unstable' moniker refers to the fact that package versions come and go as the distribution developers upload them.
[131074940040] |The individual pieces are almost always stable upstream releases or release candidates.
[131074940050] |The Testing branch acts as the staging ground for the Stable release.
[131074940060] |Packages migrate into it from Unstable if they don't pick up any release-critical bug reports after a delay period of a few days.
[131074940070] |It's generally a little bit behind on the latest versions of software, but users can trust that at least the brown-paper-bag bugs have been flushed out.
[131074940080] |Note that many Debian Developers run one or the other of these on their primary systems.
[131074940090] |This generally means that they're careful not to introduce packages that will break things, because there's an expectation that the system as a whole will work after upgrading.
[131074940100] |It has actually also led to complaints that the Developers don't care enough about Stable releases actually happening, because they're generally not users of Stable.
[131074950010] |Gentoo and Arch provide full rolling releases, for every part of the system.
[131074950020] |Debian and openSUSE provide a stable base system, and for specific parts (e.g. KDE, X11, Firefox) you can add additional repositories which do have rolling releases.
[131074950030] |It allows you to keep a stable base system, and yet use the latest software you like.
[131074960010] |I posted a comment on DistroWatch suggesting a list rolling release distros.
[131074960020] |Let's start our own page on Wikipedia!
[131074960030] |They have a very small page for "Rolling Release" only.
[131074960040] |Let's start a page "List of Rolling Release Linux Distributions".
[131074960050] |I would be happy to help with such as I too have been trying to find a good guide to all rolling release distros.
[131074960060] |If you would be willing to help me do such either create the page &I will contribute to it or email my screen name at gmail if you like the idea.
[131074960070] |I will get myself a Wikipedia account so that I can contribute and help start the page.
[131074960080] |I would like to collaborate on the page though as I've only used Linux for a year or so &am still something of a newbie.
[131074960090] |PS In regards to the question, here's a short list; [?]=not-sure BTW:
[131074960100] |Arch based: Chakra; ArchBang; KahelOS; &Arch of course.
[131074960110] |Debian based: Aptosid [f.k.a. Sidux]; antiX; LMDE (Note: antiX &LMDE are based on Testing so "cycle" rather than "roll").
[131074960120] |Mandriva forks: PCLOS; Unity; Mageia[?]
[131074960130] |(Mageia is still discussing whether to roll).
[131074960140] |Gentoo base: Funtoo; Sabayon; Toorox*, Calculate[?]; &Gentoo of course.
[131074960150] |[*BTW I emailed the Toorox dev. &he said the Toroox wrapper is not rolling]
[131074960160] |Misc source based: Lunar; Sorcerer; SourceMage [described as a wrapper around LFS].
[131074960170] |Others: Yoper; Foresight; OpenSuSE-Tumbleweed.
[131074960180] |Also: Most dev. branches are "psuedo-rolling".
[131074960190] |Future: Debian &Fedora may at some point release a seperate rolling distro.
[131074960200] |There has been some slight talk on their dev.-wikis about this.
[131074960210] |With LMDE, OpenSuSE-Tumbleweed (and maybe Mageia), Debian &Fedora may decide to go ahead with such...
[131074970010] |MyComputer:~ me$
before all the commands.
[131074970030] |In some vidos I saw they have just $
- that's much less clutter, how is it done?
[131074980010] |This text is printed by your shell, and it's called a prompt.
[131074980020] |Your shell is probably bash.
[131074980030] |The prompt is set in bash's initialisation file, which is .bashrc
in your home directory.
[131074980040] |Specifically, the prompt is set by the PS1
variable.
[131074980050] |Its value can contain escape sequences that are replaced by some value when the prompt is displayed.
[131074980060] |For example, MyComputer:~ me$
results from a prompt setting like
[131074980070] |Try adding the following line at the end of your .bashrc
(create it if it doesn't exist):
[131074980080] |If this doesn't change anything, it's because you have a login shell and no proper .bash_profile
.
[131074980090] |See Difference between .bashrc and .bash_profile for an explanation.
[131074980100] |Short story: create a .bash_profile
containing
[131074990010] |/etc/sysctl.d
to disable IPv6 on the interface or all interfaces.
[131075020030] |I have enabled IPv6, but this is the file I used to disable IPv6.
[131075020040] |Initially, I disabled everything, then I disabled individual interfaces while I brought up IPv6.
[131075020050] |You should be able to just disable your bridge.
[131075030010] |/proc/bus/usb
).
[131075030030] |Maybe this can happen to other kinds of USB or other removable devices as well.
[131075030040] |This can happen for example:
[131075030050] |/dev
).
[131075040010] |It is sometimes possible to do a power cycle on branch of the USB bus where the device is plugged :
[131075040020] |The 1-1
should be adjusted to your configuration.
[131075040030] |You can see to which part of the USB tree your device is plugged by running lsusb -t
before ejecting it.
[131075040040] |You can find detailed information on the linux-usb mailing-list, this thread for example.
[131075050010] |I'm uncertain that I'm properly understanding your question, but on my system if a usb device is plugged in but not mounted I can 'see it' by
[131075050020] |$> fdisk -l
[131075050030] |That tells me what device it's associated with (i.e. /dev/sdd1 or something), then I manually mount it.
[131075060010] |cat
, ls
etc).
[131075060030] |I'm doing an ls -l
on a directory and there are thousands of files.
[131075060040] |I need to be able to pause the file list on the end of each page of results.
[131075060050] |Normally I would do this with ls -l|more
or even ls -l|less
but of course, more
and less
are not present on this phone.
[131075060060] |Are there any other low-level ways of making ls
paginate?
[131075060070] |My only other option is to write the output to a file and then tftp
it off the server and open it on a proper computer, but this is a very roundabout (and slow) method of doing it.
[131075070010] |If you are accessing the device through a terminal, you can use GNU Screen to connect; you can then use Screen's scrolling to see the output.
[131075070020] |If the system has vi installed, you can try outputting the command to a file and reading it with vi.
[131075070030] |If those don't suffice, you can make a bash script to output a screen's worth then pause.
[131075070040] |This prints 50 lines and waits for you to press enter before printing the next 50.
[131075080010] |/usr/share/xsessions
for a bunch of .desktop files, which tells it what application to execute to spawn the session.
[131075100030] |cat /usr/share/xsessions/awesomex.desktop
[131075100040] |On my machine, /usr/bin/awesomex
is a fully customised Xsession startup script that spawns awesomewm with a few of my own programs.
[131075100050] |The best part of this, is KDM remembers which session I used last time, and then re-uses it each time I log-in until I decide otherwise.
[131075100060] |( I believe other login-managers, perhaps GDM, also recognise these files, but not sure )
[131075110010] |cut
, head
, tail
, and friends will do the job; however, cut cannot easily deal with situations such as
[131075110040] |Here, the first comma is part of the first field, but cut -d, -f1
disagrees.
[131075110050] |Before I write a solution myself, I was wondering if anyone knew of a good tool that already exists for this job.
[131075110060] |It would have to, at the very least, be able to handle the example above and return a column from a CSV formatted file.
[131075110070] |Other desirable features include the ability to select columns based on the column names given in the first row, support for other quoting styles and support for tab-separated files.
[131075110080] |If you don't know of such a tool but have suggestions regarding implementing such a program in Bash, Perl, or Python, or other common scripting languages, I wouldn't mind such suggestions.
[131075120010] |Sounds like a job for Perl with Text::CSV
.
[131075120020] |See the documentation for how to handle column names.
[131075120030] |The separator and quoting style can be tuned with parameters to new
.
[131075120040] |See also Text::CSV::Separator
for separator guessing.
[131075130010] |You can use Python's csv
module.
[131075130020] |A simple example:
[131075140010] |Or, you could try some awk magic.
[131075140020] |Howewer, I'm not a good awk user and cannot confirm this would work properly, and how to do it.
[131075150010] |set -o vi
).
[131075150030] |Still I miss the Ctrl-A
shortcut from emacs mode, which is very handy.
[131075150040] |Many times I'm retrieving the last command and append an echo to the beginning of the line in order to save it to a file.
[131075150050] |Is there a convenient way to jump to the start of the line while in insert mode?
[131075150060] |And by convenient I mean that it's accessible by two sensible buttons shortcut.
[131075150070] |So Esc,I
is not good enough, because Esc
is too far, and Ctrl+[
,I
is not good because I need to type three consecutive letters, not sleek enough.
[131075160010] |Press the Home key if it's not too far.
[131075160020] |Or bind Ctrl+A:
[131075170010] |Many times I'm retrieving the last command and append an echo to the beginning of the line in order to save it to a file.
[131075170020] |An alternative is:
[131075180010] |timeout
is used with pipe, the execution time becomes the timeout threshold.
[131075180030] |The following example is done with debian package timeout, not the coreutils timeout, but the idea is the same.
[131075180040] |If we use timeout 5 sleep 1
, we expect this command finishes after 1 second, and it does.
[131075180050] |However, if we pipe the previous command, like grep
in this example, suddenly it takes 5 seconds to finish.
[131075180060] |I used htop to monitor the processes, and found that after 1 second, there is only grep
process there, not sleep
nor timeout
.
[131075180070] |If the process providing stdin for grep
is gone, grep
should know the pipe breakage and terminate, so I don't understand why this happens.
[131075180080] |I used strace to try to get more info about this anomaly, but couldn't understand the output.
[131075180090] |The wait4(-1, [{WIFEXITED(s) &&WEXITSTATUS(s) == 1}], 0, NULL) = 12762
line takes 4 seconds.
[131075190010] |Remove dot from your search path.
[131075190020] |In by debian6 it is: PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/opt/Eiffel66/studio/spec/linux-x86/bin
It should not be: PATH=.:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/opt/Eiffel66/studio/spec/linux-x86/bin
as this leads to your problem and security issues PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/opt/Eiffel66/studio/spec/linux-x86/bin:.
can also lead to problems, though you will have to run local scripts like this ./timeout
if you have a ~/bin, then add it to end of PATH, add ~/bin-override to beginning of path but don't put any thing in it (well not much).
[131075200010] |qt-config
(part of Qt) to set Qt options.
[131075210020] |KDE will use the Qt theme if you havn't set anything else, but you should be able to run kcontrol
and set a theme/fonts etc, if you want.
[131075210030] |GNOME saves its configuration in their little registry.
[131075210040] |KDE saves in the Qt .ini format, under ~/.kde/ somewhere - can't remember or dig it up at the moment.
[131075210050] |The GNOME and KDE enviroments rely on daemons running in the background.
[131075210060] |You can start the GNOME/KDE services yourself at login time, or just let them start when an application needs them. gnome-settings-daemon
is the GNOME one, I'm not sure if you need to start any KDE daemons except having dbus available.
[131075220010] |man 2 kill
):
[131075260030] |The only signals that can be sent to process ID 1, the init process, are those for which init has explicitly installed signal handlers.
[131075260040] |This is done to assure the system is not brought down accidentally.
[131075260050] |Pid 1 (init) can decide to allow itself to be killed, in which case the "kill" is basically a request for it to shut itself down.
[131075260060] |This is one possible way to implement the halt
command, though I'm not aware of any init
that does that.
[131075260070] |On a Mac, killing launchd
(its init analogue) with signal 15 (SIGTERM) will immediately reboot the system, without bothering to shut down running programs cleanly.
[131075260080] |Killing it with the uncatchable signal 9 (SIGKILL) does nothing, showing that Mac's kill()
semantics are the same as Linux's in this respect.
[131075260090] |At the moment, I don't have a Linux box handy that I'm willing to experiment with, so the question of what Linux's init
does with a SIGTERM will have to wait.
[131075260100] |And with init
replacement projects like Upstart and Systemd being popular these days, the answer could be variable.
[131075260110] |UPDATE: On Linux, init
explicitly ignores SIGTERM, so it does nothing. @jsbillings has information on what Upstart and Systemd do.
[131075270010] |Technically yes, root can issue a SIGKILL to init. init, however, differs from most, nearly all in fact, other processes in that it is permitted to trap and ignore the signal.
[131075270020] |You can, loosely, kill init by issuing a kill -TERM 1
which would be analogous to issuing a halt
or shutdown
in that init will pass the signal to all children, essentially all other processes, before honoring the signal itself.
[131075270030] |Please note: performing this command will shutdown your system.
[131075270040] |For flavor; one type of other process that can "ignore" a SIGKILL is one in uninterruptible sleep, such as one waiting for i/o.
[131075270050] |Such a process could be found by issuing a ps axo stat,comm
where processes with a status 'D' are uninterruptible.
[131075280010] |The SysV init ignores SIGKILL or SIGTERM signals.
[131075280020] |The only signal that causes a change in state is SIGPWR as far as I can tell, which schedules a power-related shutdown.
[131075280030] |It appears that Upstart and Systemd also do not respond to SIGKILL, and from my test, it appears that a SIGTERM causes upstart and systemd to re-exec.
[131075280040] |I'm not sure what the other answerers are running but I'm pretty sure you can't kill -9 (SIGKILL) or kill -15 (SIGTERM) init (pid 1).
[131075280050] |Most likely, if you were able to, you'd get a kernel panic because init unexpectedly exited with a non-zero exit code, which would be less than ideal.
[131075280060] |It doesn't shut down your computer, or cause it to reboot.
[131075290010] |You can restart the init
process.
[131075290020] |This is useful for making changes to inittab
without having to reboot.
[131075290030] |Source: http://www.cyberciti.biz/faq/linux-unix-kill-hup-1-reread-etcinittab-file/
[131075300010] |umask
which sets the file mode creation mask, either for the current instance (without subshells), or for every newly invoked shell (over .bash_profile, .bashrc, etc.).
[131075330020] |Show the currently set mask in octal or symbolic form:
[131075330030] |The octal numbers indicate the values which are getting removed from the full access:
[131075340010] |jpeg
to become jpg
.
[131075350010] |You can use ${parameter/pattern/string}
to search/replace and ${parameter,,pattern}
to convert to lowercase.
[131075360010] |Try something like
[131075360020] |or for fixed length file names.
[131075360030] |c
[131075370010] |Two steps:
[131075370020] |convert extensions:
[131075370030] |number files:
[131075380010] |If you have (p)rename, you can write this:
[131075390010] |adduser
, useradd
, usermod
, gpasswd
, and perhaps others I've forgotten.
[131075390040] |I've also heard a couple times that some of these programs are low-level and should be avoided for general use, but I can never remember which.
[131075390050] |So I'd like to get a definitive answer for which programs are the recommended ones for at least the following tasks:
[131075390060] |adduser
and deluser
are higher-level wrappers around useradd
and related functionality.
[131075410020] |The cover user creation, group membership addition and subtraction, and user deletion.
[131075410030] |The corresponding commands from making/deleting groups are, sensibly enough, addgroup
and delgroup
. usermod
appears to cover the remaining use case you name.
[131075420010] |In many situations, knowing how to edit "/etc/passwd" is still useful.
[131075430010] |You mention Linux in the last part of your question, but since the title is generic I'll answer for FreeBSD.
[131075430020] |FreeBSD has similar commands as Linux but they are commands passed to the pw
utility:
[131075430030] |and so on.
[131075430040] |However, one can parse the command into two parts: user
and mod
; a noun and a verb.
[131075430050] |Moreover, one can also use group
and del
:
[131075430060] |to, for example, delete a group.
[131075430070] |So here's what I think is really cool: the order doesn't matter, nor does the spacing!
[131075430080] |What this means, is that you can remember what to call by thinking about what you want to do (in English anyway):
[131075430090] |and more!
[131075430100] |The pw
utility also lets you lock and unlock accounts:
[131075430110] |Options and any parameters that you pass are all standardized (although don't always apply to call commands) so memorization is minimized.
[131075430120] |All in all a nice way to do things.
[131075430130] |Note: the ellipses in the above examples represent options and paramters passed to pw
not additional users or groups.
[131075440010] |All of these tools are ultimately built to edit text files for you.
[131075440020] |If you want to know how to manage users and groups over systems, you should get familiar with these underlying text files.
[131075440030] |Lucky for you, there's just two of them, /etc/passwd
and /etc/group
.
[131075440040] |There are also complementary /etc/shadow
and /etc/gshadow
files for shadowing passwd and group respectively.
[131075450010] |Just for completeness, in the low-level end of the spectrum I'd mention vipw(8) and vigr(8), just above "vi /etc/passwd" and "cat >/etc/passwd" but right below "useradd".
[131075450020] |Oh, and they exist in most Unix variants.
[131075460010] |If your question was limited to
[131075460020] |any Linux system (of any distribution)
[131075460030] |but all of the systems have network access to a single server.
[131075460040] |You could use something like NIS or YP.
[131075460050] |So this answer is limited to admins within a single organization.
[131075460060] |You still have the issue where almost every distribution has slightly different ways to configure YP, but configuration only happens once.
[131075460070] |Also, this type of network is not trivial.
[131075460080] |Within a single site/network you will gain a lot doing this.
[131075460090] |In combination with automount, my favorite is being able to SSH to any *nix machine and have all my home files and tools available to me.
[131075460100] |To the point, the distribution you choose for the master is the system you use for managing users.
[131075460110] |You then will have a single set of tools/documentation to manage users and groups.
[131075460120] |It is even possible to use something like LDAP and samba tools on the master.
[131075460130] |Using samba also allows me to have my home files available to me on windows machines.
[131075470010] |If you are using a backend other than the default local machine backend - OpenLDAP being the most common - then cpu (change password utility) might be the command you are looking for.
[131075470020] |It can be run on machines other than the LDAP master if configured correctly, and it's syntax is mostly just the same as useradd
etc with a prefix of cpu
.
[131075470030] |So to add myself I could do
[131075470040] |See the cpu man page for more details.
[131075480010] |The closest thing to a standard you'll get is vi /etc/passwd
, vi /etc/shadow
, and vi /etc/groups
.
[131075480020] |(Heretics may substitute emacs
.)
[131075480030] |Everything since then that I've found will only work on some systems.
[131075480040] |Seriously, find out what tools your OS has, and use them.
[131075480050] |Just don't expect them to work the same on all systems.
[131075480060] |It would be nice if they were standardized, but they aren't.
[131075490010] |vi
, if you issue the command :sp
, the screen splits into two "views", allowing you to edit more than one file from the same terminal.
[131075490030] |Along those same lines, is there a way to have multiple shells open in the same terminal?
[131075500010] |You can do it in screen
the terminal multiplexer.
[131075500020] |title
option.
[131075530020] |This works out of the box for me in xterm and the like but not in screen.
[131075530030] |This tip works:
[131075530040] |A different approach is to write a preexec
function in your shell that sets the window title to the command being run.
[131075530050] |Zsh supports preexec
natively, and bash can do it too.
[131075530060] |Here's a zsh example.
[131075540010] |echo 0 >/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
- as root.
[131075560020] |You may need to also use the -b
option with ping and it will most likely require root permissions.
[131075570010] |/dev/null
and 2>&1
means to redirect the error output in the same place where the output is sent.
[131075570050] |My problem is I always have to google it because I never remember it.
[131075570060] |So, I try &2>1
, 1>2&
, 1>&2
...
[131075570070] |I try every combinaison until I google it...
[131075570080] |What's the trick to remember it easily ?
[131075580010] |Output is better than error so it comes first (1 vs 2).
[131075580020] |>
is shorthand for 'goes to'.
[131075580030] |On the left is what I want to send and on the right is where I want to send it.
[131075580040] |Since 'where' is (almost) always a file, something like
[131075580050] |would redirect to a file named 1.
[131075580060] |Thus, the ampersand modifies the file to file descriptor.
[131075580070] |Unfortunately, I haven't come across nor developed my own mnemonic, but when I was first learning *nix, I found this logical way to work well.
[131075580080] |After a few run-throughs, it becomes second nature.
[131075590010] |Actually, it depends on what shell you're using.
[131075590020] |Bash is usually very forgiving and you can just do:
[131075600010] |Seeing the &
as a knot might help : think about what you want to do as taking the output of 2, so 2>
, and tying it together with 1, so 2>&1
[131075610010] |Draw it in your wallpaper :)
[131075610020] |Now, seriously, this and other basic stuff I kept forgetting, so I added a quick tips menu to an app I developed and that I use daily.
[131075610030] |You might want to give it a try or use something like gnote to keep a note.
[131075620010] |Box A
on to Box B
and Box C
.
[131075620030] |However, I need those files to not be transferred from Box A
upon every access request; basically, I need the files cached locally, and only updated when "pushed" from Box A
.
[131075620040] |Any suggestions?
[131075630010] |Can you run rsync on Box A whenever you need to push the files to the other 2 boxes?
[131075630020] |Something like:
[131075630030] |rsync will only copy changed files as required.
[131075630040] |If you need to automate the push, you could always use cron to start the rsyncs.
[131075640010] |You might benefit from using NFS and CacheFS.
[131075640020] |It should be available on most modern Linux distros.
[131075650010] |You can serve the files over FTP, HTTP(S) or SFTP, and access them through LftpFS.
[131075650020] |where /etc/local/A.ftp
contains something like
[131075660010] |setfont
to change your font, and showconsolefont
to see what it looks like.
[131075670030] |Each distro has it's own way of setting the default console font.
[131075670040] |Read the setfont
man page for the location of the console fonts.
[131075670050] |For my Fedora 14 system, it's /lib/kbd/consolefonts/.
[131075670060] |Console fonts are a file format that define EGA/VGA console fonts.
[131075670070] |X Fonts are a different format than console fonts.
[131075670080] |They are typically handled by definitions in your X config (with FontPath in the Files section), or through a Font server (xfs), which is also set in the Files section with FontPath.
[131075670090] |You can also add FontPaths by running xset +fp path
.
[131075670100] |My system has all it's X fonts in /usr/share/X11/fonts.
[131075680010] |There are two mechanisms for fonts in X land: server-side and client-side.
[131075680020] |The traditional way to render fonts is for the client to tell the server “render foo
at position (x,y) in font F” (where a font specification includes a face, size, encoding and other attributes).
[131075680030] |Either the X server itself, or a specialized program called a font server, opens the font file to build the description of each glyph.
[131075680040] |The fonts can be bitmap or vector fonts, but the vector fonts are converted to bitmaps before rendering.
[131075680050] |Most modern programs use client-side font rendering, often through xft and fontconfig.
[131075680060] |A new mechanism was needed because the server-side font rendering didn't support anti-aliasing.
[131075680070] |Outside X (i.e. on a VGA console), there are VGA fonts, which are bitmap fonts of specific sizes.
[131075680080] |But compared to X11, no one uses the VGA console, so not much effort is spent on them.
[131075680090] |In practice, you'll want to configure fonts in two ways:
[131075680100] |FontPath
directives in xorg.conf
and can be manipulated with xset fp
commands by the user running X. If you install new fonts, you may need to run mkfontdir
.
directives in /etc/fonts/fonts.conf
, ~/.fonts.conf
and a few other places.
[131075680120] |See the fontconfig documentation for more information.
[131075680130] |If you install new fonts, you may need to run fc-cache
..r00
to .r30
.
[131075710030] |It also has one file with .rar
extension.
[131075710040] |From all of this must come a video file.
[131075710050] |How do I do it?
[131075720010] |You can use the unrar
program.
[131075720020] |From how-to-open-a-rar-file-in-linux:
[131075720030] |If you need to uncompress a .rar archive in Linux, you can download a program called unrar.
[131075720040] |If you are using Ubuntu or Debian, you can install unrar by opening a terminal and typing sudo apt-get install unrar.
[131075720050] |Then read the instructions by typing man unrar.
[131075720060] |[UPDATE: to install unrar in Ubuntu you need the Multiverse Repository enabled.]
[131075720070] |Basically, to unrar a file in Linux, just navigate to the directory where your rar archive is and type unrar x [filename.rar], replacing [filename.rar] with the name of your rar archive.
[131075720080] |For a series of files, you should be able to just specify the one with the .rar
extension.
[131075720090] |Update - this is confirmed by wikihow:
[131075720100] |If a RAR file is broken into smaller files, they are named .rar, .r00, .r01 and so on.
[131075720110] |Point your unrar utility at the .rar file and it will automatically put the pieces back together.
[131075730010] |If you only have rar
program, the command x
would accomplish the task:
[131075730020] |The program automatically searches for the appropriate parts of the archive.
[131075730030] |Note: sometimes the naming can be .part##.rar
.
[131075740010] |en_US.UTF-8
is defined in /usr/share/X11/locale/en_US.UTF-8/Compose
ISO 8859-1
is defined in /usr/share/X11/locale/iso8859-1/Compose
grep
, you can see there is a difference:
[131075870090] |Namely:
[131075870100] |ç
ć
/usr/share/X11/xkb/symbols/us
.
[131075870140] |Namely, the US Alternative International layout adds these extra AltGr dead keys:
[131075870150] |¥
ā
~/.kde4/share/config/plasma-desktop-appletsrc
.
[131075910020] |I have tried moving the panel and deleting the file does restore the default settings.
[131075910030] |If that doesn't work you can try looking for the correct config file and delete it.
[131075910040] |Well-behaved applications should recreate the file with default settings.
[131075910050] |If you don't mind losing customized settings, a sure-to-work way is to remove the KDE settings folder ~/.kde
.
[131075920010] |(global-linum-mode 1)
, and it works until I start enlarging the text via text-scale-adjust
[131075950030] |The line numbers column starts to shrink, and disappears entirely after a few increments.
[131075950040] |When it has fully disappeared, further increments have no more effect on the left edge.
[131075950050] |Is this a know issue?
[131075950060] |Is there a workaround?
[131075950070] |Using GNU Emacs 23.1.1 in Ubuntu 10.04 (and I'm an emacs newb).
[131075960010] |rdesktop
under the hood.
[131075970020] |I'd encourage you to play with the settings of rdesktop, I myself have used it without any speed issues.
[131075970030] |It's very possible that your windows RDP connection uses different options, espescially the -x
paramter to rdesktop:
[131075980010] |I cannot comment on performance/speed of various RDP clients.
[131075980020] |However I recently came across the FreeRDP project that describes itself as follows
[131075980030] |FreeRDP is a fork of the rdesktop project that intends to rapidly start moving forward and implement features that rdesktop lacks the most.
[131075980040] |I have not use KRDC but I have used both rdesktop and xfreerdp clients from the commandline on Ubuntu 10.10 and they are both usable. xfreerdp accepts the same -x option as @gnud mentions and that option is likely to make the biggest difference in performance.
[131075990010] |I've taken to using Remmina lately.
[131075990020] |I use it mostly because it manages a list of hosts and their settings quite nicely, and can set up an SSH tunnel automatically.
[131075990030] |It does VNC too.
[131075990040] |I haven't had performance problems with RDP in general though, and haven't used KRDC, so I couldn't say it would necessarily be any different from that point of view.
[131075990050] |I don't know if Remmina is available in CentOS's repository.
[131076000010] |OK, we find the problem :)
[131076000020] |It seems that rdp client have some trouble with win7, so we try KRDC on others OS (centos, ubuntu and XP) and it work great...
[131076000030] |Conclusion: The problem is not in RDP Client, but on the system on which we want to connect...
[131076000040] |Thanks for your answers!
[131076010010] |bzip2 ::: *fastq
and ls *fastq|parallel bzip2 {}
in parallel.
[131076020020] |Any compelling reason you don't just open up two terminal windows and run them each in their own window?
[131076030010] |Your first try is closest to being correct, but why the :::
?
[131076030020] |If you change :::
to --
, it will do what you want.
[131076030030] |parallel
has a specific, unusual structure to its command line.
[131076030040] |In the first half, you give it the command you want to run multiple times, and the part of the command line that will be the same every time.
[131076030050] |In the second half, you give it the parts that will be different each time the command is run.
[131076030060] |These halves are separated by --
.
[131076030070] |Some experimentation shows that if parallel
doesn't find the second half, it doesn't actually run any commands.
[131076030080] |It's probably worth re-reading the man page carefully.
[131076030090] |Man pages have a terse, information-dense style that can take some getting used to.
[131076030100] |Also try reading some pages for commands you're already familiar with.
[131076040010] |sudo reboot
, the system uses kexec and loads the 2.6.28-19-generic kernel, which is also intalled on the machine.
[131076040050] |So how can I specify which kernel image to load after reboot?
[131076040060] |EDIT: I have ubuntu 9.04 installed on the machine, with grub 1.something.
[131076040070] |The custom kernel is based on the 2.6.28 source with the name being 2.6.28.10-custom-1.1.
[131076040080] |Two other kernels are installed on the machine 2.6.28-19-generic and 2.6.28-6-386.
[131076040090] |I have checked that after calling reboot, the machine does not actually reboot but uses kexec to load the 19-generic kernel, even if the current kernel was the custom one.
[131076050010] |Normally, when you reboot, the machine will return to grub and either allow you to select a kernel via the keyboard, or boot the default configured kernel.
[131076050020] |However if you have kexec-tools installed, the reboot command will short circuit this behaviour and directly kexec into a kernel.
[131076050030] |You can disable this behaviour, and return to grub in reboot, by uninstalling kexec tools or editing the file
[131076050040] |and setting:
[131076050050] |Alternatively, to keep kexec active and have it reboot into the kernel of your choice, try a command line like this to load your desired kernel:
[131076050060] |then when 'kexec -e' is later run, the configured kernel in the kexec line as well will be run.
[131076050070] |As I believe the reboot script eventually just calls 'kexec-e' I believe the kernel change should take effect then.
[131076060010] |I found a pretty nifty post here.
[131076060020] |It contains a script to call kexec manually.
[131076060030] |Reposting script here:
[131076070010] |/var/log/boot.log
should contain this information.
[131076120020] |If the system has been online for awhile, the information may be moved into another boot.log.* file in the same directory.
[131076120030] |Also, you can check /var/log/messages
for any other messages that may have been generated during system startup.
[131076130010] |cd $(uname -i)
, but want something simpler.
[131076170010] |symlink is essentially a file with special flag which contains some path, and this path interpreted as is, so you can not make one symlink to point to other locations in that way.
[131076170020] |But you still may write script that will run apropriate build.
[131076180010] |If you just want a simpler syntax to type than:
[131076180020] |You could put it in a variable like:
[131076180030] |in your login script, so you can just do
[131076180040] |When you want to cd
[131076190010] |Symbolic links are static: the filesystem just stores a string, and accesses to the symbolic link are redirected to the file whose name (relative to the location of the symlink) is that string.
[131076190020] |It would be simple to write a FUSE filesystem exposing such dynamic symlinks, but I don't know of an existing one.
[131076200010] |I assume this is binaries, so I would do it with a PATH variable rater than symlink.
[131076200020] |PATH=$PATH:/base/$ARCH/bin
.
[131076200030] |If you are using a tool like cfengine or puppet.
[131076200040] |A symlink to the appropriate directory can be created based on the system architecture.
[131076210010] |This feature is supported by DragonFly BSD, where it is called variant symlinks.
[131076210020] |See man varsym
and man ln
for details.
[131076220010] |ls
).
[131076220040] |Smart complete works fine as root, but I want to enable it for my user.
[131076230010] |Does doing . /etc/bash_completion
as your user enable completion?
[131076230020] |If so, you can put it in your ~/.bash_profile
file so that it gets run when you login.
[131076240010] |Setting set disable-completion On
in /etc/inputrc (or ~/.inputrc) will disable readline's autocomplete.
[131076240020] |That would cause the Tab key to just tab.
[131076240030] |Possibly having a shell other than bash could cause autocomplete to not work.
[131076250010] |gnome-volume-control
:
[131076320030] |the volume can be adjusted at will.
[131076320040] |When using the keyboard volume-up and volume-down function keys the volume may be lowered at will but raising the volume is limited to the "Unamplified 100%" level.
[131076320050] |Is there a way around this limitation?
[131076320060] |Linux road 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 21:21:01 UTC 2011 i686 GNU/Linux
[131076330010] |Currently, I don't think there is any way around this.
[131076330020] |It seems like the integration between the pulseaudio and gnome-media volume settings is still problematic.
[131076330030] |See for example:
[131076330040] |Unix
is actually a trademark name that refers to System V Unix.
[131076350020] |So "legally" it is not Unix.
[131076350030] |But it is related and "looks" like Unix, so it is often called Unix, or Unix-like. http://en.wikipedia.org/wiki/Unix
[131076360010] |It all come down to whether you are speaking legally, or from a technology viewpoint.
[131076360020] |Legally, FreeBSD, like Linux, cannot use the trademarked term Unix.
[131076360030] |From a technology point of view, FreeBSD is as much Unix as Solaris, HP-UX, or any of the other commercial versions that have paid to be able to be legally called Unix.
[131076370010] |ls | grep pattern -
.
[131076370030] |In this case, I think I could do find pattern -exec java MyProg '{}' \;
but I'm curious about the general case - is there an easy way to say "run a command once for every line of standard input"?
[131076370040] |(In fish or bash.)
[131076380010] |That's what xargs
does.
[131076390010] |In Bash or any other Bourne-style shell (ash, ksh, zsh, …):
[131076390020] |read -r
reads a single line from standard input (read
without -r
interprets backslashes, you don't want that).
[131076390030] |Thus you can do either of the following:
[131076400010] |I agree with Keith, xargs is the most general tool for the job.
[131076400020] |I usually use a 3 step approach.
[131076400030] |vim
, and mangle it with search and replace expressions until I get a list of full commands that need to get executed, like this:
[131076410040] |This way if your regex is incomplete, you will see in what command will have potential problems (ie. /bin/rm -fr johnnyo connor
).
[131076410050] |This way you can undo your regex, and try it again with a more reliable version of it.
[131076410060] |Name mangling is notorious for this, because it's hard to take care of all the edge cases like Van Gogh, O'Connors, St. Clair, Smith-Wesson.
[131076410070] |Having set hlsearch
is useful for doing this in vim
, as it will highlight all the matches, so you can easily spot if it doesn't match, or matches in an unintended way.
[131076410080] |Once your regex is perfect and it catches all the cases you can test for/think of, then I usually convert it to a sed expression so it can be fully automated for another run.
[131076410090] |For cases where the number of lines of input prevents you from doing a visual inspection, I highly recommend echoing the command to the screen (or better yet, a log) before it executes, so if it errors out, you know exactly which command caused it to fail.
[131076410100] |Then you can go back to your original regex and adjust once more.
[131076420010] |GNU Parallel is made for that kind of tasks.
[131076420020] |The simplest usage is:
[131076420030] |Watch the intro video to learn more: http://www.youtube.com/watch?v=OpaiGYxkSuQ
[131076430010] |stat %W
can show it to you.
[131076450010] |mplayer
with higher priority than any other processes, including the IO-processes.
[131076450030] |How can I do that?
[131076460010] |To set niceness (CPU bound) use nice
. To set IO niceness (IO bound) use ionice
.
[131076460020] |Refer to the respective man pages for more information.
[131076460030] |You can use them together as follow:
[131076460040] |Note: the lowest level of niceness (lower means more favorable) you can define is determined by limits.conf
.
[131076460050] |On my computer the file is located at /etc/security/limits.conf
.
[131076470010] |In general, as a non-root user, you can only decrease the priority of your tasks, not increase them.
[131076470020] |So, one approach would be to lower the priority of everything else.
[131076470030] |Or, you can set up something at the system level which handles your priorities.
[131076470040] |If you're using a relatively modern Linux distribution, the most powerful way would be with control groups.
[131076470050] |This is in its infancy so basically you'd have to configure everything by hand, but in short what you want is to configure the categorizer to put different processes into different CPU control groups, and then to give the mplayer process more CPU shares.
[131076480010] |apt-get remove mono-common
but I'm tripping up at that first hurdle!
[131076480050] |Thanks a lot
[131076490010] |You're trying to build mono-2.4 yourself?
[131076490020] |This article seems heavily outdated.
[131076490030] |On Ubuntu Maverick (10.10):
[131076490040] |should get you mono-2.6.7
[131076500010] |