[131092440010] |Turning an old computer into a network firewall... [131092440020] |I have an old Dell Dimension with two ethernet cards, and I need to turn it into a firewall. [131092440030] |I've tried FireStarter and IPCop, but I don't think I'm setting them up right. [131092440040] |Here's the setup that I'm trying to accomplish: I need to have one ethernet card plugged directly into the modem, and the other ethernet card plugged into a 16-port switch/hub. [131092440050] |Part of the problem is that I've never done this before and despite hours of Googling, I'm still not sure where to start. [131092440060] |I don't need anything fancy or endlessly configurable - I just need some basic protection that I can tweak out later. [131092440070] |The bottom line is that it's 10:45p, everyone else left the office at 5p, and I'm still trying to get this taken care of. [131092440080] |Thanks in advance for any help. [131092450010] |for sheer ease of use, I can recommend Smoothwall. [131092450020] |I used it many years ago, and it was great then. [131092450030] |Just install it following the prompts, and you're done. [131092450040] |Of course, you can tweak it and fiddle with it if you want to, but you probably won't need to unless you have unusual requirements. [131092450050] |It's very good. :) [131092460010] |Basic routing: [131092460020] |You'll probably want an iptables rule in place : [131092460030] |For the rest, I'll refer you to a Server Fault question on the same topic that I answered. [131092470010] |I'm using IPCop at home just like you describes it. [131092470020] |It is not really that updated, but it is stable and does it's work well. [131092470030] |
  • Make sure that he recognise the hardware, the two network cards.
  • [131092470040] |
  • Red interface should be the one with the WAN / modem
  • [131092470050] |
  • Green interface is your home LAN.
  • [131092480010] |How intelligent are unix utilities? [131092480020] |Unix utilities like sort, find, grep, diff et al are very handy to perform quick tasks, sometimes without writing any code at all. [131092480030] |I wanted to know what algorithms do they internally use and how do intelligently decide a specific algorithm for a specific task? [131092480040] |For example if sort gets a huge input file, will it use different algorithms for different data sizes? [131092480050] |Does grep intelligently switch algorithms while searching different data sets? [131092490010] |Unix is just a standard, it specifies what the implementations should do, but not how they should do it. [131092490020] |Therefore implementations of grep/sort/find will most likely use different approaches on different systems (and even one system, like Linux, there are concurrent implementations). [131092490030] |For Linux, you can always look into the source code. [131092500010] |I wanted to know what algorithms do they internally use and how do intelligently decide a specific algorithm for a specific task? [131092500020] |For example if sort gets a huge input file, will it use different algorithms for different data sizes? [131092500030] |That is an interesting question (+1 for that). [131092500040] |I have no clue as to what the answer is, but if I were you, I'd look at the source code of typical GNU utilities to get an idea of their algorithms. [131092500050] |Does grep intelligently switch algorithms while searching different data sets? [131092500060] |I don't think so. [131092500070] |Don't quote me since I cannot really tell you with 100% certainty, but I really don't think so. [131092500080] |The UNIX philosophy of things is that one thing does one thing and one thing only. [131092500090] |That's why we have several versions of grep (grep, egrep, fgrep). [131092500100] |Also, the idea is to do one thing and only one thing at run-time. [131092500110] |Different behavior and algorithms can be configured as command-line arguments, so that the same program can act slightly differently (and possibly slightly more optimized) between runs. [131092500120] |Good examples are the wc and diff command. [131092500130] |However, the behavioral adaptation is configuration-based (via cmd line arguments); they don't change/adapt behavior at run-time. [131092500140] |It is typically an unnecessary complexity for the type of artifacts the UNIX tools aim to be. [131092500150] |Such complexity is more appropriate of more complex, less general purpose tools IMO. [131092510010] |Does grep intelligently switch algorithms while searching different data sets? [131092510020] |I don't think so, but it does switch to the "fast" non-RE algorithm when given the -f flag (or invoked as fgrep). [131092520010] |The UNIX standard doesn't specify implementation details for the standard system tools, except for really rare cases. [131092520020] |You can find the latest Single Unix Specification vesion here(warning: registration required). [131092520030] |With that in mind, every UNIX(System V and direct descendants like BSD, Solaris, Mac OS X, etc..) or UNIX based Operating System (far descendants or alikes: Linux, Minix) has its own implementations of the utilities described in the UNIX specification. [131092520040] |For eg. take a look at FreeBSD's and Linux/GNU Coreutils. [131092520050] |Beware that some tools are separate whole project by themselves like GNU diff or GNU grep. [131092520060] |Also another fact is that some implementations of these tools might find their way into other UNIX like systems as standard then the ones they were initially written for, for e.g. some gnu coreutils in freebsd or GCC. [131092520070] |Bonus: To wrap your head around the UNIX family tree, take a look at this graph. [131092530010] |You may be interested in this mailing list post by the original GNU grep author which explains a few of the GNU grep optimizations. [131092530020] |Another enjoyable exploration by ridiculous_fish (author of Hex Fiend) [131092540010] |Why does my Fedora 14 system with an Intel Mobile GME965/GLE960 Integrated Graphics Controller come up with the wrong aspect ratio? [131092540020] |I have a: [131092540030] |Compaq 610 VC275EA 15,6" WXGA i CELERON T1500 [131092540040] |and I installed Fedora 14 on it. [131092540050] |Everything is great, except one: the aspect ratio of the screen is not very good :\ [131092540060] |http://bit.ly/e18LgF http://pastebin.com/raw.php?i=dCbg5qNt http://pastebin.mozilla.org/1165203 [131092540070] |Can someone please say, that it cannot be fixed, or say: yes, it could be fixed, do xy, read xy, etc. :\ This is an issue for me for months now.. :\ Please help [131092550010] |From your linked information, it appears you have an Intel GME965 integrated graphics controller. [131092550020] |It appears the driver for that isn't working and you're getting the generic VESA driver. [131092550030] |I suspect you're hitting this bug: [131092550040] |https://bugzilla.redhat.com/show_bug.cgi?id=650888 [131092550050] |This suggests that the installer (incorrectly) put a nomodeset line in /boot/grub/grub.conf. [131092550060] |Edit that file (carefully) and remove that word wherever it appears. [131092550070] |Then, reboot and everything should Magically Just Work. [131092550080] |(If that doesn't, try also removing any xorg.conf — rm /etc/X11/xorg.conf, so that X starts with its defaults and automatic detection.) [131092560010] |What are you going to do with your OpenSolaris machines? [131092560020] |I have a file server running OpenSolaris (mainly for ZFS, which I really love), but since Oracle has abandoned it, I'm starting to think about what I'm going to do with the OS on that machine. [131092560030] |Assuming you have a machine like this and you're in a similar situation, what are your plans? [131092560040] |Switching to FreeBSD? [131092560050] |Holding out to see if Illumos takes off? [131092560060] |Nexenta? [131092560070] |I'm curious what other people are thinking on this. [131092570010] |I saw this coming about 6 months ago when I started playing with ZFS. [131092570020] |At the time, the next release of OpenSolaris was already way overdue, and I had yet to be impressed by the progress between any two releases I'd seen over the years I'd been watching the project. [131092570030] |It was clear to me that OpenSolaris wasn't winning hearts and minds, so by the time I started my ZFS adventure, it was already out of the running as far as I was concerned. [131092570040] |I ended up picking FreeBSD 8, for a bunch of reasons: [131092570050] |
  • Really, actually free-as-in-beer. [131092570060] |As opposed to the "free only if you need less than 4 TB" come-on offered by Nexenta.
  • [131092570070] |
  • Really, actually free-as-in-freedom. [131092570080] |I learned this lesson back when transitioning from Novell (!) [131092570090] |UnixWare to this new cool thing called Linux. [131092570100] |I spent an unholy number of hours on Usenet arguing with the UnixWare fans, trying to convince them that Linux was going to take over the *ix world. [131092570110] |The UnixWare fans would keep pointing out this little advantage or that; and they were right, UnixWare did have some technical advantages at the time. [131092570120] |They saw me surfing a wave behind their serious yacht and only saw the surfboard, and didn't realize that it would take a tsunami for me to be surfing that far out. [131092570130] |A decade later, we're still skimming the splinters of their yacht off the ocean surface. [131092570140] |I believe the same thing will happen to Solaris, sooner or later. [131092570150] |I have more than just SCO in mind when I make this prediction. [131092570160] |Think on how many other marginal Unices have already fallen and how embattled the remaining biggies —AIX and HP-UX —already are. [131092570170] |My only bit of unease here is that I'm not sure that FreeBSD won't also end up under the waves. [131092570180] |It could be that Linux + btrfs will someday take the ZFS advantage away from FreeBSD. [131092570190] |But, if it does, you still have the two freedoms to fall back on. [131092570200] |Consider the least popular of the BSDs, NetBSD: even complete marginalization isn't enough to destroy a truly free OS.
  • [131092570210] |
  • It ran on hardware Nexenta wouldn't. [131092570220] |This is more than just an anecdote, it's a reflection of the fact that some OSes get more driver support than others. [131092570230] |If this is your only criterion, of course, you'd run Windows, not *ix of any sort. [131092570240] |Since it isn't, you have to ask how far down the slope toward "truly rotten driver support" you'll allow yourself to slide. [131092570250] |Windows >Linux >FreeBSD >Solaris, in the driver support area.
  • [131092580010] |What are good online resources for learning shell scripting? [131092580020] |I am very new to shell scripting — just a beginner. [131092580030] |I have not yet hardly coded a single program, but i am interested to learn it completely. [131092580040] |Please, can anybody suggest to me some good resources over online which will guide me well? [131092590010] |This answer focuses on Bash. [131092590020] |Probably the advanced bash scripting guide can help you. [131092590030] |It has even be translated to French (on traduc.org). [131092590040] |Also read the pitfalls and the FAQ from Greg's wiki. [131092600010] |the best free source for shell scripting I've seen so far: http://fog.ccsf.cc.ca.us/~gboyd/cs160b/online/index.html [131092610010] |How to find the machine from which a user logged into current machine using ssh? [131092610020] |In a multi server architecture, is it possible to find out from which machine a user logged into current machine using ssh? [131092610030] |For example, user1 logged into host1. [131092610040] |From there, the user logged into host2 as sruser using ssh. [131092610050] |In above example, would it be possible to trace the sruser session of host2 back to user1 session in host1? [131092610060] |Would it be possible to get the hostname or terminal of user1 session? [131092620010] |Not sure about Solaris but on Linux lsof -u user | grep \:ssh should work fine [131092630010] |The who and last commands might be useful for displaying the host from which users are connected. [131092640010] |If you are an ordinary user on host2, you can see who is currently logged in from where with the who command, and who logged in from where in the past with the last command. [131092640020] |Both show the remote host name or IP address for ssh logins; this is usually host1, but can be a gateway that relayed the ssh connection. [131092640030] |It is in principle impossible to know who user1 is. [131092640040] |After all, host1 might not even be running a multiuser system, or might be an anonymous relay. [131092640050] |This doesn't mean user2 has absolute privacy amongst the known users of host1; for example, if you're the administrator on host2, and the user uses public key authentication, and you've configured the ssh server to dump information about the public key used, then you can find out the user's public key, and perhaps correlate it from information obtained elsewhere. [131092640060] |Some past questions on Super User may interest you: [131092640070] |
  • http://superuser.com/questions/202123/if-someone-is-signed-into-ssh-on-my-computer-can-i-access-their-computer
  • [131092640080] |
  • http://superuser.com/questions/174494/get-ssh-session-information
  • [131092650010] |install java on centos vps through ssh [131092650020] |Hello! [131092650030] |I'm a complete linux beginner so please keep your answer understandable for a noob :) I wrote a little java servlet and, in order to run it, acquired a VPS which runs Centos 5. [131092650040] |now, in order to run my servlet I guess the first thing to do is to install the latest JRE. [131092650050] |I have SSH access and googled the web for tutorials on how to install java through ssh but most of them are very old, have broken links, link to sun or are very confusing. [131092650060] |Can anyone give a simple step by step instruction on how to install the latest JRE through ssh? [131092660010] |You can install the OpenJDK right through the CentOS repositories, by running yum install java-1.6.0-openjdk as root. [131092660020] |If you must have the SunOracle Java packages, visit the java download page and follow the links for downloading the JRE. [131092660030] |The advantage of using the OpenJDK is that you get updates automatically through CentOS. [131092660040] |CentOS also has packages for Tomcat 5, if you were planning on using that. [131092670010] |stty: : Invalid argument [131092670020] |I am telnet-ing into a Solaris machine and I'm getting the above error with my scripts. [131092670030] |I realize this is a common problem, and the solution is to check for the line 'stty erase ^H' within my profile, but I can't find it. [131092670040] |.profile doesn't have any references to stty, and I don't have a .cshrc anywhere. [131092670050] |I performed a grep in my home directory, but I came up with nothing. [131092670060] |Is there another source of this problem? [131092670070] |All the solutions online refer to either .profile or .cshrc. [131092670080] |Thanks. [131092680010] |From csh man page: [131092680020] |A login shell begins by executing commands from the system files /etc/csh.cshrc and /etc/csh.login. [131092680030] |It then executes commands from files in the user's home directory: first ~/.tcshrc (+) or, if ~/.tcshrc is not found, ~/.cshrc, then ~/.history (or the value of the histfile shell variable), then ~/.login, and finally ~/.cshdirs (or the value of the dirsfile shell variable) (+). [131092680040] |The shell may read /etc/csh.login before instead of after /etc/csh.cshrc, and ~/.login before instead of after ~/.tcshrc or ~/.cshrc and ~/.history, if so compiled; see the version shell variable. (+) [131092680050] |So there are a couple of files where you could find this line [131092690010] |I had this, it was an stty in .kshrc. [131092690020] |Remember that .kshrc is sourced on all ksh scripts, interactive and non interactive. [131092690030] |If you run a script, stty will still fire, try to work on stdin, which is a file (not a tty now) and fail with an error. [131092700010] |To trace your profile, try invoking your login shell with a name beginning with - and with the option -x so that it prints . [131092700020] |To find out what your login shell is, run getent passwd $USER; your login shell is the last field on the line (usually /bin/something). [131092700030] |To invoke the shell with a name beginning with -, make a symbolic link whose name begins with - and run that. [131092700040] |For example, if your login shell is ksh: [131092700050] |I'm not sure if this will work with csh. [131092700060] |If you don't find anything interesting, look both in /etc and your dot files: [131092710010] |Automounting in KDE-3.5.10 without HAL [131092710020] |Hello, community! [131092710030] |I have Gentoo(amd64) installed with KDE-3.5.10 desktop from kde-sunset overlay. [131092710040] |Recently I have upgraded xorg-server from 1.7 to 1.9 and now want to extinguish hal completly. [131092710050] |The only reason that stops me is the device detection. [131092710060] |I don't know how to get automounting working in KDE-3.5.10 without HAL. [131092710070] |Oh, and K3B too. [131092710080] |Installed version is 1.0.5. [131092710090] |The only packages which uses "hal" USE flag are: [131092710100] |and they certainly can be compiled without "hal" flag. [131092710110] |But then automounting stops working and when I insert USB flash drive there is no pop-up window. [131092710120] |Of course I can still mount it manually, but it feels uncomfortable. [131092710130] |Didn't check if K3B can find recording device when compiled without "hal" USE flag, though. [131092710140] |But suspect there could be difficulties too. [131092720010] |Is there a tool that lets me share internet connection through Wifi? [131092720020] |I really like OS X's ability to share the internet connection through everything within several mouse clicks, but it seems that the Mac is doing something funny that prevents Linux machines from connecting. [131092720030] |Is there a Linux software that lets me do the same thing, or at least to a certain degree? [131092720040] |For those who don't know, from Mac's internet sharing settings, you choose the interface with the connection that should be shared (in), then choose the interface(s) that should be used to share (out). [131092720050] |The machine will then make the changes and make the connection available through the out interface(s). [131092720060] |You can also choose a password for WEP wireless encryption. [131092720070] |Needless to say, when done you can stop sharing. [131092720080] |Today I come across a script that shares the connection through Wifi, but as such it won't be easy to enable and disable sharing, let alone changing the options. [131092720090] |I know it's unlikely to get something as full-featured as I described for free, so please fire off all your suggestions. [131092730010] |OpenSuSe has an administration UI called Yast that allows to setup internet sharing very easily. [131092730020] |http://en.opensuse.org/ICS [131092730030] |Other distributions should have similar tools. [131092740010] |Where can I find the source code for `uptime`? [131092740020] |I am learning Python. [131092740030] |Till now I've been doing only basic Python coding. [131092740040] |A day ago, I checked python implementation of tree command. [131092740050] |Suddenly I thought of creating a Python clone for uptime. [131092740060] |I don't have any clue about which language it is implemented in and what would be the complexity involved in cloning it. [131092740070] |But I couldn't find its source code. [131092740080] |I am using Fedora 14. kernel-devel package is installed. [131092740090] |I did whereis uptime but the resulting /usr/bin/uptime file shows weird symbols when opened using vim. [131092740100] |Googling for its source code couldn't yield desired results either. [131092740110] |Where can I find its source code? [131092750010] |Uptime is part of the 'procps' package, the upstream source is at http://procps.sourceforge.net/ (Not a fedora user, so not sure where to find their .src.rpm). [131092750020] |To answer the question you didn't ask, however; take a look in /proc/uptime The first number is seconds since boot. [131092750030] |You should be able to turn that into something usable fairly easily :) [131092760010] |In general, on a RPM-based distribution like Fedora, you can find the name of the package which provides a given command with rpm -qf /path/to/command. [131092760020] |Like this: [131092760030] |You can then download the source RPM with yumdownloader --source procps. (yumdownloader comes from the yum-utils package, if you don't have that installed already.) [131092760040] |Once you have the src.rpm, you can unpack it with either rpm -i or with rpm2cpio. [131092760050] |Alternately, in many cases you can query the RPM package for the project URL, which may helpfully point you to the upstream source: [131092760060] |And, cool, there's the code conveniently browsable online. [131092760070] |If you follow through it, basically all it does is read /proc/uptime and print it prettily. [131092770010] |How can I specify OS-conditional build requirements in an RPM spec file? [131092770020] |I am trying to work my way around with the BuildPrereq flag in the spec files. [131092770030] |I want a few pre-requisites to be included if the OS is of a particular version. something like [131092770040] |Is there any way to achieve the above ? [131092770050] |Also I would like to hear some alternatives on this. [131092770060] |The problem being i have a section of the code which is not required to be compiled on a few versions of OS. [131092770070] |So i am looking at mixing conditional compilation and the above. [131092770080] |Cheers! [131092780010] |To translate what you wrote directly into specfile macros: [131092780020] |You could probably change the first %endif to an %else but I wanted to keep my rewrite as similar as possible in case there are other circumstances involved. [131092780030] |If you want to support versions of fedora between fc4 and f10 or later, you can use >= and <= as well. [131092780040] |If you care about RHEL, there's a %{rhel} that evaluates as 4 for RHEL4 and 5 for RHEL5. [131092790010] |Make diff Use Full Terminal Width in Side-by-Side Mode [131092790020] |Most applications are smart about using the full width of the terminal available to them. [131092790030] |My shell does, screen, vim, etc. [131092790040] |However, diff in side-by-side mode (-y), does not. [131092790050] |This angers me. [131092790060] |It uses 126 character width, which is not even half of my 270 block width terminal. [131092790070] |Looking through the man page does not reveal anything particular about automatically adjusting the width, only manually specifying it via -W. [131092790080] |Is there perhaps a "hidden feature" of diff to allow it to automatically expand to the full width of the terminal? [131092790090] |Or; What is the easiest path to automatically inserting -W into my diff command whenever I run it? [131092790100] |I am under the assumption that automatically appending -W to everything couldn't hurt anything, because it will only ever mean "use $x columns", which is always what I want, whether I'm in side-by-side mode, or otherwise. [131092800010] |ought to do it. [131092800020] |You'll want to add it to ~/.bashrc as well. [131092800030] |The - 2 is mainly paranoia, in case something (embedded double-width Unicode?) expands enough to make the line wrap; if you want, you can just use [131092810010] |Xvideo extension not active with the radeon driver [131092810020] |On my computer running Debian squeeze with the radeon driver, the XVideo extension doesn't work (the extension itself is there but the hardware is not supported). xvinfo shows [131092810030] |The adapter is a Gigabyte Radeon X1650, shown by lspci as [131092810040] |The kernel driver is loaded, as lsmod | grep radeon shows: [131092810050] |The required (?) (non-free) firmware also seems to be loaded. [131092810060] |From my kernel logs: [131092810070] |XVideo worked under Debian lenny. [131092810080] |After upgrading to squeeze (Linux kernel: 2.6.32-5-vserver-amd64; xserver-xorg-video-ati 6.13.1-2+squeeze1) it doesn't. [131092810090] |How do I get it back? [131092810100] |(link to the X server logs) [131092820010] |I'm not sure if this will help, but I found this post: [131092820020] |
  • http://swinky-linuxblog.blogspot.com/2008/10/xvinfo-no-adaptors-present-and-curious.html
  • [131092820030] |Where the author seems to have fixed the problem, and several of the commenters claim it fixed it for them as well. [131092830010] |I dealt with this recently; it was a real pain, and unfortunately I don't have notes on exactly what I did. [131092830020] |I saved these two links: [131092830030] |
  • https://bugs.freedesktop.org/show_bug.cgi?id=25607
  • [131092830040] |
  • http://bgoglin.livejournal.com/19346.html
  • [131092830050] |Recent radeon chips don't have dedicated video overlay hardware, they use the texturing support in the 3D core to emulate a video overlay. [131092830060] |This means that 3D acceleration needs to be working for the video overlay to work. [131092830070] |In my glxinfo I have: [131092830080] |If you used the fglrx driver in the past, make sure that any remnants of it are removed (remove any packages found by dpkg -l '*fglrx*' and check for kernel modules in /lib/modules. [131092830090] |I currently have radeon in /etc/modules, as suggested at one of the links above, but I'm not sure if it's strictly necessary. [131092830100] |There's nothing interesting in my xorg.conf. [131092830110] |Good luck! [131092840010] |What are the advantages of building tools/libs from source? [131092840020] |By building from source do you gain any benefits? [131092840030] |Is the code better optimized to your hardware architecture? [131092840040] |Is it optimized better in general? [131092840050] |Why would someone choose to build from source rather than using a package management system like APT/yum? [131092840060] |If there is some kind of optimization gain when does that outweigh the benefit of a package management system? [131092850010] |Building from source provides the following options which are not available when using a version from a binary package manager. [131092850020] |Compiling from source allows you to: [131092850030] |
  • use processor-specific optimizations
  • [131092850040] |
  • use the very latest version
  • [131092850050] |
  • learn how compilation &linking work (suggestion from @mattdm)
  • [131092850060] |
  • fix bugs, development work
  • [131092850070] |
  • set compile-time options (e.g. include X features in vim)
  • [131092860010] |I've done this exact thing very recently. [131092860020] |I compiled openssl-1.0.something from source on a Slackware 11.0 linux system. [131092860030] |I wanted to patch the login-by-password thing to pause for 7 seconds on a failed login, so as to tarpit those annoying Chinese ssh password guessers. [131092860040] |I compiled Apache httpd 2.2.17 on the same Slackware 11.0 system because it came with Apache 2.0.something, and I wanted to use a 2.2.x httpd.conf from another system. [131092860050] |Come to think of it, I also compiled Alpine 2.0 (email client, pine follow-on) for the same system. [131092860060] |Why Slackware 11.0? [131092860070] |It's running on a circa 2003 machine with Intel "Brookdale" graphics, and any later Slackware just doesn't support the poorly-documented Intel graphics. [131092860080] |On a different machine, I pulled the TI ACX111 wireless chip support from github and compiled a new driver, allowing me to use a $9 wireless card. [131092860090] |I also habitually recompile Linux kernels to make them specific to the machine they run on. [131092860100] |So in my case it's various reasons of customization, hardware support, and "just because". [131092860110] |Given what we know of epidemiology in a uniform population (http://www.usenix.org/publications/login/2005-12/openpdfs/geer.pdf) why doesn't everyone compile from source on their own systems, with whatever compile-time options they choose? [131092860120] |That would make for a vastly more virus- and worm-resistant population. [131092870010] |Determining keycode assignments for X.org on a PC [131092870020] |At some point around late 2008 to early 2009, some keycode values (apparently, for the keys that weren't on an XT keyboard) on a standard PC keyboard when running X.org under Linux changed. [131092870030] |I don't know whether this was due to a kernel change or an X change. [131092870040] |Debian lenny and Ubuntu 8.04 used the old assignment; Debian squeeze and Ubuntu 10.04 used the new assignment. [131092870050] |So I have two xmodmaprc files, one with the old keycodes and one with the new keycodes. [131092870060] |How do I determine which one to load from my .xinitrc and .xsession? [131092870070] |I want my startup files to be portable with no hassle, so I want to get rid of my present dependency on the machine name (!). [131092870080] |And I don't want to introduce a dependency on Linux distribution versions (and anyway that would be information about the client, but it's information about the server that I need). [131092870090] |I already have information about the server at this point in my script (all the symbols listed in xrdb(1) are available as environment variables); hopefully my question reduces to “What parameters to I compare to what values?”. [131092870100] |Note that since I want my startup files to work on machines that I don't administer, keysym reassignments alone are no help. [131092870110] |For example, I want to assign my favorite modifier to the Win keys, but I can't predict what keysym will be assigned when I log in. [131092870120] |However, if there is an XKB concept I can use in place of keycodes (and is independent of any sysadmin customization, so keysyms won't do), I'm willing to switch to XKB. [131092880010] |You should always map by keysym when you can. xmodmap holds keysym definitions "in place" to make this work even while you're changing them; see its manual page for details. [131092880020] |To find out what keysym/keycode mappings exist, use xmodmap -pke, find the keyboard definition under /usr/X11R6/lib/X11/xkb (which may be /usr/share/X11/xkb in more recent distributions), or use xev to look at individual keys. [131092890010] |No such file or directory /etc/init.d/functions [131092890020] |I created a startup script to start/restart/stop a group of applications. [131092890030] |I used the lib /etc/init.d/functions in my script. [131092890040] |It is working well on my system, but it not working for my client; he is getting the error: [131092890050] |No such file or directory /etc/init.d/functions [131092890060] |Right now I don't know which linux distro my client uses. [131092890070] |Is the init.d/functions file different for different Linux distros? [131092890080] |If so, how can I find it? [131092900010] |It's specific to whatever distribution you're running. [131092900020] |Debian and Ubuntu have /lib/lsb/init-functions; SuSE has /etc/rc.status; none of them are compatible with the others. [131092900030] |In fact, some distributions don't use /etc/init.d at all, or use it in an incompatible way (Slackware and Arch occur to me off the top of my head; there are others). [131092910010] |That is absolutely distribution dependent. [131092910020] |You're really going to need to find out the distro in order to write a properly-matching init script. [131092910030] |You can also follow the LSB (Linux Standard Base) specification and hope that the distro in question did too. [131092910040] |The current specification dictates that the standard init script functions be available as /lib/lsb/init-functions (see docs here). [131092910050] |On Fedora and other Red Hat related distros, that's provided by the redhat-lsb package, which is optional. [131092910060] |So, you really have to figure out what you're targeting. [131092910070] |Sorry. [131092920010] |Is there a way to make perl -i not clobber symlinks? [131092920020] |A friend of mine points out that if you do: [131092920030] |when "somefile" is actually a symlink, perl does just what the docs say it will do: [131092920040] |It does this by renaming the input file, opening the output file by the original name, and selecting that output file as the default for print() statements. [131092920050] |The extension, if supplied, is used to modify the name of the old file to make a backup copy [...] [131092920060] |Which results in a new symlink "somefile.bak" pointing to the unchanged real file, and a new, changed regular file "somefile" with the changes. [131092920070] |In many cases, following the symlink would be the desired behavior (even if it leaves the correct location of the .bak file ambiguous). [131092920080] |Is there a simple way to do this other than testing for symlinks in a wrapper and handling the case appropriately? [131092920090] |(sed does the same thing, for what that's worth.) [131092930010] |I wonder whether the small sponge general-purpose utility ("soak up standard input and write to a file") from moreutils will be helpful in this case and whether it will follow the symlink. [131092930020] |The author describes sponge like this: [131092930030] |It addresses the problem of editing files in-place with Unix tools, namely that if you just redirect output to the file you're trying to edit then the redirection takes effect (clobbering the contents of the file) before the first command in the pipeline gets round to reading from the file. [131092930040] |Switches like sed -i and perl -i work around this, but not every command you might want to use in a pipeline has such an option, and you can't use that approach with multiple-command pipelines anyway. [131092930050] |I normally use sponge a bit like this: [131092940010] |How can I logout from a graphical environment from the command line? [131092940020] |Part of the beauty of trying out alpha releases of operating systems is that things will break, including things we take for granted. [131092940030] |Today it's the turn of the logout button. [131092940040] |So, how do you log out from the desktop environment du jour from the command line? [131092950010] |/usr/bin/gnome-session-save --kill works for me on Fedora 15 Alpha with gnome as my DE. [131092950020] |Hope that helps. [131092960010] |/etc/init.d/gdm restart [131092960020] |or [131092960030] |/etc/init.d/kdm restart [131092970010] |As long as you've got the "DontZap" set to "off" in your xorg.conf, you can use control-alt-backspace to kill your running X server. [131092970020] |I've used this in situations when the X environment is so messed up I can't run a command. [131092970030] |If everything is significantly wedged, you might benefit from using the Magic Sysrq keys 'k' to kill off all processes in the current VT, and if it's really wedged, you can reboot your system a bit more cleanly than a hard poweroff. [131092970040] |Sadly, when testing the compositing WMs I did this more often than I'd like. [131092980010] |The X server will die if you kill the session's main process, and all other X clients will die when they lose the connection to the X server. [131092980020] |Under Gnome (at least under Ubuntu 10.04), the session's process is gnome-session. [131092980030] |If you're not using a desktop environment, the process you want is the session manager, or if you're not running one, the window manager. [131092980040] |More precisely, the process you need to kill is the first client that connected to the X server. [131092990010] |

    telinit 3

    [131092990020] |Stupid 30 character minimum, that is extremely retarded. [131093000010] |Permissions issues for shared directory on a server [131093000020] |Hi, [131093000030] |The setup is we have a VPS running Debian Squeeze, and I've set up a shared directory for us to share files. [131093000040] |So far I've followed this guide: [131093000050] |http://www.cyberciti.biz/faq/linux-setup-shared-directory/ [131093000060] |I've also set the umask to 002 correctly (see the comments on that guide), so we can both now create files and directories directly on the server and we both have read/write permissions on them. [131093000070] |The only problem is that a lot of our files are created on our local machines (both running Ubuntu 10.10), and then dumped on the server. [131093000080] |This results in only the creator of the file/directory having write permissions on, and the other member of the group I set up for sharing this folder only having read access. [131093000090] |My next thought would be to change the default umask on our local machines, but it seems a bit extreme to have to do that, and I don't know if it's a security risk. [131093000100] |Can someone tell me if there's a better solution to what I'm trying to achieve, or if this really is the way to go? [131093000110] |Many thanks in advance [131093010010] |Hi - Sorry I was being thick in the comments. the sftp-server is being run by root and you pick up root's umask. [131093010020] |You should be able to fix this by editing your /etc/ssh/sshd_config file and changing the line [131093010030] |Subsystem sftp /usr/lib/openssh/sftp-server [131093010040] |to [131093020010] |In addition to Iain's answer, which should work (but watch out for the smart-quotes, and see below for a caveat), at the top of /etc/init.d/ssh you will find: [131093020020] |and you can change the value here. [131093020030] |Caveat: [131093020040] |many S/FTP clients will try to set the permissions on newly uploaded files to match the permissions on the local system, so check if this is what's happening. [131093020050] |If it is, you can usually disable this option in the settings of the client you're using to upload. [131093020060] |edit: [131093020070] |as another suggestion, when creating a set-up like this, I always make full use of the sticky-bit for group ownership (i.e., I set all directory permissions to 2775) so that newly created files and directories inherit the correct group ownership. [131093030010] |I'd use a different approach and share the files through an access control list on the directory. [131093030020] |First make sure access control lists are enabled on the filesystem where the directory resides (make sure that the corresponding entry in /etc/fstab contains acl in the fourth column). [131093030030] |Also make sure you have the acl utilities installed (on Debian, install the acl package). [131093030040] |Then give both users an inheritable write permission on the directory. [131093030050] |If there are more than two users, either repeat this command for each user (the ACL is implicit for the user who created the directory); or put the users in a group (as you already did), and use -m group:group_name:rwx in the setfacl command. [131093040010] |How can I create a /dev/null-like "blackhole" directory? [131093040020] |I would like to create a "/dev/null" directory (or a "blackhole" directory) such that any files written to it are not really written, but just disappear. [131093040030] |I have an application that writes out large temporary files to a directory. [131093040040] |I have no control over the name of the files and I don't really care about the content of these files. [131093040050] |I could write a script that periodically clobbers these files, but the files are written out very quickly and fill my disk. [131093040060] |I'm looking for something cleverer. [131093040070] |I want the application to "think" that it is writing out these files, when in fact, the writes are just being discarded at the other end. [131093040080] |Also see this old related thread. [131093050010] |If the program is so stupid to not let you switch those logs off, may be it also doesn't check for errors after opening a log file? [131093050020] |I'd try mounting some dummy read-only file system (e.g. using mount -o loop.) [131093060010] |Just symlink that directory to /dev/null [131093060020] |/dev/null, doesn't have to be a directory. [131093060030] |If the program tries writing to ~/.logs/log1.dump, it still goes right into /dev/null. [131093060040] |I do this for Google Chrome's cache because after a while it gets so big that Chrome will take minutes to start. [131093070010] |You say that removing the files periodically with a script isn't fast enough. [131093070020] |Could you live with a trigger that deletes a temporary file any time your application finishes writing and closes it? [131093070030] |If so, you might make use of the "inotify" API. [131093070040] |(See http://en.wikipedia.org/wiki/Inotify and https://github.com/rvoicilas/inotify-tools/wiki/) [131093080010] |This isn't supported out-of-the-box on any unix I know, but you can do pretty much anything with FUSE. [131093080020] |There's at least one implementation of nullfs¹, a filesystem where every file exists and behaves like /dev/null (this isn't the only implementation I've ever seen). [131093080030] |¹ Not to be confused with the *BSD nullfs, which is analogous to bindfs. [131093090010] |Is there something like wine to run OSX apps on linux? [131093090020] |This question answers why Linux can't run OSX apps, but is there some application similar to Wine that allows one to do so? [131093100010] |I don't think so but maybe you could possibly run a Hackintosh inside a VM. [131093110010] |What preparations should I make before reinstalling windows? [131093110020] |Since Windows still does not offer means to skip rewriting the MBR, what can I do before reinstalling Windows to get Grub2 back into the MBR as easy as possible? [131093110030] |(I'll also appreciate it if the answer then describes how to restore Grub) [131093120010] |Nothing. [131093120020] |Just make sure that you have a live CD around. [131093120030] |After you install Windows and by the way let it overwrite the MBR, just boot into the live CD and restore Grub. [131093120040] |Regarding restoring Grub, it has been asked before. [131093130010] |Some people have been able to get NTLDR to chain to grub: http://stringofthoughts.wordpress.com/2009/04/27/booting-linux-from-ntloader-windows-bootloader/ [131093130020] |Although in practice it's easier to use a live CD. [131093130030] |I usually do something like: [131093140010] |How to whitelist an URL in Privoxy (with a little regexp) [131093140020] |how can i whitelist these URLs in Privoxy? [131093140030] |I don't want to whitelist "foo.org" i just need to whitelist these specific url's. the "page=NUMBER" where NUMBER=1..99999999 [so it's a big number, i don't know exactly how much] What do i need to write in the "user.action" file? :\ [131093150010] |Should work [131093160010] |How to delete line with Privoxy? [131093160020] |I know how to swap something with something with privoxy, e.g: [131093160030] |But: how can i delete a line with privoxy? [131093160040] |E.g.: If a line contains: [131093160050] |then what should i write in the user.action file to delete the line? [131093160060] |update: so i'm searching for this kind of "sed" effect in Privoxy: [131093160070] |if i use "/Offtopic/d" in the user.filter file it doesn't works. (and yes, i have other rules in user.filter perfectly working) Thank you! [131093170010] |I don't know Privoxy but judging form the replacement statements above this one could work: [131093180010] |You may want to read up on regular expressions. [131093180020] |The line you posted is a regular expression: [131093180030] |It means "replace every occurrence of the first string with the second one". [131093180040] |If you want to delete something, you can just leave the second string empty, like so: [131093180050] |This would remove all occurrences of that string. [131093180060] |If you want to match a whole line, you could use: [131093180070] |Where ^ is a special character meaning "beginning of line", $ means "end of line", . means any character and * means zero or more repetitions of that character. [131093180080] |So it would match "zero or more repetitions of any character", then "some_string", and then "zero or more repetitions of any character" again (which should achieve what you want). [131093180090] |Here's a good introduction to regular expressions if you want to learn more. [131093190010] |How do major package managers differ? [131093190020] |It appears that the major package managers are (in no particular order) apt, yum, and pacman. [131093190030] |But when it comes down to it, what is the difference? [131093190040] |My understanding is that you can use any of them on any distribution, although every distribution appears to favor one over the other. [131093190050] |So, my questions are: What are the core differences between the major package managers? [131093190060] |Why should I consider one over the other? [131093200010] |well it's basicaly about kind of packets they deal with (apt - deb; yum - rpm; pacman - tar.gz) where these packaging systems are a bit different themselves... then there's the question of how good they deal with dependencies (pretty important)... and of course - options they provide and how they can present the data about packages being installed... [131093200020] |I would say these would be some of the major differences... [131093210010] |The package managers you cite are really just a choice of front-ends to an underlying packaging system. [131093210020] |For example, yum is a front-end to RPM, and others exist (smart, zypper, apt4rpm, and so on). [131093210030] |Similarly, the average DPKG-based system has two or three package managers by default (Synaptic, Aptitude, apt-get, dselect, and so on). [131093210040] |I don't know enough about Pacman to comment there. [131093210050] |The front-end is really not all that interesting - there's a degree of dependency resolution it needs to handle, but the really "difficult" part of package management comes from the underlying package format. [131093210060] |Again, I can't comment on Pacman, but between RPM and DPKG, It's RPM which has a tougher job - you can define extremely complex relationships in your RPM package, which the resolver needs to somehow handle, and a single slip-up in your package definitions may cause misery down the line. [131093210070] |DPKG is a much simpler format as far as dependency information is concerned, since you can only define two things - package names and versions - whereas with RPM you can do complicated things like versioned symbols in dependencies, and so on. [131093210080] |So, to answer your question, the choice between managers within a single format is personal taste only (I mostly use aptitude). [131093210090] |The choice between formats is one of how fine-grained a control you want (and, ironically, how much complexity you want that control to introduce into your packaging). [131093220010] |How often does Debian update its Stable repository? [131093220020] |Ever since release day (early Feb 2011), I haven't got any updates (apt-get update &&apt-get upgrade). [131093220030] |I've tried another repository (ftp://ftp.de.debian.org/debian), and it's the same thing. [131093220040] |Here's the relevant line from my /etc/apt/sources.list: [131093230010] |That's because Stable, being stable, gets updated only extremely rarely -- roughly once every two months in the case of the previous release, and even then it's more "move security updates into the main tree and rebuild the images" than adding anything new. [131093230020] |Adding new stuff is what testing and unstable are for. [131093230030] |Security updates for the Stable distribution are updated via [131093230040] |deb http://security.debian.org/ stable/updates main contrib non-free [131093230050] |and for more volatile packages you should also add [131093230060] |deb http://cdn.debian.net/debian/ squeeze-updates main contrib non-free [131093230070] |to your /etc/apt/sources.list file. [131093230080] |Useful relevant information from Debian can be found at http://wiki.debian.org/StableUpdates [131093230090] |EDIT: The first point release update happened today, March 19th. [131093230100] |I'm guessing they'll try to stick to a bimonthly schedule, with some elasticity to keep to the Debian standards of reliability and stability. [131093240010] |Stable will only be updated when there's a point release. [131093240020] |Don't expect these to be very often. [131093240030] |In fact, don't expect these. [131093240040] |You should absolutely include security updates (unless you have some requirement like FIPS or something) as outlined at http://www.debian.org/security/. [131093240050] |If you want other regular updates add the stable-updates as detailed at http://wiki.debian.org/StableUpdates (stable-updates is formerly known as volatile, so if you see any references to that, this is the NewThing™). [131093240060] |If you want new software that isn't included in stable you should add backports as detailed at http://backports.debian.org/Instructions/. [131093250010] |Memory size for kernel mmap operation [131093250020] |Hi, [131093250030] |I'm interested in the way Linux mmaps files into the main memory (in my context its for executing, but I guess the mmap process is the same for writing and reading as well) and which size it uses. [131093250040] |So I know Linux uses paging with usually 4kB pagesize (where in the kernel can I find this size?). [131093250050] |But what exactly does this mean for the memory allocated: Assume you have a binary of size of a few thousned bytes, lets just say 5812B and you execute it. [131093250060] |What happens in the kernel: Does it allocate 2*4kB and then copy the 5812B into this space, wasting >3KB of main memory in the 2nd page? [131093250070] |Probably a very simple question, I just want to make sure I got it right. + It would be great if anyone knew the file in the kernel source where the pagesize is defined. [131093250080] |My 2nd question is also very simple I guess: I assumed 5812B as a filesize. [131093250090] |Is it right, that this size is simply taken from the inode? [131093260010] |Yes: you eventually get two 4k pages. [131093260020] |Data is loaded on demand, so if nothing ever refers to the second page it will never be loaded into memory. [131093260030] |Do not change these values and expect anything to work. [131093260040] |Yes, the file size is stored in the inode in ext2/3. [131093270010] |There is no direct relationship between the size of the executable and the size in memory. [131093270020] |Here's a very quick overview of what happens when a binary is executed: [131093270030] |
  • The kernel parses the file and breaks it into section. [131093270040] |Some sections are directly loaded into memory, in separate pages. [131093270050] |Some sections aren't loaded at all (e.g. debugging symbols).
  • [131093270060] |
  • If the executable is dynamically linked, the kernel calls the dynamic loader, and it loads the required shared libraries and performs link edition as required.
  • [131093270070] |
  • The program starts executing its code, and usually it will request more memory to store data.
  • [131093270080] |For more information about executable formats, linking, and executable loading, you can read Linkers and Loaders by John R. Levine. [131093270090] |In a 5kB executable, it's likely that everything is code or data that needs to be loaded into memory except for the header. [131093270100] |The executable code will be at least one page, perhaps two, and then there will be at least one page for the stack, probably one page or for the heap (other data), plus memory used by shared libraries. [131093270110] |Under Linux, you can inspect the memory mappings for an executable with cat /proc/$pid/maps. [131093270120] |The format is documented in the proc(5) man page; see also Understanding Linux /proc/id/maps. [131093280010] |For the definition part, on a 2.6.38~ish kernel for the Intel architecture: [131093280020] |arch/x86/include/asm/page_types.h: [131093280030] |/* PAGE_SHIFT determines the page size */ [131093280040] |#define PAGE_SHIFT 12 [131093280050] |#define PAGE_SIZE (_AC(1,UL) <Looking for a distro with GUI fit for Windows 98 PCs [131093290020] |I have a Windows 98 computer that we still use (the hardware works just fine, but Windows is becoming a bit flaky and I'd rather go problem hunting and solving with Linux rather than Win98). [131093290030] |I'm looking for a very lightweight distribution (with a GUI, not command line) that is able to run the following: [131093290040] |
  • An email client which supports POP3
  • [131093290050] |
  • A "more up to date" web browser (the banking website refuses to show up in the old Internet Explorer version it's running)
  • [131093290060] |
  • An app able to open and modify Word and Excel documents
  • [131093290070] |
  • FTP, DropBox, or some way to share and sync files with another computer
  • [131093290080] |That is ALL the software that's needed (though, having Skype support would be helpful, but not required) [131093290090] |It uses a Pentium II Processor, which means it's CPU is between 233 MHz and 450 MHz (I can't seem to find the exact number from within Windows), and 256 MB RAM. [131093300010] |There are several light weight window managers. [131093300020] |Openbox, XFCE, and LXDE are the primary ones. [131093300030] |Then there are some others like Enlightenment, IceWM, and Awesome. [131093300040] |In my opinion, Openbox is the lightest of all of those. [131093300050] |A lot of Arch Linux users use Openbox, but it doesn't have a GUI by default; you have to install it through the package manager. [131093300060] |It's pretty simple however. [131093300070] |If you'd rather have a GUI by default, Crunchbang uses Openbox by default, and it's based on Debian. [131093300080] |If you don't mind installing the window manager yourself in Arch, it does have the advantage of letting you choose which window manager to use. [131093300090] |So if you don't like Openbox, you can use something else. [131093310010] |maybe puppy linux? [131093310020] |Here the specs: [131093310030] |Puppy has been tested on a very old machines but the best results for the standard release of Puppy Linux to run at a reasonable pace have been achieved with the following: [131093320010] |Why are files in my home dir being created as world-writable despite a more-restrictive umask? [131093320020] |Hi, [131093320030] |I'm new to CentOS (though quite used to Debian/Ubuntu), so maybe this is a FAQ. [131093320040] |Excuse me if that's the case. [131093320050] |I've realized that the permissions for new files and directories behave a bit strangely. [131093320060] |First of all, umask seems to return the right answer: [131093320070] |This means full access for my user and my group, no write access for the rest of the world, no suid. [131093320080] |But if I create a file in my $HOME, this is how it looks: [131093320090] |I.e., giving write access to everyone. [131093320100] |The same happens with directories: [131093320110] |I think this is the same as having umask 0000, not 0002. [131093320120] |I've searched all /etc for some instance of umask that changes the default 0002 or 0022, but found none. [131093320130] |This is a default CentOS 5.5 install. [131093320140] |Any hint of why is this happening? [131093320150] |Thanks in advance. [131093330010] |Clone OS to a smaller drive [131093330020] |Hello, [131093330030] |I would like to copy/clone/move my CentOS (which is on a 20GB hard drive) to a smaller hard drive (5GB)... [131093330040] |Can someone tell me how to do this? [131093340010] |You should be able to tar up everything and extract it to the new drive. [131093340020] |First plug in the second drive, then boot into something that doesn't use the source drive, such as a live CD. [131093340030] |After that just copy everything over. [131093340040] |For example: [131093340050] |Don't reboot just yet, you have to install Grub on the destination drive, something like: [131093340060] |You can also use an intermediate drive if you can't connect the second drive to the same computer, but the steps are similar. [131093340070] |Finally remember, don't use those commands as is, always check and double check that they apply to your system. [131093340080] |(In case someone has a slightly different requirement that doesn't include a smaller destination drive, Clonezilla is definitely a better choice.) [131093350010] |`highlight` command [131093350020] |Is there a command which can be used to easily highlight (with colors, bold text or inverted back-/foreground) specific strings in stdin while passing the entire string to stdout? [131093350030] |I'm thinking of building it, but I'd rather just use it if it already exists. [131093350040] |Some desirable features: [131093350050] |
  • Separate highlight strings are highlighted differently, in an automatic way. [131093350060] |For example, the first string will be highlighted in red, the second in green, the third in blue without manual configuration.
  • [131093350070] |
  • Detects color support and falls back to bold/inverted/other highlighting methods where those are available.
  • [131093350080] |
  • Allow for matching of regular expressions and literal strings.
  • [131093350090] |
  • Preferably does something smart if the matches overlap, such as "foobar" and "barbar".
  • [131093350100] |
  • Nothing is modified between stdin and stdout except for the addition of color codes.
  • [131093360010] |As you mentionned in the link, grep --color=always only works for one pattern. [131093360020] |That said, I don't believe that such a tool exists. [131093370010] |Maybe this one? [131093370020] |It expects a config file as argument and works with regexp's. [131093370030] |So not quite without configuration, but you can use process process substitution (<(list)), so by all means without manual configuration :-) [131093380010] |What does "-" mean as an argument to a command? [131093380020] |I found this link on how to open tgz in one step. [131093380030] |What does the '-' mean? [131093390010] |It's a common convention to use - in a filename argument to mean stdin or stdout; tar follows the same convention. [131093390020] |From the man page: [131093400010] |Another convention is to use '-' to indicate the end of flags, and the beginning of file names. [131093400020] |That behavior is built-in to the getopt(3) on RedHat 4, at least. [131093400030] |I can't find a Red Hat man page that uses '-' to indicate end-of-arguments, they all seem to use '--' to do that. [131093400040] |The awk man page has '--' in that context, so maybe only old "heirloom" Unix or Solaris commands use '-' as a arguments - file names separator. [131093410010] |Why does this exclude pattern for rsync give different results when the source directory has a trailing slash? [131093410020] |When I do something like [131093410030] |the exclusion works, but with [131093410040] |it doesn't. [131093410050] |I'm using version 3.0.7 protocol version 30 under cygwin, in case it matters. [131093420010] |This is because in the second case, you're rsyncing the contents of /e/, and the filter pattern is rooted there, not up one level. [131093420020] |So, you need to remove that from your exclude: [131093430010] |How to install the Adobe Flash player plugin on Fedora 64-bit? [131093430020] |I was not able to install Adobe Flash Player on Fedora 14, 64-bit machine. [131093440010] |Fastest way to get an Euro symbol at a prompt? [131093440020] |First of all I'm working on a keyboard using a QWERTY layout. [131093440030] |Now once in a while I need to get the Euro (€) symbol in my terminal (typically in a xterm). [131093440040] |If I cut'n'paste the Euro symbol, it shows up fine in my xterms, which have their locale set like this: [131093440050] |How can I configure my Linux (Debian / X) so that I can easily (and fastly) output an Euro symbol, without messing my setup? (for example, I'm not switching to a non-QWERTY layout). [131093440060] |I don't care if it only works in X / xterm, that would be good enough for me. [131093440070] |Ideally I'd need a way to configure a shortcut that I can change to my will, to be sure it wouldn't interfere with my usual shortcuts. [131093440080] |Say, if I want to have ctrl+alt+e to output:€ in my xterm, how would I go about it? [131093450010] |May be this could help: [131093450020] |If the euro character is not represented in your X terminal emulator, you can change the default font by changing either the users' configuration files (.Xdefaults or .Xresources) or the system-wide configuration at /etc/X11/app-defaults/XTerm: [131093450030] |In /etc/X11/app-defaults/XTerm, make sure you replace old lines with these options. [131093450040] |After editing a .Xdefaults file, reload it with xrdb -merge ~/.Xdefaults. [131093450050] |(Similarly for .Xresources.) [131093450060] |Note that the derivative programs also use the font resource to set the default font, so the procedure is analogous. [131093450070] |FROM: http://www.debian.org/doc/manuals/debian-euro-support/ch-applications.en.html [131093460010] |If you setup a ComposeKey then you can enter the Euro with the sequence compose-E-=, and get lots of other special characters in a similar way. [131093460020] |https://help.ubuntu.com/community/GtkComposeTable has some relevant information (not all of it specific to Gtk or Ubuntu; compose key works even if you have no gtk or Gnome) See also How do I put a hat on 'e' (ê)? and Remapping caps-lock to escape, and menu to compose, on the linux console [131093470010] |The easiest way would be to use a compose key. [131093470020] |Ubuntu has a community page that describes this feature very well, but I'm not sure about its accuracy when not using Ubuntu. [131093470030] |The page says that Shift+RightAlt is the default key but it was not for me on Debian (although I do not use the normal US English layout). [131093470040] |Personally I set my compose key to the Menu key because I didn't find the default behavior of it useful. [131093470050] |After you have a working compose key configured, typing a Euro symbol with it can be done using at least 8 different combinations. [131093470060] |Press and release (do not hold it and type the next character, it is not a modifier key) the compose key, followed by e, then =. [131093470070] |You can use either e or c, and E or C work as well. [131093470080] |Additionally the order of the two characters does not matter for this composition so you can enter the = first. [131093480010] |What files in /var need to have specific owners? [131093480020] |I accidentally wreaked unknown amounts of havoc on my web server by running [131093480030] |in /var/www, not remembering that .* would include the parent directory (as ..). [131093480040] |I realized what was happening after a second or so, but by then it was too late, half the directories in /var had been "re-owned". [131093480050] |I know I can reset most of it with [131093480060] |but what files are there that need to be owned by specific non-root users (or groups) that I would have to change manually? [131093480070] |This is on Gentoo, and here's a directory listing: [131093480080] |I can provide listings of subdirectories if it would help but that gets pretty long pretty fast. (dist, edata, git, svn, and www are things I manage myself so ownership in those won't be an issue) [131093490010] |Well, /var is generally for program-generate data so it may not be possible to tell you exactly who should own what without duplicating your system. [131093490020] |I can think of two ways you might fix it: [131093490030] |
  • Set up another version of your web server on a spare or virtual machine and then check /var.
  • [131093490040] |
  • Just change to root/root and then see what errors come up (most of the directories will have this ownership structure).
  • [131093490050] |The downside to 1 is the amount of time it will take; the plus side being that it will be accurate. [131093490060] |Item 2 is much faster but less accurate even if it's mostly true. [131093490070] |The big problem here is that on an important production box 2 may not be feasible. [131093500010] |I'd help you out but I no longer run gentoo so here's a faster way to find out than installing a VM. [131093500020] |Download the latest tarball to a directory and extract it. mount proc and dev like you would for an install. chroot in and install whatever server daemons you've installed, you probably need to start them too. now run. [131093500030] |this should list all the files not owned by the root user. [131093500040] |If someone else has a gentoo system they could help him by just running this command [131093500050] |Here's a short list from my system (which is Arch Linux so distance will vary ) which might help out. [131093510010] |VPN on Fedora Linux? [131093510020] |I'm looking to install and setup a VPN on my Linux installation which is Fedora 14. [131093510030] |At the moment the only one I know of is OpenVPN but I'm wondering if this the best option for Fedora or if Fedora offers other options that are better? [131093510040] |EDIT: Definitely looking for free solutions :) [131093520010] |Fedora also packages Openswan, which has a free IPsec implementation that you can use for a VPN. [131093530010] |I use VPN setups extensively. [131093530020] |I suggest OpenVPN rather then IPsec implementations. [131093530030] |OpenVPN has much more features and possibilities. [131093530040] |Markus Feilner - OpenVPN is a great book to learn. [131093540010] |How to remove length limit from losetup -a [131093540020] |I am using losetup -a to see my loop devices, but it has a length limit (which is 62 characters). [131093540030] |So I can't know for sure which loop device I really want. [131093540040] |Ex: [131093540050] |I can get the output on /dev/loop1 using [131093540060] |But I can't get the device on loop0, since the name is not fully qualified. [131093540070] |How can I get the loop device regardless of this size limit? [131093550010] |Strace shows that losetup -a obtains the name through the LOOP_GET_STATUS ioctl, which calls loop_get_status_old, which gets its data from a struct loop_info. [131093550020] |The name field in that kernel data structure is limited to LO_NAME_SIZE = 64 bytes. [131093550030] |(There's also a loop_get_status64 and struct loop_info64, but they have the same limitation.) [131093550040] |So this limitation is intrinsic, you can't do any better. [131093550050] |Anyway, that data structure shows the original name of the underlying device or file, but you can rename it (or even remove it), and this won't be reflected in the output from losetup. [131093550060] |The output of losetup shows the filesystem identifier (st_dev) and inode (st_ino) of the file, e.g., [fc03]:33030504. [131093550070] |You can find the block device for the filesystem by looking it up in /proc/partitions (line beginning with 252 3). [131093550080] |Then look up that block device's mount point in /proc/mounts. [131093550090] |Then run find /mount/point -inum 33030504 to locate the file. [131093550100] |Yes, it's convoluted, and no, there's no faster way (well, there's debugfs for some filesystem types). [131093560010] |Since kernel 2.6.37, you can look up the name of underlying file (without the length limitation) via /sys/block/loopX/loop/backing_file. [131093560020] |Recent util-linux/losetup should support this method. [131093570010] |Remote VNC from Fedora to Ubuntu [131093570020] |PC-A: remote Ubuntu box PC-B: my local Fedora box [131093570030] |PC-A [via ssh]: apt-get install tightvncserver [131093570040] |and i gived a good password [131093570050] |ok! [131093570060] |PC-B: yum install vinagre [131093570070] |i flushed all my iptables rule [131093570080] |And i tried to connect with IPADDRESS:5901 from my "PC-B" Fedora box to PC-A. [131093570090] |Well..the good thing is, that vinagre pops a password box, and i can see the wallpaper of the Ubuntu machine. [131093570100] |But after giving the good password, nothing happens. [131093570110] |I can see the wallpaper, and the mouse is waiting, and waiting.. [131093570120] |What am i missing? [131093570130] |Either PC-A hasn't any firewall rule. [131093580010] |You might want to look in ~/.vnc/xstartup on the remote end. [131093580020] |It's possible that you're running something like twm, which is somewhat feature-free when it comes to a desktop envrironment. [131093580030] |Also, did you know that the VNC traffic is not encrypted? [131093580040] |Your password and keypresses are being sent in the clear over the network. [131093580050] |Most people tunnel their VNC session over SSH. [131093590010] |Try right clicking on the desktop. [131093590020] |It may open a menu. [131093590030] |I have switched to using RDP for remote access my desktop. [131093590040] |Traffic is encrypted and the desktop size is easier to adjust. [131093590050] |Sessions can be dropped and resumed later. [131093590060] |It is available as package, and relatively easy to setup. [131093590070] |Under the hood it is still VNC. [131093590080] |I wrote up my experiences on Remote Desktops with RDP and VNC. [131093600010] |How can I get a formated date for a UNIX timestamp from the command line [131093600020] |Hi, [131093600030] |I have a UNIX timestamp and I'd like to get a formatted date (like the output of date) corresponding to that timestamp. [131093600040] |My attempts so far: [131093600050] |I'd like to be able to get output like: [131093600060] |TIA [131093610010] |This perl one-liner will do it: [131093620010] |After some googling I have found way how to do it with date command only: [131093630010] |Another neat example of the rich heritage of modern Unix. [131093630020] |This is indeed possible under most BSD variants: [131093630030] |(BTW your example seems to be off by one second) [131093640010] |On Mac OS X and BSD: [131093640020] |with GNU core tools (you have to dig through the info file for that): [131093650010] |Creating debian version dependency in a .deb package [131093650020] |Is it possible to create a dependency for the debian version in a .deb package? [131093650030] |I would like to put two versions of one package into the same repository. [131093650040] |One is for debian 5 and one for debian 6. [131093650050] |The version numbers are different (deb 6 version has a higher number), but I would like to avoid accidental installs of the deb 6 version on deb 5 systems. [131093660010] |I don't think you can make a Debian package depend on a specific Debian release. [131093660020] |A workaround for the Debian 6 package is to make it depend on a package version that is not available on Debian 5. [131093660030] |For example, make it depend on libc6 >2.7 (here's a page that shows which versions of that package is in which Debian suite/release). [131093670010] |I don't have an actual Debian machine here, but the same mechanism should work. [131093670020] |So, as a first cut, you should be able to depend on a specific version of the base-files package. [131093670030] |You can map releases to version numbers on http://packages.debian.org, but in this case you already have the versions: they're the same as the Debian releases (5 vs. 6; ignore point releases for this comparison). [131093680010] |A loopback interface is a virtual network interface. [131093680020] |Packets sent through this interface are immediately received by the sending machine. [131093680030] |Under IPv4, all addresses in the 127.0.0.0/8 range are self-routed, although usually only 127.0.0.1 is configured as the address of an interface (often called lo). [131093680040] |Under IPv6, the sole loopback address is 0:0:0:0:0:0:0:1 (or ::1 for short). [131093680050] |The loopback address is always called localhost in the DNS. [131093680060] |Not to be confused with loop, which is a block device used to mount filesystem images stored in regular files. [131093690010] |The loopback interface is a virtual network interface for communications between processes on the same machine. [131093690020] |Not to be confused with a loop device for mounting filesystem images [131093700010] |A loop device is a pseudo-device that makes any file accessible through a block device. [131093700020] |This way, a file containing a filesystem image can be mounted. [131093700030] |Not to be confused with loopback, which is a network interface. [131093710010] |A loop device allows any file to be mounted as a filesystem image. [131093710020] |Not to be confused with a loopback interface in networking [131093720010] |Are there any Linux distros aimed specifically at being Linux tutorials? [131093720020] |Are there any Linux distributions that come pre-loaded with hands-on, guided tutorials or other learning software aimed at teaching a new user how to work with Linux? [131093720030] |I'm aware that some distros are naturally easier for new users to pick up than others, but I'm particularly hoping there's one out there that directly teaches the user. [131093720040] |I've tried going the independent "learn by using" route with an Ubuntu VM, but would find it much more helpful and fitting to my personal learning and motivational mechanisms to have something that could guide me through the process. [131093720050] |To be a bit more specific, I'm not just looking for a general "Linux for Beginners" tutorial (although that also would be a good start). [131093720060] |I'm hoping to eventually be as familiar and comfortable in Linux as I am in Windows (System Administrator). [131093730010] |I started to make this as a joking comment, but I'm actually going to go ahead and make it a serious suggestion. [131093730020] |Check out Linux From Scratch, which isn't a distro per se, but rather a book and toolkit for building your own running Linux system from source, without a distro. [131093730030] |If you were new to computers in general, this clearly would be jumping right off into the deep end. [131093730040] |But if you're a competent sysadmin with another OS, it really shouldn't involve too much that you can't handle. [131093730050] |And it will give you a good, hands-on understanding of what you really need underneath the shiny KDE or Gnome hood to make the system actually work. [131093730060] |At the GUI level, modern Linux distributions are basically almost like Windows or OS X, but with a whole host of different conventions and oddities that will drive you crazy (until, we hope, you grow to love and/or tolerate them). [131093730070] |And because it's put together from the work of tens of thousands of different developers, sometimes the integration isn't perfect and the underlying bits poke through. [131093730080] |So, consider starting from the underlying bits and see where that gets you. [131093740010] |One distro I can think of that was made to be a teaching system is Linux From Scratch. [131093740020] |It's aim though is to show you how to build (from source code) the entire GNU/Linux system from scratch, rather than just to teach you how it works. [131093740030] |By the time you've finished, your understanding and appreciation of building an OS will be higher than at the moment. [131093740040] |NOTE: You will of course need a host (a running OS) in the early stages. [131093740050] |LFS comes with a live CD for that (AFAIR), removing the need for an installation. [131093740060] |Another system that sort of fits your learning thirst is Arch Linux. [131093740070] |It's makers claim to try hard to stay from customizing it, leaving you to do it. [131093740080] |It has extensive documentation from it's wiki site. [131093740090] |I haven't seen a distro provide so much, but that's just my limited experience. [131093740100] |Note however that you'll need to be online since the only tutorial that Arch provides after the default installation is, ummm, the installation guide. [131093740110] |Note that you can achieve pretty much anything with any distro you choose. [131093740120] |There's turorials and manuals all over the place. [131093740130] |That is they are not that much different from each other. [131093740140] |They are running similar underlying technologies, so the differences between them are almost arbitrary :) [131093750010] |One of my first distros was Slackware. [131093750020] |It was immensely helpful to have The Linux Documentation Project (TLDP) as part of the base install. [131093750030] |The topics are broad and varied. [131093750040] |They deal with specific problems. [131093750050] |They're not aimed at the casual user. [131093750060] |You must be curious and have an aptitude for computers. [131093750070] |Alphabetical index of HOWTOs: http://tldp.org/HOWTO/HOWTO-INDEX/howtos.html [131093760010] |There is DVL (Damn Vulnurable Linux) distro (info here). [131093760020] |As description says it is "stuffed with broken, ill-configured, outdated and exploitable software" 'cause of its goal "to teach and demonstrate a variety of security topics, including reverse code engineering, buffer overflows, shell code development, web exploitation, and SQL injection" [131093770010] |How to setup Nvidia GeForce 9800 card on Ubuntu 10.10 [131093770020] |Hi guys, I have problem on graphic card with ACER V193w LCD display. [131093770030] |I really don't know how to configure /setup/ Nvidia GeForce 9800 on Ubuntu 10.10. [131093770040] |Can you guys please help me! [131093780010] |Here's my xorg.conf, sans comments, for a laptop with an Nvidia chip. [131093780020] |You can start from here and edit it. [131093780030] |You an also try running the nvidia-xconfig tool, but it doesn't create proper configs for modern xorg servers. [131093780040] |But you can cut and paste the driver part out and add it to this one. [131093790010] |Ubuntu does not install the nVidia binary drivers by by default so you need to install them yourself. [131093790020] |That should work for you. [131093790030] |If you want the later version of the driver I found some simple instructions here for installing from a PPA repository. [131093790040] |Add the latest driver repository: [131093790050] |Install the latest driver [131093800010] |Is it possible to uninstall OpenOffice? [131093800020] |I installed OpenOffice using the installer downloaded from openoffice.org on Fedora 14. I went to use it today for the first time and it won't open. [131093800030] |I'm assuming with updates that have been installing that perhaps something got overwritten or something since I didn't install it through yum. [131093800040] |I wasn't sure how to go about uninstalling it now so that I can reinstall it using yum so that it can monitor dependencies for me. [131093800050] |How would I do this? [131093810010] |From the FAQ: [131093810020] |OpenOffice.org version 1 (old) On Windows, you can use the Add/Remove Programs option in the Control Panel. [131093810030] |On Linux, you can use ./setup and choose the Remove option. [131093810040] |OpenOffice.org version 2 &3 (current) If you installed OpenOffice.org through another method (an RPM, or a Debian package), using the appropriate package removal tool is best. [131093810050] |No "Linux" in the text that mentions version 2 &3, anyway check if the ./setup file is still there and if there is a "Remove" option. [131093810060] |Another way is, I think inside the archive the packages are really just RPMs. [131093810070] |If so you can use rpm to remove them. [131093820010] |Ubuntu 10.10 notification system area , many icons disappeared like network manager [131093820020] |When I restarted the computer I found no network icon. [131093820030] |I tried to access internet but no connection was found. [131093820040] |I also didn't have the Bluetooth, sound, battery, and power icon. [131093820050] |Its really crazy that I have to use these commands to display them: [131093820060] |Every time I start the system I face this trouble! [131093820070] |How can I fix it? [131093820080] |Is there anyway to restore previous configuration? [131093820090] |the history log [131093820100] |Another problem that I didn't notice is that there is a problem with the graphics card also the visual effects can't be applied as in these photosit was working before. [131093820110] |another problem appeared I can't install any software from software center i click the install but nothing happens i tried many programs but the same result!! the internet connection is ok!! [131093820120] |I think it is virus but heard that Linux is so powerful in security. [131093820130] |I haven't seen a thing like this since windows 98 and XP first edition when viruses change desktop background and disable some menu items [131093830010] |Go System -> Preferences -> Startup Applications, and add those three commands manually. [131093830020] |Maybe you got them removed from there (or disabled) by mistake. [131093840010] |Is there a way to determine the optimal value for the bs parameter to dd? [131093840020] |On occasion I've seen comments online along the lines of "make sure you set 'bs=' because the default value will take too long," and my own extremely-unscientific experiences of, "well that seemed to take longer than that other time last week" seem to bear that out. [131093840030] |So whenever I use 'dd' (typically in the 1-2GB range) I make sure to specify the bytes parameter. [131093840040] |About half the time I use the value specified in whatever online guide I'm copying from; the rest of the time I'll pick some number that makes sense from the 'fdisk -l' listing for what I assume is the slower media (e.g. the SD card I'm writing to). [131093840050] |For a given situation (media type, bus sizes, or whatever else matters), is there a way to determine a "best" value? [131093840060] |Is it easy to determine? [131093840070] |If not, is there an easy way to get 90-95% of the way there? [131093840080] |Or is "just pick something bigger than 512" even the correct answer? [131093840090] |I've thought of trying the experiment myself, but (in addition to being a lot of work) I'm not sure what factors impact the answer, so I don't know how to design a good experiment. [131093850010] |dd dates from back when it was needed to translate old IBM mainframe tapes, and the block size had to match the one used to write the tape or data blocks would be skipped or truncated. [131093850020] |(9-track tapes were finicky. [131093850030] |Be glad they're long dead.) [131093850040] |These days, the block size should be a multiple of the device sector size (usually 4KB, but on very recent disks may be much larger and on very small thumb drives may be smaller, but 4KB is a reasonable middle ground regardless) and the larger the better for performance. [131093850050] |I often use 1MB block sizes with hard drives. [131093850060] |(We have a lot more memory to throw around these days too.) [131093860010] |There's but one way to determine the optimal block size, and that's a benchmark. [131093860020] |I've just made a quick benchmark. [131093860030] |The test machine is a PC running Debian GNU/Linux, with kernel 2.6.32 and coreutils 8.5. [131093860040] |Both filesystems involved are ext3 on LVM volumes on a hard disk partition. [131093860050] |The source file is 2GB (2040000kB to be precise). [131093860060] |Caching and buffering are enabled. [131093860070] |Before each run, I emptied the cache with sync; echo 1 >|/proc/sys/vm/drop_caches. [131093860080] |The run times do not include a final sync to flush the buffers; the final sync takes on the order of 1 second. [131093860090] |The same runs were copies on the same filesystem; the diff runs were copies to a filesystem on a different hard disk. [131093860100] |For consistency, the times reported are the wall clock times obtained with the time utility, in seconds. [131093860110] |I only ran each command once, so I don't know how much variance there is in the timing. [131093860120] |Conclusion: a large block size (several megabytes) helps, but not dramatically (a lot less than I expected for same-drive copies). [131093860130] |And cat and cp don't perform so badly. [131093860140] |With these numbers, I don't find dd worth bothering with. [131093860150] |Go with cat! [131093870010] |I agree with geekosaur that the size should be a multiple of the block size, which is often 4K. [131093870020] |If you want to find the block size stat -c "%o" filename is probably the easiest option. [131093870030] |But say you do dd bs=4K, that means it does read(4096); write(4096); read(4096); write(4096)... [131093870040] |Each system call involves a context switch, which involves some overhead, and depending on the I/O scheduler, reads with interspersed writes could cause the disk to do lots of seeks. [131093870050] |(Probably not a major issue with the Linux scheduler, but nonetheless something to think about.) [131093870060] |So if you do bs=8K, you allow the disk to read two blocks at a time, which are probably close together on the disk, before seeking somewhere else to do the write (or to service I/O for another process). [131093870070] |By that logic, bs=16K is even better, etc. [131093870080] |So what I'd like to know is if there is an upper limit where performance starts to get worse, or if it's only bounded by memory. [131093880010] |Creating new initrd without installing kernel [131093880020] |How can i create initrd image for a new(experimental) kernel without actually installing it. [131093880030] |(Existing tools to create initrd based on config and details from installed kernel.) [131093880040] |Say i compile a new kernel with experimental features turned on, i have this in another separate partition. [131093880050] |I would like to boot into this kernel, for that will old initrd work ? if i want to create a new initrd.img for new kernel without actually installing kernel, how can i do it ? [131093880060] |BTW, can someone clarify about initramfs ? will it be useful for my scenario ? [131093890010] |Creating an initrd doesn't have anything to do with installing a kernel. [131093890020] |All you do is to create a file structure for the initrd, copy the required files, write the init script and package all of that into a cpio archive. [131093890030] |I used the instructions in the Gentoo Wiki to make my initrd. [131093890040] |Some distributions make tools to generate initrds, and for that you will have to name your distro. [131093890050] |For example, Arch has mkinitcpio. [131093890060] |initramfs is just another (newer) implementation of the initial ramdisk. [131093890070] |I don't know for sure, but I think modern distributions all use initramfs. [131093890080] |When you see "initrd", it may be a shorthand for "initial ramdisk", and thus it covers both initrd and initramfs. [131093900010] |The Dynamic Host Configuration Protocol (DHCP) is an auto configuration protocol used on IP networks. [131093900020] |Computers that are connected to IP networks must be configured before they can communicate with other computers on the network. [131093900030] |DHCP allows a computer to be configured automatically, eliminating the need for intervention by a network administrator. [131093900040] |It also provides a central database for keeping track of computers that have been connected to the network. [131093900050] |This prevents two computers from accidentally being configured with the same IP address. [131093920010] |Why is file ownership inconsistent between two systems mounting the same NFS share? [131093920020] |Hi all, [131093920030] |I have one IBM AIX server (serverA) which is connected to the san storage. [131093920040] |I have created a volume group and also file system (jfs2) and mounted to directory /profit. [131093920050] |After that I created a NFS share for that directory and started the NFS daemon. [131093920060] |Over at another server, which is IBM AIX also (serverB), I created a mount point /profit and mounted the nfs share from serverA to serverB using the below command: mount 192.168.10.1:/profit /profit [131093920070] |On serverB, I am able to access the directory and list the files in it. [131093920080] |But the strange thing is, on serverA, the directory and files are under the oracle user ownership. [131093920090] |But in serverB, i see them as a different user. [131093920100] |When i touch a file in that directory at serverB, on serverA, i see it as another user id. [131093920110] |Any clue how i can fix this? [131093920120] |Below is the file listing from serverB [131093920130] |On serverA it looks like below: [131093920140] |Below is the /etc/exports file from serverA [131093920150] |Thanks. [131093930010] |Remember that each of the NFS client systems will determine the username by looking up the numerical UID in /etc/passwd, or your centralized user database. [131093930020] |The NFS server only stores the UID in numerical format, and does not know about usernames. [131093930030] |This is also true for group names vs. GIDs. [131093930040] |In your case, serverA and serverB must have different usernames listed in /etc/passwd [131093930050] |To test this, use ls -n to display user and group IDs numerically, rather than converting to a user or group name in a long (-l) output. [131093930060] |If the ls -n option is not available on AIX, consult the manpage for this feature. [131093930070] |To see the username-to-uid mapping, do one of the following on both serverA and serverB. [131093930080] |Or, it's a good habit to use getent, since it works with /etc/password, and directory services (LDAP, etc.): [131093930090] |The UIDs should be the same on both systems, but the usernames will be different. [131093940010] |Get last set of non-empty lines [131093940020] |I'm running a cron job which should get only the last result of iostat -d 1 2. [131093940030] |This requires some parsing: What is the simplest way to get either the last set of non-empty lines from standard input to standard output if the length of each set is unknown? [131093940040] |Bad/non-working solutions: [131093940050] |
  • tail since I'd still need to count the number of lines in the last set. iostat -d 1 2 | tail -$(echo "$(iostat -d 1 2 | wc -l) / 2" | bc) depends on equal set sizes.
  • [131093940060] |
  • split/csplit since they output to file, and keep the useless part of the data.
  • [131093940070] |
  • iostat -d 1 2 | sed '1,/^$/d' | sed '1,/^$/d' works only in this special case, since it gets the third set of non-empty lines, but also includes any trailing newlines.
  • [131093940080] |
  • iostat -d 1 2 | tac | sed '1,/^$/d' | sed '/^$/q' is a slightly better hack: Reverse and print the first set. [131093940090] |However, since iostat outputs an empty line at the end, we first remove that then print until the next empty line in the reversed output. [131093940100] |Other commands might output any number of newlines at the end, so it's not a general solution. [131093940110] |Reverse again if you want to keep the original sequence.
  • [131093940120] |
  • grep -P with \Z seems to only detect EOL, not EOF.
  • [131093950010] |You can use awk with a record separator of "\n\n". [131093950020] |That way each "set" is one record and you can easily print out the last one. [131093960010] |perl -00 is a good way to read one paragraph at a time, so the last paragraph is: [131093970010] |Screen brightness always maximum when logoff or restart [131093970020] |I am using Fedora 13 and whenever I Restart or Logoff on my laptop. [131093970030] |The screen brightness resets to its maximum value. [131093970040] |I am not aware of this problem. [131093970050] |Can anyone tell me why this is causing and what is the solution for keeping it's to a constant value at all time? [131093980010] |You might want to check out the following bugs for possible explanations: [131093980020] |
  • https://bugzilla.redhat.com/show_bug.cgi?id=608900
  • [131093980030] |
  • https://bugs.launchpad.net/ubuntu/+source/gnome-power-manager/+bug/35223
  • [131093980040] |
  • https://bugs.launchpad.net/ubuntu/+source/gnome-power-manager/+bug/464577
  • [131093980050] |It seems that your problem is likely being caused either by gdm or by a bug in gnome-power-manager. [131093980060] |If it's the former, then the last bug above points to a discussion that contains a possible solution (see the post by swmail), however, I don't know if it will work in your case (let us know what happens, and we'll work from there ...). [131093980070] |If it's gnome-power-manager causing the problem, it seems that the bug still hasn't been fixed. [131093990010] |Linux kernel 2.6 on ARM [131093990020] |I have compiled and installed the 2.6 kernel on an ARM board. [131093990030] |I am using the ARM mini2440 board. [131093990040] |I would like to know if there is already a way to access the General Purpose I/O port pins? [131093990050] |Or will I have to do ioctl() and access them directly from the memory? [131094000010] |Use the sysfs control files in /sys/class/gpio. [131094000020] |The following links will hopefully be useful to helping you get started: [131094000030] |http://www.avrfreaks.net/wiki/index.php/Documentation:Linux/GPIO [131094000040] |Have seen reports of this article on the Beagle Board also working with the mini2440: http://blog.makezine.com/archive/2009/02/blinking_leds_with_the_beagle_board.html [131094000050] |In your Linux kernel documentation, look at Documentation/gpio.txt too. [131094010010] |Booting without initrd [131094010020] |Is it possible to boot linux without a initrd.img ? [131094010030] |I am planning to add default drivers as a part-of-kernel itself and avoid initrd completely. [131094010040] |What are the modules that should be made part-of-the-kernel instead of loadable modules ? [131094020010] |It is, unless your root volume is on an LVM, on a dmcrypt partition, or otherwise requires commands to be run before it can be accessed. [131094020020] |I haven't used an initrd on my server in years. [131094020030] |You need at a minimum these modules built in: [131094020040] |
  • the drivers of whatever controller where your root volume disk lives
  • [131094020050] |
  • the drivers necessary to "get to" that like PCI, PCIe support, USB support, etc.
  • [131094020060] |
  • the modules that run the filesystem mounted on it [131094020070] |It's also a very good idea to build in your network card drivers as well. [131094020080] |I've found that lspci/lsmod can help you here from your currently running kernel, look at what's there and use the make menuconfig search option before compiling to find where to enable the modules.
  • [131094030010] |How to cancel :X encryption in vi [131094030020] |This has annoyed me for years but I've never found a solution. [131094030030] |Instead of pressing Esc then :x to save an exit from vi, I accidentally type a capital X and press Enter. [131094030040] |The only way to continue is to allow encryption. [131094030050] |Surely there's a cancel command at this point? [131094040010] |You just have to enter an empty password twice. [131094040020] |There will be no encryption. [131094050010] |Can I change root password by sudo, without su? [131094050020] |I can sudo, but I don't have the root password so I can't su root. [131094050030] |Using sudo, can I change the root password? [131094060010] |Try this: [131094060020] |Note that you also wanna log in using su - instead of su (more info). [131094070010] |So you want to run something like sudo passwd root? [131094070020] |I don't think that this works everywhere. [131094080010] |You can also just use [131094080020] |and keep the root account without password. [131094090010] |you can also use sudo with the "-i" option. this will log you in as root without using the su command. [131094090020] |sudo -i [131094100010] |You can change all these options in sudoers file, even make no password if you want( I would not recommend this though). [131094110010] |Differences between Debian and Ubuntu [131094110020] |I'm getting sick of Ubuntu's seemingly random changes. [131094110030] |I'm thinking of switching to Debian permanently. [131094110040] |Does anyone know if there's a list of changes between the two distros somewhere? [131094110050] |I want to know what I'm getting myself into. [131094120010] |I think that this article explains some stuff. [131094120020] |In short: different installers, no proprietary software and no impressive GUI settings in Debian by default, Debian's major updates can last for years (this is for good IMHO), Unstable, Testing, and Stable repositories -- you choose what to favor (security vs latest versions of applications)... [131094130010] |Here's more I'm aware of (on top of @faif 's answer): [131094130020] |
  • The most visible one to me is that Ubuntu treats sudo with greater regard than Debian. [131094130030] |During Debian installation, the default option is to set up root password, as opposed to Ubuntu installation.
  • [131094130040] |
  • Ubuntu desktop is more polished (customised) than Debian's. Ubuntu's high regard for sudo is visible here too. [131094130050] |For example, even though you specify you don't want to set root password on Debian, the desktop is still going to ask you to enter root password, even if it hasn't been set up yet.
  • [131094130060] |
  • The Ubuntu installer is far prettier and, consequently, far heavier to run. [131094130070] |It's isn't much easier though, that is Debian's installer is quite easy to use as it is.
  • [131094130080] |
  • It's much easier to run a 3D desktop (Compiz) on Ubuntu than on Debian. [131094130090] |I is just a few clicks away, while in the case of Debian, you actually have to use the command line to run it.
  • [131094130100] |
  • YMMV, but many have claimed that Debian is more stable. [131094130110] |I can attest to that, although I haven't actually checked recently.
  • [131094130120] |
  • Debian is more conservative regarding system-wide technical changes, partly because it takes much more co-ordination to get things done, given it's a volunteer project without real Dictator (Benevolent or not).
  • [131094140010] |Go to the source: [131094140020] |Where did it all begin? [131094140030] |Linux was already established as an enterprise server platform in 2004. [131094140040] |But free software was still not a part of everyday life for most computer users. [131094140050] |That's why Mark Shuttleworth gathered a small team of developers from one of the most established Linux projects – Debian - and set out to create an easy-to-use Linux desktop, Ubuntu. [131094140060] |The vision for Ubuntu is part social and part economic: free software, available free of charge to everybody on the same terms, and funded through a portfolio of services provided by Canonical. [131094140070] |From: http://www.ubuntu.com/project/about-ubuntu [131094140080] |And then see: http://www.ubuntu.com/community/ubuntu-and-debian [131094140090] |So, differences are thousands, but in the core, we're talking about a strong distro as debian is, with a well defined methodology and rules to say: ok, now it's "stable"; and an easy-to-use desktop system, with defined time to release a system with mostly new and untested software. [131094140100] |If you're a common desktop user, then you'll love ubuntu. [131094140110] |Debian isn't built to be a newbie-friendly system, or something like that... say it's power-user-friendly. [131094140120] |But maybe you don't like Ubuntu, nor debian, then try OpenSUSE (Learn YaST). [131094140130] |BUT: If you're a relatively advanced Linux User, try Debian. [131094140140] |It's better than Ubuntu for experienced users, and i'd never found it "hard" to use. [131094140150] |BTW: I'm debian user since 4.0 "etch", and I love it. [131094140160] |Sorry about my English, Cheers [131094150010] |I used to run Debian, but got sick of waiting years for e.g. Firefox iceweasel icecat to be updated to a modern version. [131094150020] |Although security and some bug fix updates will go out between distro releases, generally you'll have to wait for a new distro release to go from, say, FF 3.5.12 to FF 4.2. [131094150030] |Fortunately, Debian releases have been more frequent of late, but there is still more delay and uncertainty than with Ubuntu's steady 6-month release cycle. [131094150040] |Of course, the benefit of Debian's patient release philosophy is that the result is more secure and stable. [131094150050] |IMHO this is a large part of the reason that it is the upstream distro for a number of others, including Ubuntu. [131094150060] |However, if you're not running a server or otherwise in a security-critical environment, and/or need/want to have fairly recent versions of apps installed, then Debian may not be the best choice. [131094150070] |There's also the option to run the unstable version of Debian, which will also give you more recent apps. [131094150080] |I am not sure how this compares in quality to running Ubuntu; I would guess that Ubuntu falls somewhere between Debian stable and unstable in terms of security and stability. [131094160010] |By list of changes I assume you mean major differences between the two distributions. [131094160020] |I know little about Ubuntu, so I'll mostly write about Debian. [131094160030] |Probably the main thing that distinguishes Debian from pretty much every other operating system on the planet is Debian Policy, which is what drives Debian's famous quality control. [131094160040] |Sadly, said quality control is looking a little frayed round the edges as the number of packages in Debian's archives heads north of twenty thousand. [131094160050] |Just check out the RC bugs for squeeze. [131094160060] |Ubuntu doesn't have anything like this, and its releases are noticeably buggier. [131094160070] |I've run into problems despite my extremely light use of Ubuntu. [131094160080] |Another thing is that when you send a bug report to Debian you will, at least some of the time, get a response, and possibly a bugfix. [131094160090] |(In general Debian developers, given that they are volunteers with little free time, are very friendly and helpful in my experience.) [131094160100] |With other operating systems it is mostly a black hole. [131094160110] |I used SuSE back in the 1990s for a couple of years. [131094160120] |They had no real bug reporting system, but there was an address that you could send feedback to, and I never got a reply in all the times I wrote there. [131094160130] |The only reply I got from anyone connected with SuSE during the whole time that I was using it was when I wrote directly to a packager's address. [131094160140] |From what I have heard Ubuntu/Canonical is rather similar. [131094160150] |I imagine fully proprietary systems like Windows are worse. [131094160160] |It is also worth noting that in community developed operating systems like Debian, developers manage packages because they are interested in them, and not infrequently, are experts in the domain area. [131094160170] |Eg. the PostgreSQL maintainer is a PostgreSQL developer, the Linux kernel maintainers are Linux developers, and so forth. [131094160180] |This would be relatively unusual in a non-community OS. [131094160190] |Debian is hard to beat on their own ground, which is, roughly, making the world's best damn operating system. [131094160200] |Yes, I'm biased. [131094160210] |If I had to point to downsides it is, obviously, that packages in Debian stable can get a little dated, but as the Linux kernel and its ecosystem moves towards maturity, it is less of a big deal that it used to be. [131094160220] |I have nightmare recollections of Netscape 4.77 locking up my machine back in the day. [131094160230] |Using free software took more dedication then. [131094160240] |In any case, one can get stuff from backports, which is now an official service, or backport packages oneself, which is not really difficult. [131094160250] |Ubuntu is much more focused on keeping software current with regular 6 month releases. [131094160260] |Obviously, this can involve compromises in quality as noted above. [131094160270] |Also, Debian is completely dedicated to free software, which can occasionally cause inconveniences. [131094160280] |Eg. the Debian kernel as of the squeeze release, no longer contains non-free software. [131094160290] |One can use a netinst installer containing the non-free bits if you need non-free stuff, but there is no full installer with non-free. [131094160300] |In contrast, Ubuntu/Canonical, have a much more... relaxed attitude towards non-free software. [131094160310] |Another thing is that the expected technical level in Debian is perhaps a bit higher, so the OS holds your hand a bit less than Ubuntu does. [131094160320] |However, the underlying system is essentially the same, so I'm not sure how much difference that really makes in practice. [131094170010] |If you read changelogs, you will see a lot of collaboration between Debian and Ubuntu. [131094170020] |Here is a workflow of the exchanges: [131094170030] |Security fixes not shown as they are everywhere except testing. [131094170040] |The biggest difference between those siamese twins is how does a package leaves the unstable/beta state to join the releasable. [131094170050] |In one case it is just time, in the other it is some form of quality assessment. [131094170060] |
  • Debian release cycle
  • [131094170070] |
  • Ubuntu reviewing of Debian packages: From Debian to Ubuntu
  • [131094170080] |
  • Utnubu: from Ubuntu to Debian
  • [131094170090] |Personally, I choose Debian testing because it has some form of stability (not being unstable for at least 10 days) with no specific patch day in the year (only once every two years). [131094170100] |In my point of view, Debian testing is even more stable than an biannual Ubuntu (not LTS). [131094170110] |For other person which ask for advise, I say "Ubuntu", for the sake of simplicity, people love to reinstall, I don't.