[131029080010] |How do I share applications windows between OS X and Linux? [131029080020] |I originally asked this question over on Super User, but I didn't get any answers. [131029080030] |I'm trying to set up Xdmx on my Macbook Pro and my Ubuntu 10.04 workstation so that I can share my MBP's keyboard and mouse as well as X applications running on the workstation across the laptop display, a laptop attached monitor, and the workstation's monitor. [131029080040] |
  • Where do I find the latest Xdmx? [131029080050] |The Sourceforge site says that the code there is unmaintained and the project has been merged into Xserver. [131029080060] |I can't find an up to date source or binary distribution.
  • [131029080070] |
  • How do I install it? [131029080080] |Is there a package file? [131029080090] |Do I have to build from source?
  • [131029080100] |
  • Are there other options for accomplishing what I've described above?
  • [131029090010] |It turns out that trying to run Xdmx from the Mac was the wrong approach. [131029090020] |Instead I ran it from the linux workstation. [131029090030] |The steps to accomplish this are something like the following: [131029090040] |
  • Install xpra on both systems.
  • [131029090050] |
  • Start xpra on the Linux workstation and attach to it from the MBP (instructions in the above link).
  • [131029090060] |
  • Start one Xephyr window on the workstation: [131029090070] |Xephyr :101 &
  • [131029090080] |
  • Start another on the MBP via Xpra [131029090090] |DISPLAY=:13 Xephyr :101 &
  • [131029090100] |
  • Finally, start Xdmx as described here [131029090110] |Xdmx -configfile xdmx.conf -config clone_config +xinerama -input :100 -input :101 :102&
  • [131029090120] |At this point, apps started on DISPLAY=:102 will show up on both systems, but its not really usable at this point. [131029090130] |Note that the commands in #3, 4, and 5 are all run on the workstation. [131029100010] |Portable encrypted container [131029100020] |I want to store some data encrypted to carry around with me (this includes some scans of relevant paperwork, my TAN List for online banking, my gnupg and ssh keys and stuff like that). [131029100030] |So not really a huge amount of data but also more than a little textfile. [131029100040] |What I want is a container I can put on my thumbdrive to carry things around in that is fully encrypted. [131029100050] |A few more requirements: [131029100060] |
  • Strong Encryption, so no ZIP with passwords
  • [131029100070] |
  • I want to sync the container to more than one location (in case the thumbdrive breaks or is stolen for example) so I cannot just create another dmcrypt partition on the thumbdrive
  • [131029100080] |
  • I want to open the container from my GNOME environment without a lot of terminal fiddling. [131029100090] |Not that I don't like terminals, but I want a certain level of convenience. [131029100100] |(Right-clicking in nautilus to "mount" is OK, entering 3 commands in a terminal is not)
  • [131029100110] |
  • Bonus: Something I can open from Windows and/or OSX as well
  • [131029110010] |Give a look to lastpass.com, it is browser based but you can export your vault to various password manager formats, and even in the browser is all client based (your password is not sent to the server, but the data is retrieved encrypted and decrypted in your browser). [131029110020] |It does Firefox, Chrome and others so it is multiplatform, and it syncs the vault automatically across the computers where you are logged in to the vault with the master password. [131029110030] |It does automatic form filling too, and you can store notes as well. [131029120010] |Truecrypt ticks all of those boxes. [131029120020] |You have the option of either encrypting the whole USB key, or just having an encrypted container (as a file) [131029120030] |It can then be decrypted regardless of platform, and can be configured to automount. [131029130010] |I want to sync the container to more than one location (in case the thumbdrive breaks or is stolen for example) so I cannot just create another dmcrypt partition on the thumbdrive [131029130020] |This requirement doesn't have to conflict with dm-crypt. [131029130030] |You can create an encrypted file system inside a file like this: [131029130040] |I want to open the container from my GNOME environment without a lot of terminal fiddling. [131029130050] |Not that I don't like terminals, but I want a certain level of convenience. [131029130060] |(Right-clicking in nautilus to "mount" is OK, entering 3 commands in a terminal is not [131029130070] |You could create a mount and unmount script once, and then run those by clicking them. [131029130080] |These scripts could be stored next to the encrypted file. [131029140010] |Starting firefox on a remote host (over ssh) opens a new window locally: what is happening? [131029140020] |I have never noticed this behaviour before, and am a little confused as to what is happening. [131029140030] |I have a local copy of firefox running, then ssh (ssh -X ) into a remote server and start a copy there to use the local display. [131029140040] |Turns out the local firefox just opened a new window. [131029140050] |I verified with ps x|grep firefox that indeed no firefox process is started on the remote server. [131029140060] |This same strange behaviour happens in reverse, if I have a remote firefox running and try to start a local one, then the remote one opens a new window. [131029140070] |I am on ubuntu 10.4, with a nearly completely fresh install (I just got this computer this afternoon). [131029140080] |I was trying to have the two firefoxes running at the same time so that I could easily run down the list of plugins to install. [131029140090] |What is happening here, and how can I avoid it from happening? [131029140100] |best, Bart (who is really rather confused about this) [131029150010] |Has been an issue with firefox for quite a while, try running firefox as firefox -no-remote (setting MOZ_NO_REMOTE=1 as environment variable should work as well). [131029150020] |Here's more info [131029160010] |If I had to make an educated guess about what's going on here, I'd say that firefox first looks for an open firefox window before launching, and if that exists sends it a message using X to just start a new browser window. [131029160020] |Because the remote system is using your local display, whatever it uses for detection is picking up the local window. [131029160030] |(This would also explain why the remote window is found when you're starting a local firefox process.) [131029160040] |You can test this by closing all local firefox windows, and then trying to start firefox on the remote server - if the detection is happening like I think it is, there won't be any running windows for it to latch on to, so it'll start an instance on the remote system like you expect. [131029160050] |As far as actually fixing the issue, tante's suggestion to set MOZ_NO_REMOTE is the proper solution. [131029170010] |Can you recommed a discrete simulation modelling system (like GPSS or Rockwell Arena) for Linux? [131029170020] |Do you know of a tool for discrete processes (those like production, logistics, client queue service (retail, call center etc.) etc.)) simulation modelling? [131029170030] |I am familiar with 2 of such applications for Windows: Rockwell Arena and GPSS World. [131029170040] |Are there any free alternatives for Linux? [131029170050] |Maybe even standard (BEPL/UML/IDEF0/2/3) aware? [131029180010] |You might want to look at SimPy. [131029180020] |I haven't used SimPy in maybe 4 years, but I think it could do what you want. [131029180030] |It may be a bit more basic, not including all the bells and whistles that your Windows software does. [131029190010] |Could you share a link to a good catalogue of Linux distros to choose? [131029190020] |Possible Duplicate: How do you choose a distribution? [131029190030] |I'd like to see a list of all the Linux distros by their mission (like generic, firewall, mail server, free-only, enterprise, virtual machines host, virtual machine guest, audio production, etc.) with basic description and analytics (like first release date, package management system, development activity, people behind the distro (like core team size or, for example "Canonical corporation" for Ubuntu) release cycle description, popularity, etc.). [131029190040] |Where can I find such a catalogue? [131029190050] |I've tried distrowatch.com, but couldn't find any classification there. [131029190060] |I'd like to be able, for example, to see "all the distros meant specially for a firewall (or a LAMP server) deployment", or "all the distros available as LiveCDs" etc. [131029200010] |How to set up Kate to use Nautilus as a file manager? [131029200020] |I use Gnome-based Ubuntu 10.10 and Kate text editor. [131029200030] |If I right-click on a folder in Kate's file system navigation panel and choose to open the folder in a file manager, Filelight (a disk space occupation diagramming tool) pops up (which is far from what was intended). [131029200040] |Can I set up Kate to open Nautilus in such a case? [131029210010] |How much of KDE do you have installed? [131029210020] |If you have the systemsettings tool, you could use it to change the application associated to folder. [131029210030] |My guess is that there is filelight there at the moment and you want nautilus instead. [131029210040] |If you don't have systemsettings, you might try something along the lines [131029210050] |to find where the setting to use filelight is stored and change it manually. [131029220010] |Auto mount HP USB Flash drive Error [131029220020] |I am using RHEL 5, If i plug my USB Flash drive i'm getting Error message as follows, [131029220030] |This much days It work smoothly, And now it working with windows XP well. [131029220040] |Where is the problem ? [131029220050] |How can i solve it ? [131029230010] |Problem may be in file system formatting. [131029230020] |Format pen drive with FAT32 file system in windows. [131029230030] |After that it'll work properly. [131029240010] |What is the difference between modify and change in stat command context? [131029240020] |The stat command's manual page says: [131029240030] |I am unable to understand what is the difference between modify and change. [131029240040] |What I understand both are synonyms (English is not my mother tongue), but the out of both is different. [131029240050] |I tried following command [131029240060] |Now when I open p.txt, access time is changed, I go into insert mode, edit the file, modify and change time remains same. [131029240070] |Change 2010-10-06 12:48:39.286252389 +0500 Access 2010-10-06 12:49:14.962243456 +0500 Modify 2010-10-06 12:48:39.234498878 +0500 [131029240080] |When I write the changes to file :w, modify and change, both change but give different values. [131029240090] |Change 2010-10-06 12:51:21.949082169 +0500 Access 2010-10-06 12:51:21.908246082 +0500 Modify 2010-10-06 12:51:21.908246082 +0500 [131029240100] |So what is the meaning of modify and change in this context? [131029240110] |Time of modification and change give time of which event? [131029240120] |Thanks [131029250010] |This has already been answered in this question, which I quote (original text by echox): [131029250020] |There are 3 kind of "timestamps": [131029250030] |
  • Access - the last time the file was read
  • [131029250040] |
  • Modify - the last time the file was modified (content has been modified)
  • [131029250050] |
  • Change - the last time meta data of the file was changed (e.g. permissions)
  • [131029250060] |This post on StackOverflow explains the difference among the three different times from a programming interface point of view. [131029260010] |How are file permissions calculated? [131029260020] |Using chmod I could set the permissions for a file, but if the parent ( .. ) directory had conflicting permissions, what would happen? [131029260030] |And if I create a new file, using touch or something similiar, how are the initial permissions calculated? [131029260040] |Are permissions inherited it from ..? [131029260050] |And why can't I do anything in directory when I removed the executable permission flag? [131029270010] |First of all ... in Linux everything is a file. [131029270020] |By everything I mean everything ... your folders, or mouse, or keyboard ... all is a file. [131029270030] |Now, let's answer your questions: [131029270040] |
  • There are no conflicts between folder and contained file. [131029270050] |If you have a folder woth only read rights, but you have a file in that folder with write permissions, you can write to that file. [131029270060] |However you can not create/delete files in that folder. [131029270070] |So, don't worry about conflicts. [131029270080] |Also you can read the contents of the folder (list the folder).
  • [131029270090] |
  • Default permissions usually are 644 (meaning: rw for user, r for group and other)
  • [131029270100] |
  • The "executable" bit for a directory means "listing" the directory. [131029270110] |In other words, if you -x a folder, you can't know its content, that means you can't touch something into it.
  • [131029280010] |
  • nothing special
  • [131029280020] |
  • man umask
  • [131029280030] |
  • go read any introduction to *nix filesystems :)
  • [131029290010] |
  • There is -strictly speaking- no such thing in UNIX as "conflicting permissions": access permissions on an filesystem entry (directory, file, etc.) determine what you can or can not do on that object. [131029290020] |Permissions on other filesystem entries do not enter into the picture, with the exception of the "x" bit on all ancestors directories in the path to a file (up to /) -- see 3.
  • [131029290030] |
  • The default permission on a newly created file are determined by the permissions that the creating program allows (the mode argument to the open or creat system calls) and the current process umask. [131029290040] |Specifically, any bit that is set (1) in the "umask" is reset (0) in the newly-created file permissions: in C-like notation: file_permissions = open_mode &! umask. [131029290050] |Read man 2 creat (look for O_CREAT) and man umask for the details.
  • [131029290060] |
  • The "x" (executable) bit on a directory controls whether you can traverse that directory: traversing a directory means being able to cd into it and access files contained in it. [131029290070] |Note that the ability to list the contents of the directory is controlled by the "r" bit.
  • [131029290080] |Further reading: [131029290090] |
  • http://www.hackinglinuxexposed.com/articles/20030417.html on file permissions
  • [131029290100] |
  • http://www.hackinglinuxexposed.com/articles/20030424.html on directory permissions
  • [131029300010] |Why my vim-7.3 compile fails to include clientserver? [131029300020] |I am trying to compile vim-7.3 will all features enabled. [131029300030] |I ran configure with [131029300040] |When I check the version, it shows several features are still not installed. [131029300050] |Huge version without GUI. [131029300060] |Features included (+) or not (-): +arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent -clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path .... [131029300070] |Now according to vimdoc [131029300080] |N +browse N +clientserver [131029300090] |It says [131029300100] |Thus if a feature is marked with "N", it is included in the normal, big and huge versions of Vim. [131029300110] |features.h also says [131029300120] |+huge all possible features enabled. [131029300130] |According to the above mentioned two resources, huge means all features are enabled. [131029300140] |Even if not all, then at least +clientserver and +browse has to be enabled in huge compilation mode. [131029300150] |But my experience says otherwise. [131029300160] |Huge compilation fails to include browse and clientserver feature. [131029300170] |1- Why is it so? [131029300180] |Is my understanding of the document is incorrect? [131029300190] |2- How to enable clientserver feature? [131029300200] |3- How to enable gui? [131029300210] |4- Is it possible to enable all features simply? [131029300220] |I tired huge as features.h suggested it will enable all possible features, but it didn't work. [131029300230] |Thanks for your time. [131029300240] |

    Edit: Problem solved!

    [131029300250] |Thanks to all of you guys for your priceless help. [131029300260] |I checked, vim73/src/auto/config.log, it was clear that lots of dependencies are missing. [131029300270] |Gert post gave an idea which packages are required. [131029300280] |I used: [131029300290] |Some of the packages were already installed, others were not. [131029300300] |After that: [131029300310] |Now my vim has all the packages associated with huge. [131029300320] |Huge version with GTK2 GUI. [131029300330] |Features included (+) or not (-): +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi ... [131029300340] |Thanks [131029310010] |You need to look at the output of ./configure and at config.log [131029320010] |The test in feature.h is [131029320020] |so you have to make sure that FEAT_XCLIPBOARD is enabled. [131029320030] |This is done here: [131029320040] |So it looks as if you miss some X11-devel package. [131029330010] |According to this building Vim page, you'll need these dependencies on Ubuntu [131029330020] |Run configure again. [131029330030] |I've tried and all seemed to be enabled. [131029340010] |Opensolaris snmp broadcast [131029340020] |A network sensor I'm evaluating is showing that my Opensolaris server is broadcasting on the snmp port 161, and I'm getting alerts about every 2 minutes. [131029340030] |How can I turn off the snmp broadcast (i.e. traps?) on the Opensolaris machine? [131029340040] |We have snmp enabled on the Opensolaris machine for Cacti, so it should really just be acting like a client in regards to snmp. [131029340050] |Is there a configuration setting somewhere? [131029340060] |I'm not familiar with snmp, but somehow got it up and running for Cacti. [131029340070] |I see that /usr/sbin/snmpd is running. [131029340080] |Any thoughts? [131029340090] |Thanks. [131029350010] |I would check all services running and try disabling each of them one at a time, starting with the most suspicious. [131029350020] |Some googling suggests: [131029350030] |(assuming you are in runlevel 3) [131029360010] |What's up with the metadata in the source? Are there tools for it? [131029360020] |I'm comparing two different kernel versions (one official, one from a manufacturer); there are thousands of file whose only difference is in metadata in the files. [131029360030] |The metadata looks like '$:Key: value$'. [131029360040] |Is there a set of tools that modify this stuff? [131029360050] |What generates this data? [131029360060] |Is there any way to do a diff without this polluting it without running the entire source through sed? [131029360070] |An example: [131029370010] |CVS (a Versioning System) is able to replace certain "Placeholders" with their values upon checkout (so you have for example the version of the checkout or the author in the file). [131029380010] |As Tante says, those $Word: ...$ are inserted and updated by some version control systems (CVS and SubVersion, tipically). [131029380020] |GNU diff has an option --ignore-lines-matching-re that can exclude lines that match a certain regular expression. [131029380030] |This one should do the trick: [131029380040] |(Note the \ before $ to prevent it being interpreted as an end-of-line marker in the regexp.) [131029390010] |Can I break display devices with the xrandr command? [131029390020] |If use the xrandr command and set a wrong resolution/freq/..., can a break my display devices? [131029390030] |For instance, by setting a very high refresh freq that one of the video devices involved (video card, monitor, ...) does not support. [131029400010] |In the early 90's there was indeed the danger of breaking CRT displays when setting too high frequency, but I don't think this is still a big problem. [131029400020] |Modern CRTs should just refuse to work with unsupported frequencies. [131029400030] |Still with any CRT there is some danger, at least this is what wikipedia says... [131029400040] |Wrong resolution doesn't do any harm. [131029410010] |Unix executable file permission vs runtime user's permissions [131029410020] |I have heard that it is good practice to run an executable as a user with completely different privilege set than the owner of the task. [131029410030] |In fact I heard that it is best to run it as a different with exactly opposite privilege set. [131029410040] |I can understand limiting privileges of run time user. [131029410050] |But cant this be achieved by the setuid feature ? [131029420010] |If I understand you correctly, you have an application which is run by a normal user and whose associated files shall not be writeable by normal users to prevent accidental deletion. [131029420020] |For this you do not need setuid. [131029420030] |All you need to do is something along the lines of: [131029420040] |that means you give ownerships of the files to root, disallow all other users to write and allow every user to read and execute but not to write the executable. [131029430010] |I would say that this is generally a bad idea; in almost every case, you want your executables to have the same privileges you have, since you generally want to let the executable do whatever it's designed to do to your files. [131029430020] |For example, if you made your text editor suid to an unprivileged user, you wouldn't be able to edit any text files... [131029440010] |What happened to my free space [131029440020] |On my Amazing 2GB EeePC Surf, I have no more space left! [131029440030] |This is quite normal, and it happens every now and then. [131029440040] |Just delete a few large, unneeded files and everything should be good, right? [131029440050] |So I go and find a 2MB file in /tmp, and rm -rf it. [131029440060] |Check free space again, and... still nothing?! [131029440070] |I had to remove about 30MB of files before it registered some free space. [131029440080] |Now, my question is, whats up with this strange behaviour? [131029450010] |Do the “Used” and “Available” columns of df output add up to the figure in the total column? [131029450020] |(The output of df reflects the data from the underlying statvfs system call, so you'll find the same numbers in any other application.) [131029450030] |If not (which is probably the case), that's because by default, on an ext2/ext3/ext4 filesystem, 5% of the space is reserved to root. [131029450040] |This space is not included in the “Available” column. [131029450050] |So if you've filled exactly 95% of the filesystem, the available space is 0. [131029450060] |You can change the user who gets the 5%, or change the amount (all the way to 0 if you like), with tune2fs (options -g and -uto control who gets it,-mor-r` to control how much there is). [131029460010] |vga_switcheroo not in /sys/kernel/debug in 2.6.35-22 (kubuntu maverick) [131029460020] |I have a sony VPCZ12 laptop. [131029460030] |It has those dual video cards that are a pain to get working in linux. [131029460040] |The new 2.6.35 kernel is supposed to support that with the vga_switcheroo module which is supposed to be located in /sys/kernel/debug on >2.6.35. [131029460050] |The problem is that when I boot my laptop, it freezes at a blackscreen unless I boot with options i915.nomodeset=0. [131029460060] |It won't boot into X, but I can get to a terminal which is fine. [131029460070] |But then vga_switcheroo isn't in /sys/kernel/debug. [131029460080] |Is this a ubuntu bug on how the kernel is compiled? [131029460090] |Or is it because I have to boot with i915.nomodeset? [131029460100] |The livecd boots into X just fine, but I've never found a way to get X working on the installation. [131029460110] |There's a lot of information about linux on the z12 but most of it is either outdated, doesn't work, or just plain doesn't make any sense [131029470010] |You need to have a kernel with vga_switcheroo enabled and KMS, i.e. kernel mode setting, active (which you haven't as you boot with nomodeset). [131029470020] |To check if vga_switcheroo is enabled in the kernel, have a look into the Ubuntu config of your kernel. [131029470030] |You should find it in /boot with a name along the lines of /boot/config-2.6.35-XX-generic with XX some number corresponding to your kernel. [131029470040] |If it is not enabled, you find a custom Ubuntu kernel with vga_switcheroo enabled at http://www.ramoonus.nl/2010/08/linux-kernel-2-6-35-installation-guide-for-ubuntu-linux/ [131029480010] |I never got it working in Ubuntu, but I got a working KDE system using arch. [131029480020] |So I'll post an answer here in case anyone else comes here for the same problem. [131029480030] |I could never get it working in Ubuntu. [131029480040] |I couldn't boot without i915.modeset=0 and without that vgaswitcheroo doesn't show up. [131029480050] |What I ended up doing was installing arch, then before doing any setup in my new arch install, I installed a vanilla 2.6.35.7 kernel from kernel.org. [131029480060] |That booted to a terminal just fine and I'm up and running on KDE. [131029490010] |Problem may be in ubuntu patches to kernel. [131029490020] |Try a vanilla kernel or another distro. [131029490030] |@fschmitt no it's not grub2, i'm using it on arch with KMS and vgaswitcheroo [131029500010] |PPC Debian: eth0: switching to forced 10bt / 100bt [131029500020] |I recently installed debian on an old G4 iMac, and everything is working fine except that the console is constantly spammed with alternating [131029500030] |messages. eth0 isn't configured at all in /etc/network/interfaces; I'm using the wireless interface on eth1 (which works fine). sudo ifconfig eth0 down doesn't give any message; the alternating messages just keep coming. [131029500040] |Is there any way to get rid of them? [131029510010] |Try unloading the sungem kernel module (after ifconfig eth0 down to release the interface). [131029510020] |If that works you can blacklist it to avoid it being loaded on next reboot. [131029520010] |Installing Java into Ubuntu 10.04 Firefox/Chrome [131029520020] |I'm having a really hard time getting the Java browser plugin to install in Ubuntu 10.04. [131029520030] |I've tried searching all over the place, but everyone seems to recommend installing the packages that no longer exist in the Ubuntu repositories. [131029520040] |Several places suggested installing the OpenJDK, which I did. [131029520050] |Still doesn't work. [131029520060] |If you can give me any help at all getting Java plugins to work in either Chrome or Firefox, I'd be most gracious. [131029530010] |Have you tried installing the package ubuntu-restricted-extras? [131029530020] |It bundles together several proprietary packages that support MP3, Flash and Java etc., so if you feel OK with proprietary technology then installing it would be the easiest. [131029530030] |If you just want Java then open up Synaptic and install Sun's (Oracle's) packages, including the browser plugin. [131029530040] |If that doesn't work then maybe my blog post will, basically it involves making symbolic links to the shared objects [131029530050] |If you are on a 32 bit operating system: ln -s /path/to/jre/lib/i386/libnpjp2.so /etc/mozilla/plugins/ If you have gone 64 bit already: ln -s /path/to/jre/lib/amd64/libnpjp2.so /etc/mozilla/plugins/ (be sure that you downloaded the correct JRE) [131029530060] |I have been having bad luck with OpenJDK stuff so it would be great to know if someone can make it work too. [131029540010] |Usually ubuntu-restricted-extras should work for you, like phunehehe mentioned. [131029540020] |Since Ubuntu 10.4 the sun-java* packages have moved from the "Multiverse Repository" to the "Partner Repositories". [131029540030] |Add the partner repositories to your package sources and you should be able install sun-java6-jre and sun-java6-plugin. [131029540040] |See "Adding Canonical Partner Repositories" int the ubuntu wiki. [131029540050] |To install Java you will have to decide if you want the OpenJDK or the Sun/Oracle Version. [131029540060] |Java by itself is platform independent, but sometimes developers write applications which have dependencies to com.sun.* packages. [131029540070] |These packages are only available in the HotSpot VM, which is the virtual machine of the Sun/Oracle Java distribution. [131029540080] |To be on the safe side, you should use the Sun/Oracle Java version. [131029540090] |32-bit is available as package from the partner repository, 64-bit not yet, as far as I know and must be installed by hand: [131029540100] |
  • Download your Version (32-bit or 64-bit) from the Oracle Download Page.
  • [131029540110] |
  • Create a folder for the installation (e.g.: /opt/java/64)
  • [131029540120] |
  • Install the .bin file: sudo ./jre-6uxx-linux-x64.bin
  • [131029540130] |
  • Don't forget to tell your system about the new java version with sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/64/jreXXX/bin/java" 1 and sudo update-alternatives --set java /opt/java/64/jreXXX/bin/java
  • [131029540140] |These are the steps to install a JRE on your system. [131029540150] |Now you have to install the plugin to the browser: [131029540160] |Firefox: [131029540170] |
  • If it doesn't exist, create ~/.mozilla/plugins
  • [131029540180] |
  • Link the plugin: ln -s /opt/java/64/jreXXX/lib/amd64/libnpjp2.so ~/.mozilla/plugins/
  • [131029540190] |Chrome: [131029540200] |
  • create /opt/google/chrome/plugins
  • [131029540210] |
  • Link ln -s /opt/java/64/jreXXX/lib/amd64/libnpjp2.so /opt/google/chrome/plugins
  • [131029550010] |What should every expert know? [131029550020] |What things should any self-professed UNIX expert have under their belt? [131029550030] |I'm looking to fill any gaps in my knowledge. [131029550040] |Some things I can think of off the bat: [131029550050] |
  • Shell (interactive and scripting)
  • [131029550060] |
  • Common utilities (grep, ls, etc.)
  • [131029550070] |
  • vi (possibly Emacs too)
  • [131029550080] |
  • Some mix of sed / awk / Perl (preferably all)
  • [131029550090] |
  • Knowledge of networking standards
  • [131029550100] |
  • Ability to set up common programs: A mail server, file server and so on
  • [131029550110] |Probably forgetting a lot, obvious and not-so-obvious. [131029550120] |What else? [131029560010] |From Development point of view : [131029560020] |
  • You should know how to use vim with cscope and ctags, this will help you to understand other peoples code faster. [131029560030] |We learn alot from others code as well.
  • [131029560040] |
  • Source control tools like CVS , svn etc.
  • [131029560050] |
  • Debuggers e.g. gdb ,dbx
  • [131029570010] |As a UNIX expert, you should, at a minimum, be able to: [131029570020] |
  • Build your system from source
  • [131029570030] |
  • Apply source patches to your system
  • [131029570040] |
  • Troubleshoot any problem you encounter
  • [131029570050] |
  • Understand what obscure knobs in your kernel do, and why you should probably not touch them
  • [131029570060] |
  • Administer your system
  • [131029570070] |
  • Protect your system
  • [131029570080] |
  • Maintain your system
  • [131029570090] |
  • Connect your system to other systems
  • [131029580010] |Debian server on a Intel Core i3 and Intel Q57 Chipset - will it work? [131029580020] |I want to build a Debian server (running samba, postfix, apache - without X11) on a Intel Core i3 / Intel Q57 Chipset system. [131029580030] |I'm relativly new to the Linux-World but had driver issues already within my desktop (ATI GPU) that I wasn't able to solve. [131029580040] |Will the following components work fine with Debian Linux? [131029580050] |
  • Intel Core i3-530 2x2.93GHz 4MB VideoHD Sock1156 (Clarkdale) BOX
  • [131029580060] |
  • Gigabyte GA-Q57M-S2H GL/SATA/R/DVI/HDMI/DP Q57 HD Graphics mATX Sock1156
  • [131029580070] |
  • Raid: Samsung SpinPoint F3 HD502HJ - 500GB 7200rpm 16MB 3.5zoll SATA300
  • [131029590010] |It's hard to say whether it works without actually testing it. [131029590020] |I'd grab the Live CD matching the version of Debian you want to run and test it. [131029590030] |Debian emphasizes stability and therefore it's releases normally lags behind when it comes to kernel versions and other applications. [131029590040] |That means they might not work while more up-to-date distributions like e.g. Ubuntu 10.4 LTS server edition (or unreleased Debian versions, like Sid) may work better. [131029600010] |Debian GNU/Linux device driver check page tells you what hardware on your system is supported by the kernel, and by which versions. [131029610010] |Sending music directly from MIC to LS [131029610020] |How can I tell linux to send directly from my microphone to my loudspeaker? [131029620010] |This depends on your audio system. [131029620020] |By default, your mic input should be already send to your speaker. [131029620030] |Please specify your problem a little bit more in detail. [131029620040] |A common problem is, that you will have to unmute your mic channel. [131029620050] |The major audio systems for linux since 2.6 is ALSA. [131029620060] |The default mixer application is curses based and can be opened on the terminal with alsamixer. [131029620070] |Try this, select your channels with the arrow keys and press m to unmute them. [131029620080] |If you are using an older installation, maybe your audio system is OSS. [131029620090] |The default mixing application for this one is vmix. [131029620100] |If you are using some other setup which could include JACK or PulseAudio, provide us with more details. [131029630010] |What distributions work out of the box with tablet computers? [131029630020] |I recently got my hands on a tablet computer. [131029630030] |I tend to at least dual boot my systems. [131029630040] |While doing some research about tablet computing and *nix most of the information was from the 2004-2008 era light years ago in computing time. [131029630050] |What is the current state of tablet computing? [131029630060] |I want something that works out of the box with minimal fuss - I'm way past the point that futzing with things is worth the time I spend on it. [131029630070] |Specifically I'm looking to have features comparable to windows 7 + office: [131029630080] |
  • Virtual Keyboard - selectable handwriting / touch keyboard
  • [131029630090] |
  • OneNote replacement
  • [131029630100] |
  • Navigation via pen
  • [131029630110] |What distribution out there has really good tablet support of the box in 2010? [131029630120] |(also bonus points for fun tablet apps in linux) [131029640010] |As far as I know there is no special tablet pc linux distribution available. [131029640020] |Ubuntu 10.10 is heading towards a better tablet/touch based input support: [131029640030] |They are including their multi touch framework uTouch in the current release. [131029640040] |See the blog post from Canonical from 16th August, 2010: "Multi-touch Support Lands in Maverick". [131029640050] |"Unity" is the new light weight desktop interface, which is also optimized for touch events as user inputs. [131029640060] |See Mark Shuttleworths Blogposting "Unity, and Ubuntu Light". [131029640070] |You should simply try the Ubuntu 10.10 (Maverick) Beta. [131029640080] |It includes Linux kernel 2.6.35 with some patches for improved multitouch capability. [131029650010] |There is WeTab which is a German Tablet PC (it has english as language as well) running MeeGo (reference to WeTab) which is a Linux based operating system. [131029650020] |It has a virtual keyboard, runs Open Office, and is navigable "by pen" or rather via its touchscreen. [131029650030] |I'm not sure if I can recommend it though, since it has quite a few bugs when a friend tested it yesterday (after he installed all software updates). [131029650040] |Its touchscreen can get messed up for instance leaving you with no keyboard at all, or having you click somewhere else on the screen than you thought. [131029650050] |But since they released the thing just this month perhaps you should expect some issues, and hope for a software update... [131029650060] |If you look beyond the bugs (if it works as expected that is) it's quite neat with Flash (read youtube) support, Wifi, and the fact that it runs Linux (it even has a shell available in it's WeTab store, for free). [131029650070] |There are a few youtube videos around as well. [131029660010] |Debian is a community-driven Linux distribution with a very large number of packages and many supported architectures. [131029660020] |Several distributions derive from it in some form, the best-known being Ubuntu. [131029660030] |

    Philosophy

    [131029660040] |The goal of the Debian project is to produce a free operating system. [131029660050] |The Debian Free Software Guidelines are one of the notable definitions of free software, and the Open Source Definition derives from it. [131029660060] |Debian provides a small amount of non-free software, though it is not formally part of Debian. [131029660070] |

    Releases

    [131029660080] |At any point in time, there are three distributions of Debian: [131029660090] |
  • stable: the officially released distribution.
  • [131029660100] |
  • testing: the preparation ground for “stable”. [131029660110] |This can be seen as a rolling release.
  • [131029660120] |
  • unstable: the latest packages as they come in.
  • [131029660130] |In addition to Debian GNU/Linux, there are projects for BSD-based versions of Debian and Debian GNU/Hurd. [131029660140] |

    Documentation

    [131029660150] |
  • FAQ
  • [131029660160] |
  • Installation manual (including supported hardware)
  • [131029660170] |
  • Debian Reference
  • [131029660180] |
  • Wiki
  • [131029660190] |
  • Mailing list archives
  • [131029660200] |
  • Security information
  • [131029660210] |
  • Bug reports (http://bugs.debian.org/42 to see bug #42)
  • [131029660220] |
  • Available packages (quick search: http://packages.debian.org/package-name)
  • [131029660230] |
  • Manual pages (e.g. man(1))
  • [131029660240] |

    Common tasks

    [131029660250] |
  • Install a package: apt-get install package-name
  • [131029660260] |
  • Apply updates: apt-get update; apt-get upgrade
  • [131029670010] |Debian is a community driven GNU/Linux distribution first announced 1993. [131029670020] |It is well known for its package management system APT and large number of packages. [131029670030] |Many other distributions are influenced or originate from it, like Ubuntu or Knoppix [131029680010] |Evolution Check mail when Window is closed [131029680020] |In Ubuntu/Gnome under the mail icon in the tray, there are chat, mail, and broadcast. opening the chat logs into your IM accounts and keeps you logged in when closing the main window. [131029680030] |But it appears that for the mail (ie evolution), when you open it it logs in and checks mail, but stops checking mail as soon as you close the window. [131029680040] |I cannot find the setting to keep checking mail even when the main window is closed. [131029680050] |This seems like a basic function and I can't figure out why it isn't the default behavior. [131029680060] |How do I keep checking mail when the main window is closed? [131029680070] |Running Ubuntu 10.4 Lucid X64. [131029690010] |The feature does not yet exist. [131029690020] |What I do is send the window to another workspace. [131029690030] |You can do this a couple of ways. [131029690040] |The easiest is to right-click on either Evolution's title-bar or its entry in the task bar and pick "Move to Another Workspace" then choose the one to move it to (I always use 4 for mail). [131029690050] |You can switch to that workspace by using the workspace switcher in the bottom-right or by using the key combos alt+ctrl+left and alt+ctrl+right. [131029690060] |I actually find this more convenient than closing and opening the window. [131029700010] |Although the feature doesn't yet exist in the mail icon that's used in Ubuntu, there is another program you can install called "mail notification". [131029700020] |You can find it in the software center pretty easily, the project's webpage is http://www.nongnu.org/mailnotify/. [131029700030] |It is a panel applet that will watch your mail accounts and let you know when something comes in. Clicking on the icon will launch the mail reader for you. [131029700040] |If you set this up, it has several options for types of accounts to setup, including Evolution - don't use the Evolution option because it will only be able to watch those accounts while Evolution is open. [131029700050] |Choose IMAP, Gmail, POP, etc. instead. [131029710010] |This is a known bug/missing feature in Evolution. [131029710020] |If you don't mind installing software from a PPA, you can install Geoff Goehle's patched evolution/evolution-indicator. [131029710030] |This should give you an option in Evolution's plugin configuration to "hide it in the applet" if it is closed: [131029710040] |https://launchpad.net/~goehle/+archive/goehle-ppa [131029710050] |To add the PPA to your software sources, go to System >Administration >Software Sources >Other Software and click Add, then enter ppa:goehle/goehle-ppa as a source. [131029710060] |Or you can use the command sudo add-apt-repository ppa:goehle/goehle-ppa in a terminal. [131029710070] |The PPA works in 10.04 and 10.10 at the moment. [131029720010] |SSH easily copy file to local system. [131029720020] |If I'm logged in to a system via SSH, is there a way to copy a file back to my local system without firing up another terminal or screen session and doing scp or something similar or without doing SSH from the remote system back to the local system? [131029730010] |One way is to establish a reverse ssh tunnel. [131029730020] |On the ssh command line, create a remote forwarding by passing -R 22042:localhost:22 where 22042 is a randomly chosen number that's different from any other port number on the remote machine. [131029730030] |Then ssh -p 22042 localhost on the remote machine connects you back to the source machine; you can use scp -P 22042 foo localhost: to copy files. [131029730040] |You can automate this further with RemoteForward 22042 localhost:22. [131029730050] |The problem with this is that if you connect to the same computer with multiple instances of ssh, or if someone else is using the port, you don't get the forwarding. [131029730060] |If you haven't enabled a remote forwarding from the start, you can do it on an existing ssh session. [131029730070] |Type Enter ~C Enter -R 22042:localhost:22 Enter. [131029730080] |See “Escape characters” in the manual for more information. [131029730090] |There is also some interesting information in this Server Fault thread. [131029740010] |There is an explanation of how to get the reverse tunnel automatically set up at http://codysoyland.com/2010/jun/6/ssh-tip-automatic-reverse-tunnels-workflow-simplif/ [131029740020] |I have not tried this myself yet, but have kept it in my bookmarks for trying it out at some point in the future. [131029750010] |Those are all very complicated methods. [131029750020] |You can mount the remote file system on your local machine with sshfs: [131029750030] |Then you can copy paste the file with nautilus/gnome/konqueror/dolphin/bash/whatever [131029760010] |List printer's completed jobs [131029760020] |Is there a utility to inspect the jobs that a printer has completed? [131029770010] |That depends on which printing system you are using. [131029770020] |When using CUPS you would like to have a look at the page logifile, which shows you every page that has been printed. [131029770030] |The default location of that file is: /var/log/cups/page_log [131029780010] |CUPS provides a list of all jobs on a printer on its web front-end. [131029780020] |Go to http://localhost:631/jobs?which_jobs=completed or whatever machine is hosting the print server. [131029790010] |With CUPS (the standard printing system on Mac OS X, also used by many but not all other unices): [131029800010] |Moving linux install to a new computer [131029800020] |I know it's practically impossible to take a windows install and move it from one computer to another (physically move the hard drive), but how does that work on linux? [131029800030] |Aren't most of the driver modules loaded at bootup? [131029800040] |So theoretically would it be that much of a hassle? [131029800050] |Obviously xorg configs would change and proprietary ATI drivers and such would have to be recompiled (maybe?). [131029800060] |Is there more to it than I'm thinking of? [131029800070] |Assume the 2 computers are from the same era, ie both i7s but slightly different hardware. [131029800080] |Update: Thanks for the answers. [131029800090] |This is mostly for my own curiosity. [131029800100] |I have my linux system up and running at work, but eventually I'd like to move to a computer that I can get dual video cards into so I can run more than 2 monitors. [131029800110] |But not any time soon [131029810010] |I'm not sure if this answers your question, but typically you do the exact opposite -- you move your user folder and reinstall everything. [131029810020] |In theory all your customization and individual configuration files should be in your user folder, so that's the only thing you really need to transfer [131029810030] |Some package managers have a way to list all installed packages (Debian/Ubuntu have dpkg --list, Gentoo has /etc/world, etc.), so you can just: [131029810040] |
  • Install the base distro on a new system
  • [131029810050] |
  • Tell it "install all the packages I had on the other computer"
  • [131029810060] |
  • Copy your user folder
  • [131029810070] |And you should end up with a functionally identical system [131029820010] |Indeed while under Windows it is almost impossible to move an installation to a new PC by just copying harddrive contents or switching the harddrive between the PCs, this works amazingly well under Linux. [131029820020] |I switched from a Thinkpad R52 to a Thinkpad T400 by just copying the contents of my old harddrive to the new one (by putting the old one in an external closure connected via USB and copying everything under a Gparted-Live-CD). [131029820030] |All I had to do after that was manually putting Grub into the MBR and boot. [131029820040] |Everything still worked for me. [131029820050] |As Michael said, normally a new PC is a nice opportunity to get rid of the cruft accumulated over time, however sometimes you just have to get into work again really fast and then just copying the harddrive contents work great with Linux, as all drivers included in the kernel are available to the kernel without installation, nowadays the drivers are auto-loaded instead of manually listed in modprobe.conf and even xorg autoconfigures itself for me. [131029820060] |Only if you had to manually configure drivers on the old PC (e.g. Raid systems, proprietary graphic drivers etc) you might run into problems. [131029830010] |Moving or cloning a Linux installation is pretty easy, assuming the source and target processors are the same architecture (e.g. both x86, both x64, both arm…). [131029830020] |

    Moving

    [131029830030] |When moving, you have to take care of hardware dependencies. [131029830040] |However most users won't encounter any difficulty other than xorg.conf (and even then modern distributions tend not to need it) and perhaps the bootloader. [131029830050] |
  • If the disk configuration is different, you may need to reconfigure the bootloader and filesystem tables (/etc/fstab, /etc/crypttab if you use cryptography, /etc/mdadm.conf if you use md RAID). [131029830060] |For the bootloader, the easiest way is to pop the disk into the new machine, boot your distribution's live CD/USB and use its bootloader reparation tool. [131029830070] |Note that if you're copying the data rather than physically moving the disk (for example because one or both systems dual boot with Windows), it's faster and easier to copy whole partitions (with (G)Parted or dd).
  • [131029830080] |
  • If you have an xorg.conf file to declare display-related options (e.g. in relation with a proprietary driver), it will need to be modified if the target system has a different graphics card or a different monitor setup. [131029830090] |You should also install the proprietary driver for the target system's graphics card before moving, if applicable.
  • [131029830100] |
  • If you've declared module options or blacklists in /etc/modprobe.d, they may need to be adjusted for the target system.
  • [131029830110] |

    Cloning

    [131029830120] |Cloning an installation involves the same hardware-related issues as moving, but there are a few more things to take care of to give the new machine a new identity. [131029830130] |
  • Edit /etc/hostname to give the new machine a new name.
  • [131029830140] |
  • Regenerate the ssh host key.
  • [131029830150] |
  • Make any necessary change to the networking configuration (such as a static IP address).
  • [131029830160] |
  • Change the UUID of RAID volumes (not necessary, but recommended to avoid confusion), e.g., mdadm -U uuid.
  • [131029830170] |See also a step-by-step cloning guide targeted at Ubuntu. [131029830180] |My current desktop computer installation was cloned from its predecessor by unplugging one of two RAID-1 mirrored disks, moving it into the new computer, creating a RAID-1 volume on the already present disk, letting the mirror resynchronize, and making the changes outlined above where applicable. [131029840010] |I guess this will answer your question: http://wiki.xtronics.com/index.php/Wajig [131029840020] |Install a fresh linux, copy your home, and use wajig to reinstall all packages. [131029850010] |Is there a freeform playing cards deck&table game for Linux? [131029850020] |I am looking for a playing cards "game" where there are no rules and I can just place and move cards as I want. [131029850030] |Just a real cards deck and replacement which I can use to play any single-player (solitaire) card game I may know. [131029860010] |Not sure about totally freeform, but you can try out PySol [131029860020] |PySol is an exciting collection of more than 200 solitaire card games. [131029860030] |Its features include support for lots of distinct games, very nice look and feel, multiple cardsets and table tiles, sound and background music, unlimited undo &redo, load &save games, player statistics and log files, hint system, demo games, support for user written plug-ins, integrated HTML help browser and lots of documentation. [131029860040] |Among the supported games are classics like Aces Up, Baker's Game, Canfield, FreeCell, Forty Thieves, Golf, Klondike, Pyramid, Scorpion, Spider, Yukon, and many more... [131029870010] |KDE looks terrible in arch [131029870020] |I usually use kubuntu, but I had to install a custom kernel on my laptop and it's a lot easier with arch. [131029870030] |The problem is that kde looks terrible in arch, especially the GTK applications. [131029870040] |I know there are all sorts of tutorials of installing gnome icons, and various peicewise fixes, but is there a way to find out exactly how kubuntu sets up KDE so I can just duplicate that? [131029880010] |On Arch you should consider installing KDEmod ( from The Chakra Project ) instead of KDE. [131029880020] |Install a minimal KDE4 system: [131029880030] |Alternatively, fetch a richer set of applications: [131029880040] |or opt for a fuller set: [131029880050] |According to the kdemod wiki, you will need to install this package : [131029880060] |to get a more uniform look for QT and GTK apps. [131029880070] |Also checkout this article. [131029890010] |Kubuntu makes many modifications to various applications (e.g., Firefox, OpenOffice), so it is unlikely that there is an easy way to recreate the Kubuntu look on ArchLinux. [131029890020] |That being said, I moved from Kubuntu to ArchLinux and I now prefer the vanilla applications (e.g., OpenOffice looks much better). [131029890030] |One thing that helped a lot in synchronizing the look of gtk applications with KDE was to install qtcurve, a theme that works for both qt (KDE) and gtk (Gnome) apps. [131029900010] |necropost: Sadly KDEMod Repositores is no longer active .. [131029900020] |Now -> http://chakra-project.org/ [131029910010] |How to get a program running with root privileges without using su or sudo [131029910020] |I have a bash script that needs to run with root privileges, but must be invoked by the normal user. [131029910030] |Difficult part is that the script should not ask for a password, and I don't want to use the sudoers file. [131029910040] |I'd like to avoid using sudo or su. [131029910050] |Is this possible? [131029920010] |If it wasn't a bash script but a regular application, you would give ownership of it to root and set the setuid bit on the application. [131029920020] |Then upon execution, the effective user the application is running under is root. [131029920030] |Due to security concerns however this is in many systems prohibited for shell scripts. [131029920040] |This question here on unix.stackexchange.com does handle ways how to overcome this. [131029930010] |Use sudo. [131029930020] |If you don't want to have to call sudo /path/to/myscript, write a one-line wrapper exec sudo /path/to/myscript "$@". [131029930030] |See Allow setuid on shell scripts, particularly Maciej Piechotka's answer on using sudo and my more general discussion of setuid programs. [131029940010] |Toggle between dvorak and qwerty [131029940020] |I've recently started to learn the dvorak keyboard layout, but I still need to use qwerty sometimes. [131029940030] |I'm looking for a script to toggle between the two keyboard layouts. [131029940040] |Also, I'd like to invoke this script with a hotkey that will work everywhere ( in my DE and in my console. ) Like pressing shutdown in this post. [131029950010] |Since the keyboard layout is a property of the input device you could set it via xinput. [131029950020] |Use xbindkeys to define arbitrary X hotkeys. [131029960010] |Replace with relevant data. [131029960020] |Now set up an xbindkeys hotkey-combo to run this script. [131029970010] |You'll have to do this separately for X and for every kind of text console you care about. [131029970020] |If you want to switch between arbitrary keymaps, you need to maintain state, as typically the console won't do it for you. [131029970030] |That's what layout switchers such as Gnome's and KDE's do. [131029970040] |But if you only want to switch between some well-known keymaps, you can query the console (assuming this feature is available on your console type), obtain the current code sent by a key and decide what to switch to based on that. [131029970050] |Here are a few possibilities: [131029970060] |
  • If keycode 24 (the number will vary between console types) currently sends q, the current keymap looks like qwerty, so switch to dvorak, otherwise switch to qwerty.
  • [131029970070] |
  • If Q and W have adjacent keycodes, it's probably a qwerty layout.
  • [131029970080] |
  • Add a fake key in the keymaps and look up its binding.
  • [131029970090] |Here's an implementation for X and Linux, using the W=Q+1 test. [131029970100] |Beware, I haven't tested it. [131029970110] |Note that the script will usually not be usable through text mode remote logins. [131029970120] |On X Window, the best place to bind this to a key is using your desktop environment or window manager's key binding feature. [131029970130] |You can make the key execute the X-specific part only. [131029970140] |Of course, if your DE/WM has a layout switching feature, you might as well use it. [131029970150] |On the Linux console, the possibilities for key bindings are very limited. [131029970160] |You can bind a key to the KeyboardSignal symbol. [131029970170] |If you're using SysVinit, put kb::kbrequest:/path/to/script in /etc/inittab to run your script (as root!) when the signal is pressed. [131029970180] |I don't know how to configure this key's action with Upstart. [131029980010] |Correct textual name for << [131029980020] |I've just come across the <<command, used like so: [131029980030] |Now, I've no idea what this is called, but I'd quite like to know it's name, primarily so I can go and search and find out more about its syntax. [131029980040] |Sadly, Googling for "<<" just doesn't work. [131029990010] |That's called a "Here document". [131029990020] |http://en.wikipedia.org/wiki/Here_document [131030000010] |Why are there so many log files in a typical Linux system? Why don't they use one consolidated logs db/file and an api? [131030000020] |I just wonder why are there so many log files in a typical Linux system? [131030000030] |Wouldn't it be a better idea to have one system api function for logging and one consolidated table to save all the log entries from all the applications? [131030010010] |This would make things like 'tail -f /var/log/apache/access.log' impossible. [131030010020] |Why do you think it would be better to put everything in one file? [131030020010] |Using simple text files has the advantage that you don't need any database specific tools to get your log entries. [131030020020] |You can analyze them with grep if you like, you can open them up with your favorite pager and you can process them in your favorite scripting language like Perl, Python, etc. without the need of any additional libraries. [131030020030] |On a Unix system you have already some kind of "system log API". [131030020040] |It is called syslog. [131030020050] |Syslog is not really an API but it is an standard for logging messages. [131030020060] |The name stands for the networking protocol and the library and daemon behind it. [131030020070] |The default configuration of the most systems is a syslog daemon listening to local messages. [131030020080] |The daemon accepts the messages and does the logging. [131030020090] |There are several different implementations of syslog daemons for all kind of platforms and it is also possible to log your messages to a database. [131030020100] |It is up to you. [131030030010] |It's part of the Unix philosophy. [131030030020] |The idea is that text files are free from program lock-in and everyone can use whatever technique they prefer. [131030030030] |To take this further, flat files are often used, as opposed to markup languages like XML (although I have seen programs storing things in XML format as well). [131030030040] |In googling I have found this nice writeup about plain text, with comments about the Unix philosophy. [131030040010] |I just wonder why are there so many log files in a typical Linux system? [131030040020] |The different log files contain different information (though there is typically some duplication). [131030040030] |They often have different characteristics: different rotation and retention policies, different permissions, etc. [131030040040] |The syslog daemon takes care of writing them; you can see its settings in /etc/syslog.conf or /etc/syslog-ng.conf. [131030040050] |Wouldn't it be a better idea to have one system api function for logging [131030040060] |This one is a good idea. [131030040070] |Let's call it syslog. [131030040080] |Its job is to send the log entries to the syslog daemon. [131030040090] |and one consolidated table to save all the log entries from all the applications? [131030040100] |Now that's a whole can of worms. [131030040110] |You seem to be assuming the presence of a database engine, probably a relational database, probably one you can query in SQL. [131030040120] |But Unix is older than SQL, and there are very good reasons why it hasn't adopted SQL as a standard component. [131030040130] |Under Unix, the database is the filesystem. [131030040140] |It's not a relational database, it's a simple one. [131030040150] |Its entries are not rows, but simple files, preferably text, preferably with a simple format. [131030040160] |For example, log files are text files, with one entry per line, containing the date, the machine name, the originating program and the entry text. [131030040170] |Using a relational database would have a number of downsides: [131030040180] |
  • What do you do if the database isn't working? [131030040190] |(The filesystem is a fundamental component (and have I mentioned it's a lot simpler than a relational database?); the syslog daemon is a simple component that does one job (a common feature in Unix design) and so is expected to do it well and reliably.)
  • [131030040200] |
  • How do you log database operations? [131030040210] |(Ok, through the database itself — after all the logs contain entries from the kernel and from the syslog daemon — but again a much more complex database makes this more difficult and less reliable).
  • [131030040220] |
  • How do you access log entries? [131030040230] |Compare the simplicity of cat, grep, less against SQL queries. [131030040240] |And file permissions against, well, I don't know how you'd handle this in a typical relational database.
  • [131030040250] |
  • Multi-server installations don't store their logs locally, they use the remote log feature that's been built into the syslog daemon since pretty much the dawn of Unix. [131030040260] |That's easy to implement with the unix logging architecture; you can't run a replicated database on that complexity budget.
  • [131030050010] |If you would really like to store your system logs in a relational database (which can have many advantages), check out rsyslog (The up and coming replacement for syslog), which can write system logs to a MySQL, Postgres or Oracle database. [131030060010] |swapon: Operation not permitted [131030060020] |I'm running this as root, obviously. [131030060030] |I've created a file called /swap/sw1, by dumping 512 megs of /dev/zero into it. [131030060040] |I then ran mkswap, which said: [131030060050] |I'm assuming this means it worked fine. [131030060060] |I've chmodded the file to 0600, and the file is owned by root. [131030060070] |I then ran swapon: [131030060080] |I've also tried adding this to fstab and calling swapon -a -v, but go the same problem. [131030060090] |Why am I not allowed to use this file as a swap file? [131030060100] |One note, which I think is irrelevant but I could be wrong - I'm running on an OpenVZ VM. [131030070010] |I think you were hit by the limitations of OpenVZ. [131030070020] |OpenVZ does not allow what they call "user defined swap": Swap is only available "as a whole" for the whole system, not for individual VPSes, see http://forums.vpslink.com/linux/621-swap-space.html#post3915 [131030080010] |Can I set up Kate to always fold (collapse) all foldable regions when opening a code file? [131030080020] |I'd like to set up Kate so that, if I open, for example, a C++ file, all classes it contains to be folded. [131030080030] |But not only - when I unfold a class, I'd like methods inside it to be initially folded too. [131030080040] |Etc. [131030080050] |Is it possible? [131030090010] |Why can I not copy a direcotry from *nix to a mounted smbfs share on Windows 7? [131030090020] |I've mounted a Windows 7 directory on my FreeBSD box via smbfs: [131030090030] |but for some reason when I try to copy a directory: [131030090040] |I get the following error: [131030090050] |I can copy files just fine. [131030090060] |Is there something special about directories and smb shares? [131030100010] |It's nothing to do with smbfs, cp always requires the -r (recursive) flag to copy a directory. [131030100020] |You should get the same if you try to cp .vim /tmp/: [131030110010] |How to kill both process and subprocess? [131030110020] |I asked a question to know how to get multiple lines of message from Python's subprocess module. [131030110030] |The problem is that in the course of testing, I had to kill the python process that runs gnuchess process. [131030110040] |Using ^c in the command line seems to kill the python process, but not the gnuprocess. [131030110050] |For killing gnuchess, I get the pid with ps aux | grep gnuchess and run kill -9 PID. [131030110060] |Are there other methods to kill both python and gnuchess process? [131030120010] |There is a standard method, if the programs cooperate. [131030120020] |Run kill -- -42 where 42 is the pid of the parent process. [131030120030] |This sends a signal to all the processes in the process group lead by process 42 (the minus sign before the pid means process group). [131030120040] |Normally, if you run your python script from a shell prompt and it simply forks gnuchess, the two processes should remain in the same process group. [131030120050] |But this doesn't seem to be the case, since Ctrl+C sends SIGINT to the whole foreground process group. [131030120060] |Gnuchess might be in its own process group because it made itself a session leader (but I don't know why it would do this), or because you've double-forked it (python forks a shell which forks gnuchess). [131030120070] |A double fork is probably avoidable, but I can't tell you how without seeing your code. [131030120080] |A reasonably reliable and POSIX-compliant way of finding the pid of the gnuchess process is [131030120090] |Specific unix variants may have better ways of achieving this, such as pgrep. [131030130010] |Try: [131030140010] |Using many monitors (4+) in linux [131030140020] |I want to be able to run more than 4 monitors (maybe 6) and it's extremely confusing what's compatible now with the Displayport cards coming out. [131030140030] |Right now I have an ATI card that only has 2 HDMI outputs. [131030140040] |The problem I've seen is that the ATI driver says it doesn't support more than 4 monitors. [131030140050] |So it seems that their eyefinity cards would probably be more hassle than it's worth. [131030140060] |I prefer nvidia anyway, they always seem to have really good linux drivers. [131030140070] |But I don't see that they offer a card with more than 4 ports. [131030140080] |Most of the higher end cards that I've seen have 2 hdmi, 1 dvi, and 1 displayport. [131030140090] |Am I mistaken that those cards are limited to 4 monitors? [131030140100] |And what about drivers? [131030140110] |If I get dual nvidia cards and hook up say 2 HDMI ports + the DVI port on each card, will xorg/nvidia drivers play nice? [131030140120] |Will I be able to set up monitors with different resolutions? [131030140130] |(I have 2 1920x1080 and 1920x1200 screens right now)? [131030140140] |How about x windows? [131030140150] |Can you set up xinerama for 6 screens? [131030140160] |Or make it able to drag x windows? [131030140170] |Update: It seems that ati drivers have come a long way recently and that there is official eyefinity support for linux. [131030140180] |I think I'm goin gto pick up an ATI 5870 and just see where I can get messing with it. [131030140190] |Update2: I ordered a 5870, I'll let you guys know how it goes. [131030140200] |I only have a couple monitors I can play with at the moment though. [131030150010] |How about x windows? [131030150020] |Can you set up xinerama for 6 screens? [131030150030] |Or make it able to drag x windows? [131030150040] |The current Xorg limit is 16 display devices, but a multi-head card will typically be treated as a single device unless you want separate logical displays (not Xinerama-style). [131030160010] |temporary setting the path in an "init" file [131030160020] |Hello, I have an "init" file that reads [131030160030] |by which I'd just like to set the path to that folder for only this bash session. [131030160040] |However, when I execute the script, sh init, it still doesn't recognize the path. [131030160050] |However, if I just say export PATH=$PATH:/home/me/morph_numsys/software/bin, then it works fine. [131030160060] |Any ideas how I can do this? [131030160070] |I'm on ubuntu and xterm. [131030170010] |When you say "for only this bash session", I assume you mean the bash session that is calling the script. [131030170020] |When you execute your script, it gets a new shell environment. [131030170030] |Thus when you export variables, you are exporting it to the new shell environment and not its parent environment. [131030170040] |As far as I know, there is no way to access the parent environment. [131030170050] |However, since you are using bash, there may be a few solutions: [131030170060] |Use source [131030170070] |Rather than execute the script like this: /path/to/init.sh do source /path/to/init.sh [131030170080] |From the bash man page: [131030170090] |source filename [arguments] [131030170100] |Read and execute commands from filename in the current shell environment and return the exit status of the last command executed from filename. [131030170110] |Make your script a shell function and put it in .bashrc [131030170120] |Another option is to make init a function and put it in .bashrc like this: [131030170130] |Then from the terminal you can just run init. [131030180010] |Kill an unresponsive ssh session without closing the terminal [131030180020] |Is there a way to disconnect from an SSH session that has become unresponsive without killing the whole terminal? [131030180030] |Specifically I'm using konsole, and the machine I'm working with sometimes hangs, but doesn't actually die (thus killing the connection). [131030180040] |So SSH just hangs and I have to close the terminal and open a new one to try to ssh back into it or do anything else. [131030180050] |Is there a way to effectively ctrl+c out of an ssh session? [131030190010] |One way is to use the ssh escape character. [131030190020] |By default this is "~", but it can be set manually with -e option when invoking ssh or via EscapeChar in your ssh config. [131030190030] |To kill the hung session this will often work: [131030190040] |~. [131030190050] |As pointed out by Gilles this is only recognized immediately after hitting Enter. [131030200010] |How can I enforce quotas on roaming user profiles using samba? [131030200020] |I am using a custom configuration of webmin from www.turnkeylinux.org to run a domain controller (basically Ubuntu Server 8.04/Hardy with Samba installed from the repositories). [131030200030] |I've set things up so that my users have roaming profiles that they can use at any of the windows clients that are joined to the domain. [131030200040] |I'd like to set a disk quota for each user that the windows client would enforce, one way or another. [131030200050] |That is, when they login and Samba downloads the users profile information the client, Samba would also send information about disk quota limits. [131030200060] |This way, if the user tries to download too many mp3s for example, windows will complain and prevent the user from using any more space. [131030200070] |I've tried setting a quota on the samba server with the quotas package, but that only creates log off problems when the user goes over their limit. [131030200080] |I think I can use the smbcquotas command in conjunction with windows' own quota tools, but I don't have the foggiest notion on how I might do this. [131030200090] |So my question is, can I get windows to enforce quotas on a per user basis using the samba server? [131030210010] |From this article it appears that I can limit the size of roaming profiles with Group Policy Objects. [131030210020] |At this point, I'm assuming that I will now have to set up LDAP in order to facilitate GPOs. [131030220010] |Do symbolic links actually make a difference in disk usage? [131030220020] |I've read in so many websites that, in Linux, symbolic links (soft links, symlinks) are just like pointers that reference another file, which may be located anywhere (like Windows shortcuts). [131030220030] |However, when I check the disk usage of a folder in which there are symbolic links, there's a mismatch between what my file manager says and what du reports. [131030220040] |However, if I type du -L (-L, --dereference; dereference all symbolic links from the man page), the output of du -L and the size that my file manager reports are the same. [131030220050] |My question is: if I have a softlink to a big file in, for example, my separate home partition, will I have any problems? [131030220060] |Example: [131030220070] |My /var/tmp folder is now plain empty. [131030220080] |Let's create a file: [131030220090] |And my file manager (Thunar, in this case) reports [131030220100] |Size: 1 item, totalling 163.0 kB [131030220110] |All right. [131030220120] |Now, lets create a really big file in /tmp and a symlink to it: [131030220130] |Everything is fine for now. [131030220140] |But if I open my file manager: [131030220150] |Size: 2 items, totalling 570.3 kB [131030220160] |And, finally: [131030220170] |If the partition in which /var/tmp is located is 1 GiB big, and I create a link in it to a 1 GiB file, ¿will my hard disk die? [131030220180] |I know that du will output 168 and Thunar 1 GiB, but I don't know which is right. [131030230010] |Symbolic links do take room, of course, but just the room it takes to store the name and target plus a few bytes for other metadata. [131030230020] |The space taken by a symbolic link does not depend on the space taken by the target (after all, the target is not even required to exist). [131030230030] |Plain du reports the space taken by a directory tree on the disk. du -L reports the space that would be taken by a directory tree if all symbolic links were replaced by their target. [131030230040] |The former is usually the useful information; for example, it's the space you'd recover if you deleted the tree, and it's (approximately) the space you need to back up the tree. [131030230050] |du on a directory tree shows (usually) a little more than the total of the file sizes. [131030230060] |That's due to two things. [131030230070] |First, du also counts directories, which take a little room to store file names and metadata. [131030230080] |Second, du counts the disk space taken by a file, which can be different from the file size: the most common effect is that files take up an integer number of blocks (4kB on typical Linux installation), so a 1-byte file can show as 4kB in du output; but compression (such as the primitive form provided by sparse files on just about every unix filesystem) can make the file size less than its disk usage. [131030230090] |From the numbers you give, it appears that Thunar reports the sum of the sizes of the files in the directory tree, following symbolic links. [131030230100] |It's actually saying so in a subtle way — it's claiming that the total size is 570.3 kB, not that the disk usage is 570.3 kB. [131030230110] |What is not at all apparent from the user interface or documentation is that Thunar follows symbolic links when computing the size. [131030230120] |Which one is “right” is a subjective matter. du reports disk usage. [131030230130] |Thunar reports total size following symbolic links. [131030230140] |Creating a symbolic link has a negligible impact on disk usage, but by definition does change total size following symbolic links which Thunar reports. [131030240010] |I think by default your file manager is trying to get the size of the files that the soft links are pointing to. [131030240020] |Whereas "du" gives you the size of the directory and the soft links themselves but not the files they are pointing to. [131030240030] |To clarify, [131030240040] |du -> size of directory + size of all the softlinks du -L -> size of directory + size of all the files that the softlinks are pointing to. [131030240050] |I'm not sure if this is what you were asking, but if it is, then I believe this could be the answer to your question. [131030250010] |Sunrise and other astronomical data from the command line [131030250020] |Is there a simple open-source, command-line program that can show the sunrise and sunset times at a given date and location, and perhaps moon and planet data as well? [131030250030] |Browsing the Debian package database and Google searches, I can't find anything relevant. [131030250040] |This surprises me — considering the number of people who are both astronomy geeks and unix geeks, I'd have expected a de-facto-standard sunrise(1) (or perhaps sunrise(6)). [131030250050] |I am not interested in more complex programs that incidentally perform the calculations, such as sky maps (celestia, kstars, starplot, stellarium), earth maps (sunclock, xplanet), calendars/agendas (emacs, remind), clocks (glunarclock, wmsun), tide almanachs (xtide). [131030250060] |There is perhaps aa (astronomical-almanac), but I don't see a simple way of asking it what time the sun will rise on this date at these longitude and latitude. [131030250070] |What did I miss? [131030260010] |Did you try sunwait? [131030260020] |http://www.risacher.org/sunwait/ [131030260030] |Sunwait is a small C program for calculating sunrise and sunset, as well as civil, nautical, and astronomical twilights. [..] [131030270010] |Check out this Linux Home Automation site and search the page for "sunrise". [131030270020] |There are some command line programs there from c. 1985 that are pretty minimalist. [131030270030] |I have the source code for a number of related programs from that era, but I can't find them on the web. [131030270040] |Update: I just found the source for a few others, including sdate, on this Event Logger page. [131030270050] |Search the page for "rise_set". [131030280010] |I ended up using Perl's DateTime::Event::Sunrise, because it tends to be easier for me to deploy a module from CPAN than to compile C programs. [131030280020] |Sample usage: [131030280030] |My sunrise script. [131030290010] |List installed packages in Fedora [131030290020] |I used to use yum to list all installed packages: [131030290030] |Now I need to list top level packages only i.e. if a package is a dependency of another, it should not be shown. [131030290040] |GNOME's Add/Remove Software can do this but I need the output in a terminal. [131030290050] |I checked yum manual but I could not find a switch for that. [131030300010] |You can use the tool package-cleanup which is part of yum-utils. [131030300020] |Besides finding packages which are not available from the current yum repositories, finding packages with broken dependencies, pruning old kernels and finding duplicate packages it can also find packages on which no other packages depend. [131030300030] |Those are called leaves. [131030300040] |Do [131030300050] |to get package-cleanup and [131030300060] |to get a list of all leaves. [131030310010] |Why change default ssh port? [131030310020] |I've noticed lot of admins change default ssh port. [131030310030] |Is there any rational reason to do so? [131030320010] |The most likely reason is to make it harder for people randomly trying to brute force any SSH login they can find. [131030320020] |My internet-facing machine uses the default SSH port, and my logs used to be filled with stuff like this (excerpted from an actual log file): [131030320030] |These days I use DenyHosts to block IPs that fail to authenticate too many times, but it's probably just as easy to just switch ports; virtually all brute force attacks of this kind aren't going to bother scanning to see if your sshd is listening on another port, they'll just assume you're not running one and move on [131030330010] |No, it's a security by obscurity tactic. [131030330020] |If your sshd setup is not fit enough to face dump script kiddies only trying port 22, you have a problem anyway. [131030330030] |A more rational reaction would be: [131030330040] |
  • make sure that your users are using good passwords which are hard to guess/brute-force
  • [131030330050] |
  • disable password-authentication (at least for important accounts) and just use public-key-authentication
  • [131030330060] |
  • watch out for ssh-security issues and upgrades
  • [131030340010] |Sshguard is a much better way to protect against brute force attacks. [131030350010] |How to align applets on Gnome panel [131030350020] |Does anyone know how to align applets on Gnome panel? [131030350030] |For example I add notification area and there's five icons (you see it on the left of processor icon). [131030350040] |Then, I plug my BlueTooth adapter out of my laptop and it's logo disappears, leaving blank space on the right side of applet. [131030350050] |Here's screenshot: [131030350060] |Same happens with any applet that's width can change (for example tray). [131030350070] |Is there any way to tell applet "Move right as far as you can". [131030360010] |There is a feature request in Gnome's bugzilla asking for a way to do this, so it seems it is not possible at the moment. [131030360020] |For now, what you can do is arrange all icons which are always visible at the very right of the panel and lock them (Rightclick->Lock to panel). [131030360030] |Then the icons which may vanish at least don't interrupt their position. [131030370010] |How does searching a file (locate) or autocompletion work? [131030370020] |Hi, I am a Windows user and coming from Windows with all the indexing and eternal wait times when searching for files, I find it surprising how fast does locate work or the autocompletion (that I know) work in linux. [131030370030] |Is there any indexing being done in the background or how is this achieved? [131030370040] |I still have a pretty clean installation, so maybe this goes bad with time, but in Windows the moment you want to search on a folder which is not indexed you have to wait for some seconds. [131030370050] |Thanks [131030380010] |Usually, locate uses an index which is generated once a day via a cron-job (/etc/cron.daily/mlocate on my system for example). [131030380020] |It does nothing fancy, basically a complete filesystem traversal with some optimizations and the building of the index data structure. [131030380030] |Shells use probably some internal caching for command completion, but does not use a global index file. [131030380040] |Besides, usually, Unix kernels maintain a dentry-cache, i.e.\ they cache file directory information used by directory listings etc. in memory (including the stat'ing of non-existent files - which is also called inverse caching). [131030390010] |I find it surprising how fast does locate work or the autocompletion (that I know) work in linux. ... [131030390020] |Is there any indexing being done in the background or how is this achieved? [131030390030] |This is actually two completely distinct questions. [131030390040] |locate uses an index (slocate stores it in /var/lib/slocate/), that is updated by a nightly cron job. [131030390050] |This nightly job typically runs at about 1 or 2AM local time, and completely scans your entire system (including all connected drives). [131030390060] |The resulting index is simply a list of filenames. [131030390070] |Auto-complete is handled by your shell. [131030390080] |Most systems use bash, so bash-completion is the collection of scripts that manage how this works. (zsh has a similarly-named collection, and most of the other shells have some form of completion built-in.) [131030390090] |When Tab is pressed, the shell runs a script that decides, based on what you've typed already, what, exactly, needs to be completed. [131030390100] |The script then generates a list of possible completions, which may or may not be the list of files in the current directory, or the list of executable files in your $PATH. [131030390110] |The locate command is normally not used for this. [131030400010] |What's the best way to configure shared filesystem directories? (beyond standard unix perms) [131030400020] |I have multiple users on my system. [131030400030] |I'd like to have shared directories like music, video. pictures etc. [131030400040] |The problems is that I want users to be able to write any new files to any directory, but not be able to delete or modify any files they don't own. [131030400050] |With standard unix perms if you can add a file to a directory you can also delete others. [131030400060] |I'd also like to make sure all the files in these directories are always readable by the user group. [131030400070] |Can I do this with POSIX ACL's? or do I need something more advanced like SELinux (or other security framework). [131030400080] |example of what I don't want to work. [131030410010] |If I understand you correctly you want for your music/video etc. directories the same semantic as for /tmp. [131030410020] |For this, you could put the sticky bit on the directories. [131030410030] |To quote from the chmod man-page: [131030410040] |RESTRICTED DELETION FLAG OR STICKY BIT The restricted deletion flag or sticky bit is a single bit, whose interpretation depends on the file type. [131030410050] |For directories, it prevents unprivileged users from removing or renaming a file in the directory unless they own the file or the directory; this is called the restricted deletion flag for the directory, and is commonly found on world-writable directories like /tmp. [131030420010] |using sudo on GUI applications [131030420020] |When I was using kubuntu, I could always open X applications with sudo, sudo kate for example. [131030420030] |Now that I've switched to arch that doesn't work. [131030420040] |I know I've always been told to use kdesu, but what setting is there in kubuntu that lets me use sudo on X apps that prevents me from doing it on arch? [131030420050] |Edit: Sorry, I did myself what I hate so much >_< [131030420060] |This is what I'm trying to do: [131030420070] |Note this is just a regular terminal session using konsole, I'm not using SSH [131030420080] |/etc/sudoers: [131030430010] |This looks like an intentional configuration in Arch Linux. [131030430020] |See https://bbs.archlinux.org/viewtopic.php?pid=817103 for discussion with links to solutions. [131030430030] |The best tip there seems to be adding "DISPLAY XAUTHORITY" to to the "env_keep" defaults in /etc/sudoers. [131030430040] |Fedora has in /etc/sudoers the following and this allows sudo somexapp to succeed. [131030440010] |Graphical programs should not be run with sudo. [131030440020] |The correct way is to use kdesudo in KDE for running GUI programs as root, or gksu in GNOME. [131030440030] |Running graphical programs as root has the potential to cause serious issues, that is why the wrappers are provided. [131030440040] |Read this Arch mailing list thread for a serious issue that you could encounter trying to trick sudo into launching a GUI app. [131030450010] |LS_COLORS settings for specific types of files [131030450020] |I'm trying to set up my color scheme for ls, and I'm having trouble finding information about exactly what parameters I have to work with, or where those come from. [131030450030] |And especially setting colors for types of files instead of based on filetype. [131030450040] |For example, this is my current color scheme: LS_COLORS='di=34;01:fi=0:ln=96;1:pi=36;1:so=31;1:bd=5:cd=5:or=31:mi=0:ex=35' [131030450050] |I found those parameters (di, fi, etc) from a website tutorial. [131030450060] |But where do those come from? [131030450070] |Can I set custom ones? [131030450080] |I know I can set colors like *.jpg=0 and such. [131030450090] |But is there a way to do it based on types of files? [131030450100] |I specifically want to set compressed file types, but if I have to do it by recognizing filetypes, I feel there's a better way. [131030460010] |Try the dircolors command. [131030460020] |It can print the default colors to standard output. [131030460030] |You can use this output to modify the defaults and generate a suitable "LS_COLORS=...-line" again with dircolors. [131030460040] |Say you want all compressed files which are bright red by default to be bright green instead, then you'd do [131030460050] |then you scroll to the section including the compressed files and modify the values from 01;31 to 01;32. [131030460060] |Then call [131030460070] |to generate the "LS_COLORS=..."-line for you with the modified values. [131030470010] |Is there a way to empty the trash/wastebasket from the command line? [131030470020] |This would be great especially considering the latest version of Ubuntu is very slow when displaying directories on my PC... [131030480010] |There is no such thing like a system trash in Linux, but its common for many desktop environments to use ~/.Trash as trash folder. [131030480020] |This depends on the window manager you are using. [131030480030] |For Gnome you can empty this folder with: rm -rf ~/.Trash/* [131030490010] |At least in Debian and Ubuntu, you can install the trash-cli package. [131030490020] |This provides a number of commands for working with FreeDesktop.org Trash Specification compliant trash cans, like GNOME's. [131030490030] |To remove all trashed files, use emtpy-trash. [131030490040] |It can also just remove files that have been in the trash more than a certain number of days. [131030490050] |Use empty-trash x, where "x" represents the number of days. [131030490060] |I personally have set up a cron job that runs daily to get rid of trash over a week old. [131030500010] |What are stripped and not-stripped executables in Unix? [131030500020] |From man file, [131030500030] |What does executable stripping mean? [131030500040] |Why are some of the executables stripped while others are not? [131030510010] |If you compile an executable with gcc's -g flag, it contains debugging information. [131030510020] |That means for each instruction there is information which line of the source code generated it, the name of the variables in the source code is retained and can be associated to the matching memory at runtime etc. [131030510030] |Strip can remove this debugging information and other data included in the executable which is not necessary for execution in order to reduce the size of the executable. [131030520010] |What is the Linux equivalent of bootinfo command? [131030520020] |bootinfo for AIX: [131030520030] |...shows whether the hardware in use is 32-bit or 64-bit. [131030520040] |What command/utility for Linux would do this job? [131030530010] |Usually uname -m should do the trick, as should arch. [131030530020] |The output of both of these commands will tell you the architecture for which the kernel was built. [131030530030] |Whether this is 32 or 64 bit is usually pretty clear (x86_64 and ia64 are two possible 64-bit architectures). [131030530040] |However, note that you could have a 32-bit kernel while running on 64-bit hardware. [131030530050] |If you really want to know about the hardware try looking at either [131030530060] |less /proc/cpuinfo [131030530070] |if the "flags" line has 'lm' in it, then it is 64 bit. [131030530080] |Or, if you have lshw [131030530090] |lshw -class processor [131030530100] |and look at the "width" line. [131030530110] |For both of these options, grep can be employed to quickly get the answer without looking at the output. [131030540010] |There are several possible answers depending on what exactly you want to know (I don't know which one AIX's bootinfo corresponds to). [131030540020] |
  • You can see whether the CPU is 64-bit, 32-bit, or capable of both by checking the flags line in /proc/cpuinfo. [131030540030] |You have to know the possible flags on your architecture family. [131030540040] |For example, on i386/amd64 platforms, the lm flag identifies amd64-capable CPUs (CPUs that don't have that flag are i386-only).
  • [131030540050] |
  • You can see whether the kernel is 32-bit or 64-bit by querying the architecture with uname -m. [131030540060] |For example, i[3456]86 is are 32-bit while x86_64 is 64-bit. [131030540070] |Note that on several architectures, a 64-bit kernel can run 32-bit userland programs, so even if the uname -m shows a 64-bit kernel, there is no guarantee that 64-bit libraries will be available.
  • [131030540080] |
  • You can see what is available in userland by querying the LSB support with the lsb_release command. [131030540090] |More precisely, lsb-release -s prints a :-separated list of supported LSB features. [131030540100] |Each feature has the formm module-*version*-architecture. [131030540110] |For example, availability of an ix86 C library is indicated by core-2.0-ia32, while core-2.0-amd64 is the analog for amd64. [131030540120] |Not every distribution declares all the available LSB modules though, so more may be available than is detectable in this way.
  • [131030540130] |
  • You can find out the preferred word size for development (assuming a C compiler is available) by compiling a 5-line C program that prints sizeof(void*) or sizeof(size_t).
  • [131030550010] |Finding the offset for ext4 partition [131030550020] |I've created an image of my hd with dd, but grub was installed on it, and I'm trying to figure out how to mount the image file, but mount doesn't recognise it as an ext4 partition because of the grub header. [131030550030] |I know it's there because when I run file -k disk.img, I get the following: [131030550040] |Anyone have any thoughts as to how I could find the beginning of the partition so that I can tell mount (well, losetup really) where the offset is to load the partition? [131030560010] |Parted should be able to read disk image from file and interpret the partition table. [131030560020] |So use [131030560030] |For my (testing) disk image it gives: [131030560040] |You can see which sector each partition starts (and ends) at. [131030570010] |I found out the problem wasn't related to grub at all. [131030570020] |The image had errors in it, and the fix involved running e2fsck. [131030580010] |different ways to execute a shell script [131030580020] |There a several ways to execute a script, the ones I know are: [131030580030] |Are the more of this? [131030580040] |What are the differences between them? [131030580050] |Are there situations that I must use one and not another? [131030590010] |I am pondering if there are more... [131030590020] |. and source are the same. [131030590030] |After execution any changes of environment in script would be kept. [131030590040] |Usually, it would be used to source a Bash library, so the library can be re-use in many different scripts. [131030590050] |Also it's a good way to keep current directory. [131030590060] |If you change directory in script, it won't be applied in the shell which you execute that script. [131030590070] |But if you source it to run it, after the script exits, the current directory will be kept. [131030600010] |Another way is by calling the interpreter and passing the path to the script to it: [131030600020] |The dot and source are equivalent. [131030600030] |(EDIT: no, they're not: as KeithB points out in a comment on another answer, "." only works in bash related shells, where "source" works in both bash and csh related shells.) [131030600040] |It executes the script in-place (as if you copied and pasted the script right there). [131030600050] |This means that any functions and non-local variables in the script remain. [131030600060] |It also means if the script does a cd into a directory, you'll still be there when its done. [131030600070] |The other ways of running a script will run it in its own subshell. [131030600080] |Variables in the script are not still alive when it's done. [131030600090] |If the script changed directories, then it doesn't affect the calling environment. [131030600100] |/path/to/script and /bin/sh script are slightly different. [131030600110] |Typically, a script has a "shebang" at the beginning that looks like this: [131030600120] |This is the path to the script interpreter. [131030600130] |If it specifies a different interpreter than you do when you execute it, then it may behave differently (or may not work at all). [131030600140] |For example, Perl scripts and Ruby scripts begin with (respectively): [131030600150] |and [131030600160] |If you execute one of those scripts by running /bin/sh script, then they will not work at all. [131030600170] |Ubuntu actually doesn't use the bash shell, but a very similar one called dash. [131030600180] |Scripts that require bash may work slightly wrong when called by doing /bin/sh script because you've just called a bash script using the dash interpreter. [131030600190] |Another small difference between calling the script directly and passing the script path to the interpreter is that the script must be marked executable to run it directly, but not to run it by passing the path to the interpreter. [131030600200] |Another minor variation: you can prefix any of these ways to execute a script with eval, so, you can have [131030600210] |and so on. [131030600220] |It doesn't actually change anything, but I thought I'd include it for thoroughness. [131030610010] |. and source are equivalent in that they don't spawn a subprocess but execute commands in the current shell. [131030610020] |This is important when the script sets environment variables or changes current working directory. [131030610030] |Using the path or giving it to /bin/sh creates a new process in which commands are executed. [131030620010] |Does "userland exec" count as a different way? [131030620020] |Userland exec loads code and gets it to execute without the use of an execve() system call. [131030630010] |Most people debug shell scripts by adding the following debuging flags to the script: [131030630020] |But this means you need to open the file with an editor (assuming you have permissions to edit the file), adding a line like set -x, save the file, then execute the file. [131030630030] |Then when you are done you need to follow the same steps and remove the set -x, etc. etc. [131030630040] |This can be tedious. [131030630050] |Instead of doing all that, you can set the debugging flags on the commandline: [131030640010] |Runs the script in the current shell when the directory is not in the path. [131030650010] |Shawn J. Goff made a lot of god points, but I guess here is missing a bit for the whole story: [131030650020] |Ubuntu actually doesn't use the bash shell, but a very similar one called dash. [131030650030] |Scripts that require bash may work slightly wrong when called by doing /bin/sh script because you've just called a bash script using the dash interpreter. [131030650040] |A lot of system scripts (like in init.d, in /etc and so on) have a shebang #!/bin/sh , but /bin/sh is in fact a symbolic link to another shell - in former times /bin/bash, nowadays /bin/dash. [131030650050] |But when one of them is invoked as /bin/sh, they behave differently, i.e. they stick to POSIX-compatibility-mode. [131030650060] |How do they do this? [131030650070] |Well, they inspect how they were invoked. [131030650080] |Can a shellscript itself test how it was invoked, and do different things, depending on that? [131030650090] |Yes, it can. [131030650100] |So the way you invoke it can allways lead to different results, but of cause it is seldom done to annoy you. :) [131030650110] |As a rule of thumb: If you're learning a specific shell like bash, and write commands from a bash tutorial, put #!/bin/bash in the headline, not #!/bin/sh , except where otherwise noted. [131030650120] |Else your commands might fail. [131030650130] |And if you haven't written a script yourself, invoke it directly (./foo.sh, bar/foo.sh) instead of guessing a shell (sh foo.sh, sh bar/foo.sh). [131030650140] |The shebang should invoke the right shell. [131030650150] |And here are two other kinds of invokation: