[131030660010] |Is there a parallel file archiver (like tar)? [131030660020] |Is there something out there for parallel archiving of files? [131030660030] |Tar is great, but I don't use tape archives, and it's more important to me that the archiving happens quickly (with compression like bzip2) since I have smp. [131030670010] |I think you are looking for pbzip2: [131030670020] |PBZIP2 is a parallel implementation of the bzip2 block-sorting file compressor that uses pthreads and achieves near-linear speedup on SMP machines. [131030670030] |Have a look at the project homepage or check your favorite package repository. [131030680010] |7zip can run on multiple threads when given the -mmt flag, but only when compressing into 7z-archives which offer great compression but are generally slower to create then zip archives. [131030680020] |Do something like this. [131030690010] |pigz is a parallel implementation of gzip, but can only really use multiple processors for compression, not decompression. [131030700010] |How do I convert an epoch timestamp to a human readable format on the cli? [131030700020] |How do I convert an epoch timestamp to a human readable format on the cli? [131030700030] |I think there's a way to do it with date but the syntax eludes me (other ways welcome). [131030710010] |date -d @1190000000 Replace 1190000000 with your epoch [131030720010] |This can come in handy for those applications which use epoch time in the logfiles: [131030730010] |On *BSD: [131030730020] |On Linux (specifically, with GNU coreutils ≥5.3: [131030730030] |With older versions of GNU date: [131030730040] |If you need portability, you're out of luck. [131030730050] |The only time you can format with a POSIX shell command (without doing the calculation yourself) line is the current time. [131030730060] |In practice, Perl is often available: [131030740010] |The two I frequently use are: [131030740020] |and [131030750010] |rpd over https using a linux client [131030750020] |I posted this on SuperUser but I thought this would be the better audience. [131030750030] |(So sorry for crossposting...) [131030750040] |My employer switched from vpn and rdp to using what our admin calls "rdp over https". [131030750050] |Since that switch I find myself unable to connect to the "new" rdp server. [131030750060] |I think the progress is as follows: [131030750070] |
  • A rdp gateway-server is connected via tls
  • [131030750080] |
  • the requested sever (different from the gateway-server) is then connected through the tls connection.
  • [131030750090] |In windows mstsc-settings the server name is the "internal network name" of the machine I wish to connect. [131030750100] |And on the last tab (in German it is called "leistung" - could be activity) I go to the "connection from everywhere" settings and set the gateway-server under gateway-server. [131030750110] |Now: Is there any way to use this scenario under linux (apart from a virtual machine running Windows)? [131030750120] |I am interested in [131030750130] |
  • free ideas (e.g. is it possible to create a tls tunnel and connect through that using freerdp/rdesktop?)
  • [131030750140] |
  • non-free ideas. [131030750150] |As long as they work I'll worry about the costs later.
  • [131030750160] |Free ideas would be better :-) [131030750170] |On SuperUser I got the idea to expose an ssh server and tunnel rdp through it. [131030750180] |This is a valid idea but not feasible in my case. [131030750190] |I really need a Idea to connect to the rdp server via the gateway-server. [131030760010] |Update: [131030760020] |I did some more research and it looks like it's NOT simply rdp tunneled over tls. [131030760030] |So, stunnel is not going to work for this scenario. [131030760040] |Now, I still don't know exactly how the gateway works - the protocols could be standard, or they could be some proprietary thing that Microsoft put together. [131030760050] |But who knows - you might get lucky and it be something standard. [131030760060] |The next thing I would try is ProxyTunnel. [131030760070] |If the gateway is a standard CONNECT proxy, then it might work. [131030760080] |The command would be something along these lines - [131030760090] |then rdp to localhost on local_port. [131030760100] |I can't promise it'll work, but it's worth a try... [131030760110] |If it's just a simple tls proxy, (plain rdp is tunneled over tls) you can try stunnel. [131030760120] |Set up an stunnel from localhost:some_port to gateway:rdp_port, then point your rdp client to localhost:some_port. [131030760130] |But if there's some other protocol involved (other than rdp and tls) then you're likely to need a client that supports that protocol. [131030760140] |In which case, does the MS RDP client work under WINE? [131030770010] |Gnome menu panel blank space [131030770020] |Hi, [131030770030] |I'm having a problem in the top menu panel since a couple of days, some space has been created between some icons and I don't know how to remove it. [131030770040] |A screendump: [131030770050] |Does anyone know what the reason could be for it? [131030770060] |By the way, I'm using Ubuntu Lucid (should I ask in the ubuntu site?). [131030770070] |Thanks [131030770080] |Edited: This is how it looks like now, still one blank space, but much better (I guess it has something to do with the question from Michael's link) [131030770090] |Edit 2: After a reboot, the blank space was gone so solved :) [131030780010] |As far as I can see from the screenshot, it could be either of two things. [131030780020] |It doesn't look like the spacing between icons as defined by gnome is off, but just to make sure, you could run: [131030780030] |The other possibility is that due to a resolution change your icons on the panel got stuck out of position. [131030780040] |This is really annoying, and if the icons are locked they won't automatically swap back into place when you switch to the previous res. [131030780050] |This happens a lot with dynamically resizable VMs. [131030780060] |To deal with this, make sure that the icons are unlocked (right click, untick "Lock") and then move them back to where they belong. [131030780070] |Please let us know if this resolved your issue. [131030780080] |Regards. [131030790010] |Where should I put software I compile myself? [131030790020] |I need to compile some software on my Fedora machine. [131030790030] |Where's the best place to put it so not to interfere with the packaged software? [131030800010] |If there is possibility - I'd suggest compiling your software and then creating FC package (I believe it's using yum to install software packages). [131030800020] |Then you can install that package of your own compiled software and remove it without messing up the whole system. [131030810010] |Most of the time, I like to place my own compiled stuff in /opt. [131030810020] |It's sort of a pseudo-standard place. [131030810030] |You can also consider /usr/local, but I prefer to keep my stuff 100% isolated. [131030820010] |if you are compiling an application you can add its executables path in you PATH env variable. this will not impact other users. [131030830010] |If you really don't want it to interfere at all, don't put it anywhere in your $PATH. [131030830020] |If you want it in $PATH, at least make sure not to install to /usr/local...I've found that a lot of software looks there even if it's installed by the distro into /usr. [131030830030] |My favorite way to install custom-compiled software is in my home directory. [131030830040] |That way you don't have to use sudo for anything, and it's very nicely separated from the rest of your system. [131030830050] |For example: [131030830060] |And if you want to, you can then add /home/username/stage/bin to your $PATH. [131030840010] |/usr/local/src [131030840020] |What I do is extract the source in this directory. [131030840030] |It will create a path like [131030840040] |/usr/local/src/postgresql-8.3.7 [131030840050] |I will create a symbolic link to this [131030840060] |/usr/local/src # ln -s postgresql-8.3.7 postgresql [131030840070] |Do all your building in /usr/local/src/postgresql [131030840080] |Doing things this way helps when you need to pop between versions and documents what version you are using. [131030850010] |There's always the option to "put it where it belongs" but write a simple rpm, first. [131030860010] |If you want to able to easily install and remove several applications you've built yourself, you can use Stow as a simple package manager. [131030870010] |Two things I'd recommend: [131030870020] |System wide: use stow and install under /usr/local/stow/package-version. [131030870030] |Then you can easily switch between version. [131030870040] |In my home, or if I don't have /usr/local write permissions, I personally install programs under ~/.local, which is hinted by XDG standard. [131030870050] |You can also use stow locally, although I never did :) [131030880010] |FHS says to put it in /usr/local where distributions shouldn't be touching it. /usr/local/bin for the binaries /usr/local/src for the source and /usr/local/lib for libraries. [131030880020] |See the FHS spec for more info [131030890010] |I have a little different setup than most people because I do a lot of development. [131030890020] |I have a /home/jackson/bin/ directory that I install stuff into and I've edited my .bashrc adding this: [131030890030] |I wouldn't do this for everything, but its nice during development. [131030900010] |Rule of thumb, at least on Debian-flavoured systems: [131030900020] |/usr/local for stuff which is "systemwide" - i.e. /usr/local tends to be in a distro's default $PATH, and follows a standard UNIX directory hierarchy with /usr/local/bin, /usr/local/lib, etc. [131030900030] |/opt for stuff you don't trust to make systemwide, with per-app prefixes - i.e. /opt/firefox-3.6.8, /opt/mono-2.6.7, and so on. [131030900040] |Stuff in here requires more careful management, but is also less likely to break your system - and is easier to remove since you just delete the folder and it's gone. [131030910010] |If you want your application to be available for all users on the system and you have the necessary permissions, use /opt. [131030910020] |If you want the application to be available only for you (and root), use /home/username [131030920010] |This reminds me, I need to use checkinstall more often! [131030920020] |That way I just do the usual [131030920030] |followed by [131030920040] |to create a .deb file... [131030930010] |Per the FHS, /usr/local/ is used for applications compiled from source, while /opt/ is used for 3rd party applications not supported by your operating system vendor. [131030940010] |It is actually not that hard to create deb's or rpm's from a source tarball. [131030940020] |That way, you can use the facilities of your distro's package manager to keep your system clean. [131030940030] |This is what I do, most of the time: just create a little rpm. [131030950010] |What is the Linux equivalent of the Windows registry? [131030950020] |I have a DVD+-RW drive that has quit working. [131030950030] |Apparently many users of this laptop model experience the same problem under windows and are required to edit the registry to correct the problem. [131030950040] |So where should I look to make a similar edit? [131030960010] |Thankfully, there is no Linux equivalent of the Windows registry. [131030960020] |Configuration is kept in (mostly) text files: [131030960030] |
  • The system configuration is in text files under /etc.
  • [131030960040] |
  • The system state, which in Windows ends up mixed with configuration data, lives under /var.
  • [131030960050] |
  • User configuration and state lives in “dot files”, i.e., files and directories whose name begins with a . in your home directory.
  • [131030960060] |You can't simply transpose a registry edit to a configuration in another operating system: registry edits are completely Windows-specific. [131030960070] |You'll have to understand what the registry edit is doing and transpose it to Linux. [131030960080] |It's likely that you'll end up modifying a file under /etc, but there are too many potential candidates to list here (also, it might depend on your distribution). [131030970010] |What does the 'a' attribute in lsattr mean? [131030970020] |I was trying to remove some old history from my .bash_history file, but I was receiving this message: [131030970030] |I suspected the file/directory permission: [131030970040] |Then I tried: [131030970050] |Probably it is this a attribute; what does it mean? [131030980010] |The a attribute means that the file is append-only: you can't overwrite it or delete it, only append data to it. [131030980020] |This is explained in the chattr man page. [131030980030] |Only root can remove the attribute. [131030980040] |The practical consequence is that you can't erase your old history lines. [131030980050] |This is presumably intended as a security measure by your system administrator. [131030980060] |I'm not completely convinced it's secure, but off the top of my head I can't think of a way to remove some of the file's contents. [131030980070] |(It is however easy to bypass the file and run commands without their showing in the history, which is why it's not a particularly useful security measure against competent users — an obvious way being to run the commands from something other than bash.). [131030990010] |linux: How to determine the best filesystem format? [131030990020] |About a year ago I changed from running Windows as dual boot to very rarely running Windows as a VM. [131030990030] |As a result most of my partitions are in ntfs ( so I had access on both sides of the boot ). [131030990040] |I have decided to reformat all these partitions to ... [131030990050] |Looking for the best first class filesystem format, [131030990060] |I am using a desktop with 1T-2T storage. [131030990070] |So how do I determine which one best serves my needs? [131031000010] |Best file system is subjective. [131031000020] |Since you haven't specified your needs I'd suggest to use EXT4. [131031000030] |It has got better speed and support files with sizes up to 16TB. [131031010010] |Is there a back-"button" in w3m? [131031010020] |Does w3m offer a keyboard shortcut to go back one page? [131031010030] |I couldn't find anything in the man pages. [131031020010] |It's B (capital B) [131031030010] |Changing the bash prompt [131031030020] |Where is the setting that determines what the bash prompt looks like? [131031030030] |Specifically on Arch, but I'm sure others would like to know for other distros too if it's different. [131031030040] |Speficially I'd like to use (K)Ubuntu's prompt [131031040010] |The environment Variables "$PS1" and "$PS2" set the prompt's look. [131031040020] |You can check this howto in order to see all the different variables you can put in there. ` [131031050010] |As tante said, you have to set the $PS1(left prompt) (and optionally $PS2(second line prompt)). [131031050020] |(Others variable exists on other shells like $RPS1 (right prompt) for zsh) [131031050030] |The best thing to do is to edit your .bashrc file in your home directory and add something like : [131031050040] |I will give you an additionnal link that I always find useful because there's a good list of the avalaible colors. [131031060010] |As others have said, this is determined by the environment vars PS1 and PS2. [131031060020] |Ubuntu's default ps1 is: ${debian_chroot:+($debian_chroot)}\u@\h:\w\$ [131031060030] |So you'll want to run the following: [131031060040] |export PS1=${debian_chroot:+($debian_chroot)}\u@\h:\w\$ [131031060050] |To run that every time you log in, put it in your ~/.bashrc file: [131031070010] |Since you asked specifically about Arch (well, it doesn't really matter, but it makes a nice excuse to add to the answers...), you should look at this entry in the Arch Wiki: Color Bash Prompt. [131031070020] |And for even more fun, this thread in the Arch Forums: What's your PS1?. [131031070030] |(Pages and pages of people trying to outdo each other with more and more elaborate prompts.... that's the typical Arch user for you.) [131031080010] |Am I installing CentOS 5.5 right? [131031080020] |Hi - I'll probably be in here a bit over the next few months. [131031080030] |The only exposure I've had to Linux is just some basic dabbling with Ubuntu and using Knoppix as a recovery DVD for when things go wrong. [131031080040] |I need to setup a VM with CentOS 5.5 64bit. [131031080050] |I downloaded the iso from the main site. [131031080060] |Have mounted it with VMWare workstation. [131031080070] |This link seems to be the best one I can find on getting things setup. [131031080080] |However it differs to some of the YouTube videos I have seen installing 5.4 [131031080090] |Should I be doing a Network Installation? [131031080100] |Theres a step in the above guide that points to a mirror to pull the image from a webserver. [131031080110] |Surely the image is on the ISO I downloaded? [131031080120] |However, I do not see any other option to install other than network install. [131031080130] |Can anyone tell me where I am going wrong? [131031080140] |I am sure it is something silly. [131031090010] |There are three kinds of ISOs: First the DVD-ISO which is the best suited for you, I think. [131031090020] |Then there is a set of CD images which only make sense to download if you need physical disks but don't have a DVD burner and thirdly the netinstall ISO which you seem to have downloaded. [131031090030] |To find a mirror which has the DVD isos directly available for download, have a look at http://www.centos.org/modules/tinycontent/index.php?id=30 [131031090040] |A network installation means that on the ISO only the installer is included and all packages which are going to be installed are downloaded from the net during install. [131031090050] |If you have little experience with Linux, the easiest would be to get the DVD Iso. [131031090060] |With it, the installation is pretty easy. [131031090070] |Then of course the techotopia.com-Link doesn't apply any more, as this only explains a network install. [131031090080] |If you need an installation guide (again, if you use the graphical installer it is pretty self-explainable) you might have a look at the official guide for 5.2. [131031090090] |The installation process of 5.5 should be identical to 5.2. [131031090100] |See http://www.centos.org/docs/5/html/5.2/Installation_Guide/ [131031090110] |Finally if you run into problems and need live, interactive help, you might try the #centos channel in freenode IRC. [131031090120] |If you can wait some minutes, of course better ask here. [131031100010] |How to know the size of a directory? [131031100020] |How to know the size of a directory? [131031100030] |Including subdirectories and files. [131031110010] |Or to get human readable output: [131031110020] |The -s option means that it won't list the size for each subdirectory, only the total size. [131031120010] |How to get rid of desktop environment and use a window manager only? [131031120020] |I have been using xterm for all my work. [131031120030] |I realized that the features that desktop environments like GNOME has to provide are not of much use to me. [131031120040] |Now is it possible that I remove GNOME and KDE altogether and use some window manager only in run level 5 (X11) to play videos, use browser, and occasionally file manager like Nautilus. [131031120050] |How can I do it? [131031120060] |Is it a good idea? [131031120070] |Which window manager would you suggest? [131031120080] |What I have done so far: I installed Window Maker. [131031120090] |When I rebooted, I was offered one more choice at the time of login - GNOME, KDE, Window Maker. [131031120100] |I chose Window Maker. [131031120110] |It gives me multiple workspaces, customizable keyboard shortcuts, without usual desktop features like panel, notification area, desktop icons. [131031120120] |But I have observed that whenever I launch Nautilus, the desktop background changes to the one I set on GNOME and all desktop icons are restored as they were in GNOME, though the keyboard shortcuts of Window Maker still works. [131031120130] |But to remove GNOME background and desktop icons I have to logout and login again. [131031120140] |How can I fix it so that launching of Nautilus does not bring GNOME background? [131031120150] |Should I use some other file manager? [131031120160] |

    Update

    [131031120170] |I have complied and installed dwm. [131031120180] |It was not difficult at all. [131031120190] |Though I needed to do the following steps to make dwm show in the menu of my login screen. [131031120200] |In the dwm.desktop I wrote [131031120210] |This time when I got to login, I got dwm in the menu. [131031120220] |

    Update

    [131031120230] |I solved the nautilus problem using following steps. [131031120240] |Here I searched for nautilus. [131031120250] |It gave me [131031120260] |After that it was a simple matter of setting keys [131031120270] |Useful link [131031120280] |dwm Primer GConf Command Line Tool [131031130010] |How can I fix it so that launching of Nautilus does not bring GNOME background? [131031130020] |The reason that this happens is that Nautilus is not only Gnome's file manager it's also responsible for drawing Gnome's desktop. [131031130030] |So when you start nautilus it renders you desktop because it views that as one of it's responsibilities. [131031130040] |To disable this behavior, invoke it with the option --no-desktop or set the gconf key /apps/nautilus/preferences/show_desktop to false. [131031140010] |Hi Andrew, [131031140020] |I asked a similar question once. [131031140030] |It is definitely a good idea if you find yourself ignoring the miscellaneous tools and features that come with the desktop environment. [131031140040] |The solution is, you don't need to install a desktop environment (or anything you don't use), just a window manager of your choice. [131031140050] |I (also) asked another question about lightweight window managers. [131031140060] |The summary is, if you want lots of effects go Compiz, otherwise choose a lightweight one like dwm. [131031140070] |Regarding Nautilus, do you really need it or some of it features? [131031140080] |If not then you should probably switch to something else, maybe Thunar. [131031150010] |Frontend for libsane for manual batch scans, [131031150020] |Platform: Linux [131031150030] |I have several documents that I want to batch scan without autofeed. [131031150040] |Basically meaning that after a scan I want to "flip the page" and press a button to scan the next page, in the end getting a pdf document. [131031150050] |Suggestions for software that will do this? [131031160010] |The standard sane frontend XSane claims to be able to do this. [131031160020] |In the multipage mode you can collect several images and create a multipage file. [131031160030] |Available multipage formats are postscript, PDF and tiff. [131031160040] |See the online documentation at http://www.xsane.org/doc/sane-xsane-multipage-doc.html for details on usage. [131031170010] |I believe that both XSane and Simple Scan can do this. [131031170020] |In Simple Scan, [131031170030] |Each page you scan is added to the end of your document. [131031170040] |To start a new document select Document ▸ New. [131031170050] |Individual pages can be deleted by right clicking a page or pressing the Delete key. [131031170060] |In my experience Simple Scan is easier to use in general, but I have not used it for this purpose specifically. [131031170070] |If your main goal is to produce a single pdf at the end, then you can always scan each page and save each page separately with a filenames such as document-page-01.pdf (note that I used 01, if you have more than 9 pages, this is important in order to ensure proper sorting of the pages in the final document) then you can use ImageMagick's convert command to easily merge them into one document: [131031170080] |ImageMagick can be easily installed on every major Linux distribution. [131031170090] |Another tool that will yield similar results is pdftk which, according to the website, uses the following syntax to merge files: [131031170100] |I've always used convert since it is a great swiss-army-knife-type tool for image files, but I'm told that pdftk is often much faster and produces better pdfs using the default settings. [131031170110] |This is often nice for when you already have a long pdf and want to append pages to it. [131031180010] |What does the options `ServerAliveInterval` and `ClientAliveInterval` in sshd_config do, precisely? [131031180020] |I found this question, but I'm sorry I don't quite understand the settings on the two variables ServerAliveInterval and ClientAliveInterval mentioned in the accepted response. [131031180030] |If my local server is timing out, should I set this value to zero? [131031180040] |Will it then never time out? [131031180050] |Should I instead set it to 300 seconds or something? [131031180060] |My question is simply, some of my connections time out when I suspend &then unsuspend my laptop with the response Write failed: Broken pipe and some don't. [131031180070] |How can I correctly configure a local sshd so that they don't fail with a broken pipe? [131031190010] |ServerAliveInterval: number of seconds that the client will wait before sending a null packet to the server (to keep the connection alive). [131031190020] |ClientAliveInternal: number of seconds that the server will wait before sending a null packet to the client (to keep the connection alive). [131031190030] |Setting a value of 0 (the default) will disable these features so your connection could drop if it is idle for too long. [131031190040] |ServerAliveInterval seems to be the most common strategy to keep a connection alive. [131031190050] |To prevent the broken pipe problem, here is the ssh config I use in my .ssh/config file: [131031200010] |What are the pros/cons of the various methods to block brute force SSH attacks? [131031200020] |There are a number of different packages out there to shut out IPs from which brute-force SSH attacks are launched on your system. [131031200030] |For example: [131031200040] |
  • DenyHosts
  • [131031200050] |
  • Sshguard
  • [131031200060] |
  • fail2ban
  • [131031200070] |What are the pros/cons of these, or any others? [131031200080] |My current solution is to take the email that logwatch generates every day and dump the egregious IP addresses into a text file which I feed into a script that then rebuilds iptables. [131031200090] |It's hacky, time-consuming and manual, and I'd like a better way. [131031200100] |(Note that I didn't ask what was the "best" way to solve the problem, because there is no "best" way to do anything.) [131031210010] |I use DenyHosts, so I can at least answer for that: [131031210020] |

    Pros

    [131031210030] |
  • It's completely automatic
  • [131031210040] |
  • It's configurable (how many failed attempts before blacklisting, for usernames that don't exist, usernames that do exist, and a special entry for root)
  • [131031210050] |
  • It can e-mail you with a list of newly blacklisted hosts periodically, and/or run a given program every time a new host is blacklisted
  • [131031210060] |
  • It supports automatically un-blacklisting hosts after a while
  • [131031210070] |

    Cons

    [131031210080] |I don't have any irreparable cons, as long as you use it correctly: [131031210090] |
  • In its default configuration it won't alert you to newly blacklisted hosts, so if somebody is attacking your network from hundreds of different addresses you might not notice right away like you would if you're monitoring your logs manually, but (as mentioned in the pros section) it can e-mail you or run an executable to alert you when new hosts are added
  • [131031210100] |
  • By default it will blacklist your hosts the same as any other, so you probably want to add them to /etc/hosts.allow. [131031210110] |I locked myself out once just failing at typing my password, and once somebody from work tried to login to my root account as a joke and blacklisted my work IP, and it took me a few days to figure out why I suddenly couldn't connect to my network from work anymore
  • [131031220010] |Another one is fail2ban, which relies on iptables (so it works with any service, not just ssh). [131031220020] |With fail2ban, you can: [131031220030] |
  • Specify path to any log file (apache, ssh, nginx, mail server, ...).
  • [131031220040] |
  • Specify regex for attack patterns (e.g., more than 10 "404 errors" by the same ip on nginx access log in 6 seconds)
  • [131031220050] |
  • Specify regex to ignore certain patterns (very useful!)
  • [131031220060] |
  • Specify ban time
  • [131031220070] |
  • Send an email (or any other alert...)
  • [131031220080] |
  • Fully customizable (you can write your own alerts and filters)
  • [131031220090] |One "disadvantage" of DenyHosts is that it requires tcp wrappers, so it will only work with services that look at the /etc/hosts.deny file. [131031220100] |But to be fair with DenyHosts, sshd is compiled to use TCP Wrappers on most Linux distributions. [131031220110] |I also find DenyHosts to be easier to configure out of the box than fail2ban (but less powerful). [131031220120] |Reference to a similar SF question [131031230010] |A simple and in practice effective protection against scan-based attacks is not to use the standard port. [131031230020] |443 (the https port) exposes you to different brute-force attacks that aren't going to crack your weak passwords, and possibly works through more firewalls than the default port (22). [131031230030] |Most methods to prevent ssh brute force attacks are great ways to self-DoS (oops, I screwed up the configuration! [131031230040] |Oops, I did a bunch of quick rsync's and am now banned for the day!) or assisted-self-DoS (Oops, the attacker comes from/has subverted a machine in the same subnet as me (dynamic IP range, college network...) and I'm getting banned as well!). [131031230050] |If you only log in from a few places, you can just whitelist source IP addresses. [131031230060] |That's obviously no good if you want to ssh from your laptop or cell phone on the go. [131031230070] |Having an ssh daemon that only listens to IPv6 connections should protect you from scans for a few years yet. [131031230080] |But many firewalls won't let you transport IPv6 in any reasonable way. [131031230090] |Another method you don't mention is port knocking. [131031230100] |It doesn't suffer from as self-DoS problems (other than misconfiguration), but it doesn't cross firewalls well, and can add several seconds' latency to connection establishment. [131031230110] |If you have good passwords, or you can live without password authentication, disable password authentication. [131031230120] |(Keys and one-time passwords are sufficient for most use cases: if you don't trust the client machine enough to store an ssh key, you don't trust it not to have a keylogger either). [131031230130] |Then brute force attacks will cost you a bit of CPU and bandwidth but don't expose you to an intrusion (as long as you've checked none of your keys came from a Debian low-entropy OpenSSL). [131031240010] |How can I install perldoc on Ubuntu? [131031240020] |Ubuntu 10.10 comes with Perl 5.10.1 pre-installed, but strangely enough perldoc isn't part of the package. [131031240030] |How can I make this feature available? [131031250010] |I feel a bit stupid saying it, but did you try installing perl-doc? [131031260010] |You need to install the perl-doc package. [131031260020] |It tells you right there in the error message. [131031270010] |You should simply install the perl-doc package? [131031270020] |Use your favorite package manager, for example synaptic or sudo aptitude install perl-doc [131031280010] |Is there an easy way to replace duplicate files with hardlinks? [131031280020] |I'm looking for an easy way (a command or series of commands, probably involving find) to find duplicate files in two directories, and replace the files in one directory with hardlinks of the files in the other directory. [131031280030] |Here's the situation: This is a file server which multiple people store audio files on, each user having their own folder. [131031280040] |Sometimes multiple people have copies of the exact same audio files. [131031280050] |Right now, these are duplicates. [131031280060] |I'd like to make it so they're hardlinks, to save hard drive space. [131031290010] |To find duplicate files you can use duff. [131031290020] |Duff is a Unix command-line utility for quickly finding duplicates in a given set of files. [131031290030] |Simply run: [131031290040] |To create hardlinks to those files automaticly, you will need to parse the output of duff with bash or some other scripting language. [131031300010] |Use the fdupes tool: [131031300020] |fdupes -r /path/to/folder gives you a list of duplicates in the directory (-r makes it recursive). [131031300030] |The output looks like this: [131031300040] |filename1 filename2 [131031300050] |filename3 filename4 filename5 [131031300060] |with filename1 and filename2 being identical and filename3, filename4 and filename5 also being identical. [131031310010] |There is a perl script at http://cpansearch.perl.org/src/ANDK/Perl-Repository-APC-2.002/eg/trimtrees.pl which does exactly what you want: [131031310020] |Traverse all directories named on the command line, compute MD5 checksums and find files with identical MD5. [131031310030] |IF they are equal, do a real comparison if they are really equal, replace the second of two files with a hard link to the first one. [131031320010] |Since your main target is to save disk space, there is another solution: de-duplication (and probably compression) on file system level. [131031320020] |Compared with the hard-link solution, it does not have the problem of inadvertently affecting other linked files. [131031320030] |ZFS has dedup (block-level, not file-level) since pool version 23 and compression since long time ago. [131031320040] |If you are using linux, you may try zfs-fuse, or if you use BSD, it is natively supported. [131031330010] |This is one of the functions provided by "fslint" -- http://en.flossmanuals.net/FSlint/Introduction [131031340010] |Use _roff to underline words. [131031340020] |I currently have a file that I'd like to pass through a _roff to format with underline a few words in the file, and then view the file in less. [131031340030] |Just a few, mind you, not whole sections or anything. [131031340040] |How do i underline specific words in a file with _roff? [131031340050] |NB: I know I have groff and nroff. [131031340060] |NNB: I don't know a whole lot about type formatting. [131031350010] |At least with groff (I'm not sure it's portable), .ul gives you underline. [131031350020] |If the only formatting you want is underlining, there may be an easier way. [131031350030] |For example less automatically converts the sequence character-backspace-underscore (or underscore-backspace-character) to the underlined character; it also converts character-backspace-character to boldface. [131031360010] |How to use the ul command line utility [131031360020] |I wanted to answer http://unix.stackexchange.com/questions/3043/use-roff-to-underline-words with "just use ul, this command is meant specifically for underlining text", however I just can't grasp how to use it. [131031360030] |I thought [131031360040] |would give me an underlined "kitty", however it doesn't. [131031360050] |What am I doing wrong? [131031370010] |The input format requires character-backspace-underscore or character-backspace-letter to underline a character. [131031370020] |You also get boldface with character-backspace-character. [131031370030] |Less does a similar transformation automatically. [131031380010] |Drive was unable to assemble into the array [131031380020] |I ran [131031380030] |Only /dev/sdb1 was loaded into the array though. [131031380040] |I have a few more arrays on the same two drives too. [131031380050] |Each time the partition on sda failed. dmesg told me that sda was out of sync... [131031380060] |Since this was from a rescue cd. [131031380070] |I've disconnected sda (hardware wise) for the time being, since it was preventing me from booting. [131031380080] |How should I proceed? [131031380090] |Is this likely the cause of a borked drive? [131031380100] |I had some weird fs issues the other day I couldn't track down (maybe a precursor): missing files that later magically re-appeared. [131031380110] |Maybe a missing cable? [131031380120] |The main question is how do I try to re-sync the drive? [131031380130] |update [131031380140] |I ran badblocks on the whole other drive, and a long smartctl test, it found no problems. [131031380150] |a request output of mdadm -D /dev/md0 (I have md0-3 if others are needed) [131031380160] |Since I've found no actual issues with the drive, but obviously something went wrong, I'm wondering what I should do next? as of today a full backup of important data is in place [131031380170] |update 2 Whenever I try to add what was sda back in (at least without wiping it) it screw's up my boot process with a kernel magic number error. [131031380180] |I'm guessing because the kernel version got out of sync. currently this drive is in an external enclosure as sdd. [131031380190] |Should I re-add (re-sync) this drive while it's connected via usb? will that 'cause problems? [131031380200] |each md drive has an sda/sdb corresponding. it was the sda drive (or 0 drive) in the array that I had to pull. [131031390010] |Okay, clearly one of your disks is not active in the array right now. [131031390020] |Let's say, under the current enumeration, that /dev/md0 is missing /dev/sdb1. [131031390030] |To add /dev/sdb1 back in its former state: [131031390040] |You may want to re-check the array to make sure the data is all consistent. [131031390050] |To re-mirror from scratch: [131031390060] |Make sure that /dev/sdb1 is completely removed from the array. [131031390070] |Wipe out the configuration on /dev/sdb1 so that mdadm will add it to back to the array as if it were a completely new disk. [131031390080] |Add /dev/sdb1 back to the array as a member. [131031390090] |Syncing a disk on USB works, slowly. [131031390100] |However, I would guess that your problem is that your bootloader isn't installed properly on your second drive, which is preventing you from booting when it's inserted. [131031390110] |You could swap the order of those two drives, so that your system boots off of the drive with known good configuration. [131031390120] |Once you are up and running and can sync both drives, you should re-install the bootloader on both drives. [131031390130] |This way you can always boot no matter which drive is missing or enumerates first. [131031390140] |How to re-install your bootloader varies: [131031390150] |
  • If you are using lilo ≥ 22.0, specify boot = /dev/md0 and raid-extra-boot = mbr in /etc/lilo.conf and re-run lilo. [131031390160] |If you are using an older lilo, create two lilo configurations, one for each disk in the the array, and install lilo to each disk individually.
  • [131031390170] |
  • If you are using Grub, try to run grub-install /dev/sda and grub-install /dev/sdb. [131031390180] |If that fails, then try using the Grub shell to setup (hd0) and setup (hd1) (cat /boot/grub/device.map to see what Grub's hard disk numberings are).
  • [131031400010] |Tiling windows in GNOME [131031400020] |How can I get tiling windows in GNOME? [131031410010] |GNOME is a desktop environment; it's not responsible for handling your windows. [131031410020] |You need to change your window manager, which does handle that sort of thing. [131031410030] |There are quite a few tiling window managers for X you can experiment with [131031420010] |It depends a bit what you mean by tiling: Permanently tiling or just temporary to get an overview and select a window? [131031420020] |If you use compiz ("Desktop effects") the latter is possible by pressing Super+W (Super is normally the "Windows"-Key). [131031420030] |For "permanent" tiling: [131031420040] |Tile windows with compiz: [131031420050] |Install the Compiz Settings manager (e.g. package compizconfig-settings-manager for Ubuntu) and the additional plugins (again for Ubuntu: compiz-fusion-plugins-extra). [131031420060] |Then activate the Grid plugin -- then you can use Ctrl+Alt and a number on your keypad to move and resize the window so that it fits an imaginary grid. [131031420070] |This allows very comfortable tiling. [131031420080] |Tile windows without compiz: [131031420090] |If you do not use compiz, there is a gnome applet that allows tiling: http://www.giuspen.com/x-tile/ [131031430010] |As has been mentioned, Gnome is not a Window Manager, but a Desktop Environment. [131031430020] |You can choose from many tiling window managers, such as StumpWM, wmii, or XMonad. [131031430030] |Here is how you use one to replace the default window manager. [131031430040] |From Mikael Jansson(with a little editing by me to make this more general). [131031430050] |If you, like me, use gnome-session 2.3 and earlier, you'll want to add this to your ~/.gnomerc: [131031430060] |If on the other hand you run gnome-session 2.4 and later, you'll have to change a key in the registry: [131031430070] |making sure the binary is in your path. [131031430080] |This will give you Gnome and default theme settings (such as fonts), but with your-favorite-window-manager instead of Metacity. [131031440010] |As other folks have said, you can use whatever tiling window manager tickles your fancy. [131031440020] |Xmonad, however, is one of the few - AFAIK - which advertises GNOME integration and is widely used with it. [131031440030] |Well, for some definition of "widely" I suppose. [131031450010] |The applet 'X Tile' can tile your windows from the Gnome panel on demand. [131031450020] |It's in Fedora at least and works nicely. [131031460010] |BlueTile is based on Xmonad but configured OOTB to work well with GNOME (to some degree, it's not as polished as Metacity or Compiz yet...). [131031470010] |How to echo a bang! [131031470020] |I tried to create a script by echo'ing the contents into a file, instead of opening it with a editor [131031470030] |The output: [131031470040] |bash: !/bin/bash: event not found [131031470050] |I've isolated this strange behavior to the bang. [131031470060] |
  • Why is bang causing this?
  • [131031470070] |
  • What are these "events" that bash refers to?
  • [131031470080] |
  • How do I get past this problem and print "#!/bin/bash" to the screen or my file?
  • [131031480010] |Try using single quotes. [131031480020] |The problem is occurring because bash is searching its history for !/bin/bash. [131031480030] |Using single quotes escapes this behaviour. [131031490010] |As Richm said, bash is trying to do a history match. [131031490020] |Another way to avoid it is to just escape the bang with a \: [131031500010] |! starts a history substitution (an “event” is a line in the command history); for example !ls expands to the last command beginning with ls, and !?foo expands to the last command containing foo. [131031500020] |You can also extract specific words (e.g. !!:1 refers to the first word of the previous command) and more; see the manual for details. [131031500030] |This feature was invented to quickly recall previous commands in the days when command line edition was primitive. [131031500040] |With modern shells (at least bash and zsh) and copy-and-paste, history expansion is not as useful as it used to be — it's still helpful, but you can get by without it. [131031500050] |You can change which character triggers history substitution by setting the histchars variable; if you rarely use history substitution, you can set e.g. histchars='¡^' so that ¡ triggers history expansion instead of !. [131031500060] |You can even turn off the feature altogether with set +o histexpand. [131031510010] |proposed solutions don't work in e.g. following example: [131031510020] |in this case bang can be printed using it's octal ASCII code: [131031520010] |Alternative to .bashrc [131031520020] |Is ~/.bashrc the only place where I can specify user specific ENV Variables, aliases, modifications to PATH variable, etc? [131031520030] |I ask because it seems that ~/.bashrc would be bash only... [131031530010] |There is no such thing like a environment config file for different shells, because its even shell specific how they are defined. [131031530020] |In csh you use setenv in bash you use export to define them. [131031530030] |Anyway you could write your own config file and include it with source in the dotfiles of your shells. [131031540010] |The file $HOME/.profile is used by a number of shells, including bash, sh, dash, and possibly others. [131031540020] |From the bash man page: [131031540030] |When bash is invoked as an interactive login shell, ... it first reads and executes commands from the file /etc/profile, if that file exists. [131031540040] |After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. [131031540050] |csh and tcsh explicitly don't look at ~/.profile but those shells are kinda antiquated. [131031550010] |~/.profile is the right place for environment variable definitions and for non-graphical programs that you want to run when you log in (e.g. ssh-agent, screen -m). [131031550020] |It is executed by your login shell if that is a Bourne-style shell (sh, ksh, bash). [131031550030] |Zsh runs ~/.zprofile instead, and Csh and tcsh run ~/.login. [131031550040] |If you log in under an X display manager (xdm, gdm, kdm, ...), whether ~/.profile is run depends how your display manager and perhaps desktop environment were configured by your distribution. [131031550050] |If you log in under a “custom session”, that usually executes ~/.xsession. [131031550060] |~/.bashrc is the right place for bash-specific settings, such as aliases, functions, shell options and prompts. [131031550070] |As the name indicates, it is specific to bash; csh has ~/.cshrc, ksh has ~/.kshrc, and zsh has ~/.zshrc. [131031550080] |See also: Difference between .bashrc and .bash_profile Which setup files should be used for setting up environment variables with bash? [131031550090] |Zsh not hitting ~/.profile [131031560010] |Save complete GNU screen session state [131031560020] |Is it possible to persist the "state" of a GNU screen window (or just a standard shell) so that I can reload everything after a reboot? [131031560030] |By state I mean: [131031560040] |
  • The number of opened shells
  • [131031560050] |
  • The name of each shell
  • [131031560060] |
  • The current directory of each shell
  • [131031560070] |
  • The history of each shell
  • [131031560080] |
  • If possible, their environment variables
  • [131031560090] |Thanks! [131031570010] |There is a tool to freeze the state of a process called cryopid. [131031570020] |However, currently it doesn't work with GNU screen as it doesn't support re-creating a hierarchy of sub-processes. [131031570030] |They state that they want to achieve this in the future but the project doesn't seem to be too active at the moment. [131031570040] |Nevertheless, you might want to trace their progress. [131031580010] |It is not really possible to save a complete screen session. [131031580020] |What you can do is to create a proper .screenrc which will setup some things after you restarted your system. [131031580030] |Here are some comments to the things you listed: [131031580040] |
  • The number of opened shells
  • [131031580050] |
  • The name of each shell
  • [131031580060] |
  • The current directory of each shell
  • [131031580070] |I use something like this in my .screenrc to open some specific shells on startup: [131031580080] |You will get the string between '' as your window name and the command after the name will be executed on your default shell. [131031580090] |Include any script you want, for example change in a specific directory and open some logs. [131031580100] |
  • The history of each shell
  • [131031580110] |Have you ever thought about sharing the history of the shells across your sessions? [131031580120] |IMHO this makes things much more easier. [131031580130] |In ZSH its done with setopt SHARE_HISTORY in your .zshrc [131031580140] |
  • If possible, their environment variables
  • [131031580150] |If you really need this and don't want any trade-off you could think about a shell script, which reads out the current state of screen, saves the number of shells, environment variables, etc. and puts this information in a startup script called by your .screenrc. [131031580160] |For me this would not be worth the effort because I appreciate a clean environment after a reboot, if I can customize the default windows for screen. [131031590010] |I built a similar thing on solaris years back. [131031590020] |Not even screen-related; it was session related. "if $TTY = whatever". echox has the right idea. [131031590030] |tip: if you're doing this across multiple machines, recognize that each machine deserves its own definition of what should be done when you login there, rather than all being the same per your nfs mounted /home or similar. [131031590040] |HTH, -pbr [131031600010] |How to install xfontsel on Fedora 13? Any alternative? [131031600020] |I need xfontsel to select right font for xterm. [131031600030] |But its not installed. [131031600040] |I tried yum but it returned [131031600050] |Warning: No matches found for: xfontsel No Matches found [131031600060] |I googled for xfontsel source code to compile myself but didn't get any link for that. [131031600070] |
  • How can I install xfontsel on Fedora 13?
  • [131031600080] |
  • Its not installed by default and neither it is available in yum repo. [131031600090] |So does this mean Fedora will not include it anymore? [131031600100] |Why?
  • [131031600110] |
  • Any alternative to xfontsel? [131031600120] |I tried xlsfonts but it does not give preview of fonts.
  • [131031600130] |Thanks for your time and help. [131031600140] |

    Edit

    [131031600150] |This did the trick on my Fedora 13. [131031610010] |It's not necessarily in its own package, and it's not necessarily in a package named xfontsel. [131031610020] |This site leads me to believe it's part of xorg-x11-utils, so installing that should work [131031620010] |You can find out which package ships a given binary under Fedora like this: [131031620020] |however this only works if you know the name and directory of the executable. [131031620030] |Indeed for xfontsel it is xorg-x11-utils as already stated by Michael: [131031630010] |Besides the above mentioned binary rpm's for Fedora, the xfontsel source code is available from X.Org at http://www.x.org/releases/individual/app/xfontsel-1.0.3.tar.bz2 [131031640010] |How do I run a command as the system administrator (root) [131031640020] |I need to run a command with administrative privileges. [131031640030] |Someone said I should run a command as root. [131031640040] |How do I do this? [131031650010] |The main two possibilities are: [131031650020] |
  • Use su and enter the root password when prompted.
  • [131031650030] |
  • Put sudo in front of the command, and enter your password when prompted.
  • [131031650040] |

    Running a command as root

    [131031650050] |

    sudo

    [131031650060] |This is the preferred method on most multi-user systems and on Ubuntu. [131031650070] |If you don't know a separate root password, use this method. [131031650080] |Sudo requires that you type your own password. [131031650090] |(The purpose is to limit the damage if you leave your keyboard unattended and unlocked.) [131031650100] |It is often configured to not ask again for a few minutes so you can run several sudo commands in succession. [131031650110] |Example: [131031650120] |If you need to run several commands as root, prefix each of them with sudo. [131031650130] |Sometimes, it is more convenient to run an interactive shell as root. [131031650140] |You can use sudo -i for that: [131031650150] |Instead of sudo -i, you can use sudo -s. [131031650160] |The difference is that -i reinitializes the environment to sane defaults, whereas -s uses your configuration files for better or for worse. [131031650170] |For more information, see the sudo website, or type man sudo on your system. [131031650180] |Sudo is very configurable; for example it can be configured to let a certain user only execute certain commands as root. [131031650190] |Read the sudoers man page for more information; use sudo visudo to edit the sudoers file. [131031650200] |

    su

    [131031650210] |The su command exists on most unix-like systems. [131031650220] |It lets you run a command as another user, including root, provided you know that user's password. [131031650230] |Example: [131031650240] |The command to run must be passed using the -c option. [131031650250] |Note that you need quotes so that the command is not parsed by your shell, but passed intact to the root shell that su runs. [131031650260] |To run multiple commands as root, it is more convenient to start an interactive shell. [131031650270] |On some systems, you need to be in group number 0 (called wheel) to use su. [131031650280] |(The point is to limit the damage if the root password is accidentally leaked to someone.) [131031650290] |

    Logging in as root

    [131031650300] |If authorized, you can simply type root at the login prompt and enter the root password. [131031650310] |Be very careful, and avoid running complex applications as root as they might do something you didn't intend. [131031650320] |Logging in directly as root is mainly useful in emergency situations, such as disk failures or when you've locked yourself out of your account. [131031650330] |

    Single User Mode

    [131031650340] |Single user mode, or run-level 1, also gives you root privileges. [131031650350] |This is intended primarily for emergency maintenance situations where booting into a multi-user run-level is not possible. [131031650360] |You can boot into single user mode by passing single or emergency on the kernel command line. [131031650370] |Note that booting into single-user mode is not the same as booting the system normally and logging in as root. [131031650380] |Rather, the system will only start the services defined for run-level 1. [131031650390] |Typically, this is the smallest number of services required to have a usable system. [131031650400] |You can also get to single user mode by using the telinit command: telinit 1; however, this command requires root privileges to run. [131031650410] |On many systems booting into single user mode will give the user access to a root shell without prompting for a password. [131031650420] |

    Other programs

    [131031650430] |

    Calife

    [131031650440] |Calife lets you run commands as another user by typing your own password, if authorized. [131031650450] |It is similar to the much more widespread sudo (see above). [131031650460] |Calife is more light-weight than sudo but also less configurable. [131031650470] |

    Emacs

    [131031650480] |Thanks to Tramp, you can run commands as root through su or sudo within Emacs. [131031650490] |See the section on editing root-owned files below. [131031650500] |In eshell, type cd /sudo:: or cd /su:: to become root. [131031650510] |Type cd / to go back to your own user. [131031650520] |The idea is that the current directory is on a “remote” host, which is in fact the same host but accessed as a different user. [131031650530] |You can also have M-! (shell-command) or M-x shell run as root. [131031650540] |First visit a directory using the su or sudo tramp method, e.g., C-x C-f /sudo::/ RET (find-file "/sudo::/"). [131031650550] |Then run M-! or M-x shell from the resulting dired buffer. [131031650560] |

    Op

    [131031650570] |Op lets you run commands as another user, including root. [131031650580] |This not a full-blown tool to run arbitrary commands: you type op followed by a mnemonic configured by the system administrator to run a specific command. [131031650590] |

    Super

    [131031650600] |Super lets you run commands as another user, including root. [131031650610] |The command must have been allowed by the system administrator. [131031650620] |

    Graphical frontends

    [131031650630] |A few other applications that use sudo or su: [131031650640] |

    Gksu, Gksudo

    [131031650650] |gksu and gksudo are graphical front-ends to su and sudo respectively. [131031650660] |They allow you to run X Window programs as root with no hassle. [131031650670] |They are part of Gnome. [131031650680] |Type [131031650690] |and enter the root password, or type [131031650700] |and enter your password (if authorized to run sudo). [131031650710] |

    KdeSu, KdeSudo

    [131031650720] |kdesu and kdesudo are graphical front-ends to su and sudo respectively. [131031650730] |They allow you to run X Window programs as root with no hassle. [131031650740] |They are part of KDE. [131031650750] |Type [131031650760] |and enter the root password, or type [131031650770] |and enter your password (if authorized to run sudo). [131031650780] |If you check the “keep password” option in KdeSu, you will only have to type the root password once per login session. [131031650790] |

    Ktsuss

    [131031650800] |Ktsuss (“keep the su simple, stupid”) is a graphical version of su. [131031650810] |

    Beesu

    [131031650820] |Beesu is a graphical front-end to the su command that has replaced Gksu in Red Hat-based operating systems. [131031650830] |It has been developed mainly for RHEL and Fedora. [131031650840] |See also Wikipedia. [131031650850] |

    Running a graphical command as root

    [131031650860] |Depending on your system, su and sudo might not let the commands you run as root to access your X Window display. [131031650870] |The easiest solution is to use a graphical wrapper such as gksu, kdesu, beesu, or their sudo siblings. [131031650880] |To achieve this manually, you'll at least need to make sure you retain the DISPLAY environment variable in the environment, as well as XAUTHORITY if present. [131031650890] |

    Editing a file as root

    [131031650900] |Obviously, if you know how to run any command as root, you can run an editor. [131031650910] |But that's not the most convenient or the safest method. [131031650920] |Note: There are a few files that you should not edit directly: [131031650930] |
  • Never edit the sudoers directly. [131031650940] |Always use the visudo command for that. [131031650950] |If you make a mistake in the syntax of the sudoers file, you could be locked out of the root account! [131031650960] |When you run visudo, it lets you edit a temporary copy of the file and performs a syntax verification before replacing the actual file by your edits.
  • [131031650970] |
  • The same principle applies to the user and group databases, /etc/passwd and /etc/group. [131031650980] |On systems where they are available, use the vipw and vigr commands respectively.
  • [131031650990] |

    sudoedit

    [131031651000] |sudoedit (or its synonym sudo -e) is a mode of sudo where you edit a temporary copy of a file in your favorite editor, and that copy is moved into place when you finish editing. [131031651010] |

    Emacs

    [131031651020] |You can use Emacs's remote access mechanism (Tramp) to edit files as another user. [131031651030] |Use the su or sudo method. [131031651040] |For example, to edit /etc/fstab, use one of the following file names: [131031660010] |Use su: [131031660020] |or [131031660030] |In either case, you will be prompted for the root password. [131031660040] |For more information, see the manual page. [131031670010] |Or you can give some commands a superpower. [131031670020] |I'm talking about special permissions in which commands are executed with the permission of owner. [131031670030] |Get the path of command by #which and set SUID or SGID for that path. [131031670040] |P.S. - SUID bit should be given with care. [131031670050] |It can make your system insecure. [131031680010] |How do I fix Global Shortcuts when they stop working in KDE? [131031680020] |I recently had Global Shortcuts stop working in KDE 4. [131031680030] |I asked around on forums and chat rooms for solutions. [131031680040] |Some people mentioned kded. [131031680050] |I tried reinstalling. [131031680060] |After about a week I upgraded all my packages were back to normal. [131031680070] |However, I still don't know what runs and causes Global Shortcuts to work and would like this to be clarified if anyone knows. [131031680080] |Thanks. [131031690010] |How to "reencode" mp3 files. [131031690020] |I have a fair number of mp3 files which I created using audiohijack pro on a mac. [131031690030] |Now I no longer have a mac and am using them on my linux systems. [131031690040] |Unfortunately the program I use (rhythmbox) to listen to these files cannot figure out how long the files are. [131031690050] |These files are up to 5 hours long, and when the program cannot figure out how long it is I can't scroll through the file. [131031690060] |Any unix/linux programs that can reencode these files? [131031690070] |I do not know enough about either audio on linux or the mp3 file format to know what would be involved in this. [131031690080] |Best, Bart [131031700010] |Try LAME I should warn you that re-encoding may (probably) result in quality loss. [131031710010] |While I do not know specifically whether additional options would be needed to fix the issue you mention, ffmpeg is [131031710020] |a complete, cross-platform solution to record, convert and stream audio and video. [131031710030] |It is the swiss-army knife for audio and video. [131031710040] |Re-encoding your files should be as easy as [131031710050] |ffmpeg is in the repositories of most major distributions or it can be downloaded from their website. [131031720010] |It does not answer the question in your title, but maybe there's a chance to fix the files without reencoding. [131031720020] |For example, one common issue with incorrect lengths of MP3 files are files with variable bit rate that are not properly marked as having a variable bit rate (and programs like rhythmbox treating them as if they had a constant one). [131031720030] |The tool vbrfix can fix those files. [131031720040] |Another useful tool to check the MP3 file is mp3check, it also has options like --fix-headers that might repair the files (make backups of the files first!). [131031730010] |FastCGI library for C#/Mono [131031730020] |I'd like to write a couple of fastcgi application in c#. [131031730030] |I know that Mono can run ASP.NET on fastcgi enabled web servers, but that is not what I need. [131031730040] |Is there any FastCGI library working for .NET/Mono? [131031740010] |Do you mean something like a servlet interface? [131031740020] |You could also pretty easily emulate something like this using an ASPX HTTP Handler. [131031740030] |You simply inherit from IHttpAsyncHandler and you'll get a BeginProcessRequest method and an EndProcessRequest method. [131031740040] |In your BeginRequest handler you can do context.Response.Write (); [131031750010] |Its not fully functional/released yet but I am working on something that might interest you: [131031750020] |http://github.com/jacksonh/mango/blob/master/docs/tutorial/page-1.md [131031760010] |What is a vi equivalent of vim's 'set ruler' command? [131031760020] |Is there a way to show the current row and column position in vi? [131031760030] |In vim, I know there is the set ruler command, but what are my options when using vi? [131031770010] |You can do set number to show the line number at the beginning of each line. [131031770020] |However, in original vi, there doesn't seem to be an option to show the current column. [131031770030] |There is a way to at least position the cursor at a specific column. [131031770040] |Do 25| to position the cursor at column 25 of the current line. [131031780010] |OK so this is from memory, from years ago. [131031780020] |Vi has a status bar line - and I've seen it setup to report the column number of the cursor in the status bar... just don't remember how that was accomplished. [131031780030] |Yes, this was vi not vim - on solaris, or sunos maybe. [131031780040] |HTH, -pbr [131031790010] |Chainload two Grub2 installations [131031790020] |This is really getting me down. [131031790030] |I have Gentoo and Ubuntu, both with Grub2. [131031790040] |Gentoo has a dedicated /boot partition, while Ubuntu does not. [131031790050] |I have a menuentry in Gentoo's /etc/grub.d/40_custom to boot Ubuntu (and Ubuntu does boot OK). [131031790060] |Because Ubuntu comes with Grub I want to chainload into that one, instead of maintaining my entry which sets the root, kernel, initrd and stuff. [131031790070] |This is what I have for the chainloader (Ubuntu is on /dev/sda4 and I have already installed Grub there): [131031790080] |It is giving me error: Invalid signature and I found no solution available. [131031790090] |Can someone point out something? [131031790100] |This is the result of [131031790110] |This is the result of fdisk -l. /dev/sda1 is /boot of Gentoo, Gentoo is in /dev/sda2, Ubuntu is in /dev/sda4. [131031790120] |Ubuntu's /boot is in /dev/sda4 too. [131031790130] |There is no error with grub-install /dev/sda4 --no-floppy --force [131031800010] |The initial part of the boot up process consists of loading code from the first sector of the hard drive, the so called Master Boot Record (MBR). [131031800020] |Normally, Grub is written into this first hard drive sector and not into the first sector of the partition holding /boot. [131031800030] |However, you can normally change this during Linux install but in modern installation routines, this is often hidden. [131031800040] |You say that you have Grub installed into /dev/sda4, however your config looks correct and the error message you posted suggests, that Grub might not be installed correctly into the partition you want to chainload. [131031800050] |You should boot into Gentoo, then chroot into the Ubuntu partition. [131031800060] |Make sure that /boot now points correctly to the Ubuntu-/boot and not the Gentoo one! [131031800070] |Now install Grub 2 into the first sector of the Ubuntu-Partition /dev/sda4: grub-install /dev/sda4 --no-floppy. [131031800080] |As always when fiddling with MBR and partitions, make sure you have a functional, up-to-date backup before you start. [131031810010] |Isn't sda4 going to be (hd0,3) in grub, or has this sort of thing changed in grub2? [131031820010] |What does ^d mean in ls -l | grep ^d? [131031820020] |When I do ls -l | grep ^d it lists only directories in the current directory. [131031820030] |What I'd like to know is what does the caret ^ in ^d mean? [131031830010] |That's a caret, not a carrot. [131031830020] |It means "beginning of the line." [131031830030] |The grep is matching only lines that start with "d". [131031840010] |Andy's answer is correct, as seen in the man page: [131031840020] |Anchoring [131031840030] |The caret ^ and the dollar sign $ are meta-characters that respectively match the empty string at the beginning and end of a line. [131031840040] |The reason it works is the -l flag to ls makes it use the long-listing format. [131031840050] |The first thing shown in each line is the human-readable permissions for the file, and the first character of that is either d for a directory or - for a file [131031850010] |Command-line-friendly full-text indexing ? [131031850020] |Is there such a thing as a full-text indexing engine, that can be queried from the command line and ideally wouldn't require using a gui at all ? [131031850030] |I'm especially interested in indexing my ebooks and papers, so that's a mixture of pdf, epub and a few djvu. [131031850040] |(Open)Office docs would be nice, but much lower on my list. [131031860010] |tracker can be invoced from command line and gtk+ is not hard dependency for project (but may be for packages). [131031870010] |Have you looked at Lucene or Sphinx? [131031870020] |While you will need to initially parse the documents you want to index, once that's done, either one can search from the cli. [131031870030] |For Lucene, there is some info on doing this available. [131031870040] |Sphinx, is a bit more vague, but there is also some documentation available. [131031870050] |Lucene relies on Java, while Sphinx is built in C++ with no needed outside dependencies. [131031870060] |Either one is going to require a bit of work to do what you want, but, seems like a totally workable solution. [131031880010] |There currently are two streams of Tracker, stable (0.8) and unstable (0.9). [131031880020] |Your OS likely has the 0.8 version, so if you can afford it (it has some bleeding edge software dependencies), go grab the latest tarfile (0.9.x). [131031880030] |It has lots of improvements over 0.8, and is currently being stabilized further in order to be 0.10 (even numbers represent stability). [131031880040] |If you choose to go this route, use this command to configure: [131031880050] |You are likely not going to have the dependencies installed, so it should be esier to simply install 0.8 from your distro, and just avoid the GUI bits. [131031880060] |On Debian Squeeze, Ubuntu 10.10, and Ubuntu 11.04, these are nicely split. [131031880070] |So (as root) run: [131031880080] |The CLI tool for this is tracker-search, so run it with the --help option to see how to take advantage of it :-) [131031880090] |notes: [131031880100] |
  • On Fedora 14, the Tracker package has dependencies on GTK+. [131031880110] |I guess it's because it includes things like tracker-applet and tracker-preferences. [131031880120] |They do however have a separate package for tracker-search-tool, the GUI search interface.
  • [131031880130] |
  • DjVu and ePUB aren't (yet) supported. [131031880140] |Here's a list of of what is.
  • [131031890010] |What is the MIME equivalent of uuencode for sendmail? [131031890020] |e.g., I've got files I want to send by sendmail but the receiving mailbox (for posting pictures to my blog) will not accept uuencode files a la [131031890030] |$uuencode file | sendmail user@domain [131031890040] |I'm guessing it'll accept MIME though. [131031890050] |So what command can I use instead? [131031900010] |You need mimencode from the metamail package... [131031900020] |Debian has some package info, but the package is based on ancient Bellcore code. [131031900030] |If you're just trying to send mail though, you might look into using mutt; I think it can mimencode attachments from the commandline. [131031910010] |The best luck I had was with mime-construct, written in Perl. [131031910020] |It does pretty much everything uuencode does, and is pipeable, which is what I needed. [131031910030] |(No, I was not looking for an MTA such as mutt... msmtp is all I need, thank you very much.) [131031910040] |For people interested, you call it using something like [131031910050] |which prints a load of random gobbledygook to stdout, just as uuencode would if you didn't pipe it somewhere else. [131031920010] |Organize Email by Date Using procmail or maildrop [131031920020] |I would like to organize all incoming email into the following directory structure based on the date of the email: [131031920030] |Note that each email will be stored as a separate file and the name of the file is YYYYMMDD-HHmmss-NNNNN, where NNNNN is a running number. [131031920040] |Can procmail or maildrop do this? [131031920050] |If not, what other options are there? [131031920060] |Thanks in advance. [131031930010] |If you know some Python it should be a rather trivial exercise: [131031930020] |Python comes with an email package in the standardlib that allows your to read the emails from text files and automatically parse them into usable objects. [131031930030] |After having parsed them you could just output them accordingly (each message has an "as_string" method). [131031930040] |The basic structure would be like this: [131031930050] |
  • Iterate over your files
  • [131031930060] |
  • Open each file and parse into an email object
  • [131031930070] |
  • take the date and split it into the fields you need
  • [131031930080] |
  • open the target file handle (running number is last number+1 or 1)
  • [131031930090] |
  • write msg.as_string() to the file
  • [131031940010] |I don't have an answer fulfilling all of what you want but a part of it. [131031940020] |If it is sufficient to use the date at which the mail arrives instead of the date header of the mail itself and if one folder per date is also sufficient, you can do this with maildrop: [131031940030] |I hope you can build up on this. [131031950010] |Read space as input in shell script [131031950020] |How can i give space " " as input in shell script ? [131031950030] |Ex : [131031950040] |How can i do it ? [131031960010] |You already have Oct 6 in $mdate, your problem is that you're expanding it when printing. [131031960020] |Always use double quotes around variable substitutions: [131031960030] |The -r (raw) option to read tells it not to treat backslashes specially, which is what you want most of the time (but it's not the problem here). [131031970010] |Copy symlink AND where it points to using rsync [131031970020] |It doesn't need to be done by rsync, but it would be nice not have to write a script to do this, and rsync is very close to what I want. [131031970030] |"rsync -a" (or -l) can preserve symlinks, and -L can dereference symlinks and copy it as if it is normal file/dir. [131031970040] |However, is it possible to keep the symlink, and also copy the files/directories the links points to? [131031970050] |Here's an example. [131031970060] |Say we have this folder hierarchy: [131031970070] |dirA/link_to_file -> ../dirB/file [131031970080] |dirA/link_to_dir -> ../dirC [131031970090] |dirB/file [131031970100] |dirB/not_this_file [131031970110] |dirC/file [131031970120] |dirC/file2 [131031970130] |dirD/others [131031970140] |and when I do "rsync -aR dirA dest" (or something else), I'd like to have exactly these appear in dest. [131031970150] |dirA/link_to_file -> ../dirB/file [131031970160] |dirA/link_to_dir -> ../dirC [131031970170] |dirB/file [131031970180] |dirC/file [131031970190] |dirC/file2 [131031970200] |Is this possible with rsync? [131031970210] |Thank you. [131031970220] |Edit: Let's assume symlinks having absolute path or pointing to outside the source directory can be ignored. [131031980010] |This would be possible if and only if you these were all in 'mydir' and you were to rsync 'mydir' from one place to another. [131031980020] |Rsync isn't capable of copying outside of the path you give it (with the exception of following links). e.g [131031990010] |List of useful `less` functions [131031990020] |Rather than ask for your favorite, lets just list them off. [131031990030] |What are the more useful commands inside less? [131031990040] |Personally, I use: [131031990050] |
  • / (search forward)
  • [131031990060] |
  • ? (search backwards)
  • [131031990070] |
  • F (enable tail -f like behvaior, Ctrl-C to break out of it)
  • [131031990080] |
  • v (open file in $EDITOR for editing, defaults to vi/vim)
  • [131031990090] |Others? [131032000010] |
  • ^f - page down
  • [131032000020] |
  • ^b - page up
  • [131032000030] |
  • G - go to the end of buffer
  • [131032000040] |
  • gg - go to the beginning of the buffer
  • [131032000050] |also - most of them are just vim-like functions for navigation. [131032010010] |
  • u - up half page
  • [131032010020] |
  • d - down half page
  • [131032010030] |
  • k - scroll single line up
  • [131032010040] |
  • j - scroll single line down
  • [131032010050] |
  • -i - case insensitive searching unless pattern contains capitals (as clo or in less)
  • [131032010060] |
  • / /pattern/ - search (used with n)
  • [131032010070] |
  • -p /pattern/ open file at /pattern/ (as clo)
  • [131032010080] |
  • &/pattern/ show lines containing /pattern/ (like grep)
  • [131032020010] |One can also use the mark feature to remember (and jump back to) specific positions in the file. [131032020020] |For example, type ma to mark a position with the label "a". [131032020030] |To jump back to the position, simply type 'a. Labels can be any alphabet (case sensitive) thus allowing up to 52 possible marks ([a-zA-Z]) although I seldom use more than 2. [131032030010] |-S (either at command line or typing '-' and 'S' while running less) chops long lines and is helpful when viewing e.g. log files. [131032030020] |Type '-' and 'S' again to switch back. [131032040010] |This isn't a function inside of less, but it is a useful feature. [131032040020] |I like man pages, and prefer less(1) as my pager. [131032040030] |However, most GNU software keeps the manual in the info(1) (GNU Texinfo) format, and I'm not a fan of the info(1) interface. [131032040040] |Just give me less. [131032040050] |So, I read info(1) pages using 'less' instead. [131032040060] |The following command will print out the info(1) pages, using the familiar interface of less! [131032050010] |How can I set desktop defaults for new users? [131032050020] |How can I set up desktop defaults, much like most distributions do, for every new user? (ex. default wallpaper, apps, etc) [131032060010] |When a new user and his home directory are created, the home directory is "inititalized" with the contents of /etc/skel. [131032060020] |So if you setup a desktop like you want it to be for new users and then copy the relevant config-files to /etc/skel, that's what the desktop will look like for new users. [131032070010] |Strategies for maintaining a reference to a file after it was moved or renamed ? [131032070020] |I've had a mac at work lately, and was amazed to see that Xcode would still find my latest project after I renamed its folder and moved it someplace else. [131032070030] |Now I understand that this is the result of a heavy infrastructure at work, but I was wondering if it would be possible to somehow come up with similar functionality for the rest of the Unix world ? [131032080010] |Well on Linux you could use inotify to track changes to your files. [131032080020] |Inotify is in-kernel and has bindings to many different languages allowing you to quickly script such functionality if the app you are working with does not support inotify yet. [131032090010] |Static DNS setup on client of shared internet connection [131032090020] |I've 2 linux computers, one redhat (client), and one ubuntu (set up with shared internet connection as described here) [131032090030] |At the moment, on the wired connection between the computers, I can ping the other computer from both sides; IP addresses are setup statically. [131032090040] |The ubuntu computer has access to the internet through wireless. [131032090050] |I want to setup the redhat client to be able to access the same DNS server as the ubuntu one uses. [131032090060] |In the article above, it is assumed that the client is another ubuntu box, and they advise to do the following: [131032090070] |However, the redhat client doesn't have the file /etc/dhcp3/dhclient.conf. [131032090080] |Is there another way of achieving the above in redhat? [131032090090] |(I've tried to setup the ubuntu box as a dhcp server using dnsmasq, but it didn't work) [131032090100] |(BTW, I thought I needed a crossover cable for this type of setup, but that didn't work - an ordinary ethernet cable was fine) [131032100010] |Dns servers are specified in all Linux distribution in the file /etc/resolv.conf it should contain [131032100020] |for your servers. [131032100030] |However, when using dynamic network setup instead of static, the setup tool used might overwrite this. [131032100040] |It's not clear which version of Redhat you use, so I've got to shoot in the dark a bit, but if you have system-config-network, this is probably the right tool to use for network configuration. [131032100050] |More modern systems normally use network-manager. [131032110010] |I hadn't set up NAT on the ubuntu server. [131032110020] |When that was set up I didn't need any 'prepend' stuff as I was able to set the IP address of the DNS server on the client (redhat, in resolv.conf) to be the same IP address as the ubuntu server was using. [131032110030] |NAT handled the translation from one network to the other. [131032110040] |The instructions for setting up NAT on the ubuntu server I got from here: [131032110050] |http://ubuntuforums.org/showthread.php?t=713874 [131032110060] |Thanks fschmitt for your answer. [131032120010] |How do I find out which processes are preventing unmounting of a device? [131032120020] |Sometimes, I would like to umount a usb device, but I get a drive is busy error. [131032120030] |How do I find out which processes or programs are accessing the device? [131032130010] |Use lsof | grep /media/whatever to find out what is using the mount. [131032130020] |Also, consider umount -l (lazy umount) to prevent new processes from using the drive while you clean up. [131032140010] |You can use lsof like Peter said, or if you're sure you just wanna kill all those things and unmount it, you can probably do something like: [131032150010] |Most of the time, the best command to use is lsof (“list open files”). [131032150020] |where /media/usb0 is the mount point of the USB drive or other filesystem to unmount. +f -- tells lsof to treat the subsequent argument as a mount point; it usually, but not always, manages on its own, so that lsof /media/usb0 also works. [131032150030] |This finds open files (even unlinked ones), memory mapped files, current directories, and some more obscure uses. [131032150040] |You'll need to run the command as root to get information on other users' processes (and I think there are unices where lsof has to be run as root). [131032150050] |There are uses that lsof will not find; these are uncommon on removable media. [131032150060] |They include: [131032150070] |
  • mount points: you can't unmount /foo if /foo/bar is a mount point.
  • [131032150080] |
  • mount devices: you can't unmount /foo if /foo/bar is a mounted block device or loop-mounted regular file, or if it is the source of a Linux bind mount.
  • [131032150090] |
  • NFS export: lsof won't detect that a tree is exported by a kernel NFS server.
  • [131032150100] |Another command that can serve in a pinch is fuser, which only lists PIDs of processes with open files on the device: [131032160010] |If you use GNOME, unmounting via Nautilus will display a message stating which process is still using the drive, and the file it's using. [131032170010] |Are there any good tutorials for NetBSD and daemontools? [131032170020] |I'm looking for some good resources on running daemontools on a NetBSD box. [131032170030] |I've installed the binary package via pkg_add, but I can't seem to find an rc script for starting, e.g., svscan. [131032170040] |I'm mostly a Linux and FreeBSD user, and this is the sort of thing I would expect to find after an install. [131032170050] |Did I just look in the wrong place? [131032170060] |Should I be building from source to find those sorts of extras? [131032170070] |Is there a good guide somewhere that covers things like this? [131032170080] |Thanks. [131032180010] |I once did this on OpenBSD and followed http://openbsd-wiki.org/index.php?title=Installing_Daemontools [131032180020] |Maybe it can help under NetBSD, too? [131032190010] |Prevent libflashplayer.so from deleting a file? [131032190020] |I'm trying the preview release of Flash Player "Square" for Linux and noticed that video files are now being deleted from the /tmp/ folder. [131032190030] |Yet the files are still in use (I can see them with lsof): [131032190040] |Is there a way to prevent flash from deleting them or a way to recover them? [131032200010] |I've never tried this before, but... [131032200020] |There is a link to the file in /proc/8948/fd/. [131032200030] |You can catenate the file as root (it's only readable as root), and pipe it to a new file. [131032200040] |Whether the file is intact, I've not verified. [131032210010] |Viewing system console messages in GUI [131032210020] |Under Linux, is it possible to view error messages that show up on the text mode terminal while in GUI mode, instead of having to press Ctrl+Alt+F1 or Ctrl+Alt+F2 to view the messages every time and then switching back to GUI mode by pressing Ctrl+Alt+F7? [131032210030] |Thank you. [131032220010] |You can use xconsole for this. [131032220020] |From its description: [131032220030] |The xconsole program displays messages which are usually sent to /dev/console. [131032220040] |Depending on the configuration your distribution chose you might have to start it as root (i.e. with sudo xconsole respectively su -c xconsole), [131032230010] |You can see the current contents of the text console /dev/tty1 in the file /dev/vcs1 (where 1 is the number in Ctrl+Alt+F1). [131032230020] |(If you try to read from /dev/tty1, you'll compete with the program running there for keyboard input.) [131032230030] |The vcs devices are normally only readable by root. [131032230040] |You get a snapshot; there's no convenient way to get content as it comes. [131032230050] |The ttysnoop program allows you to watch the traffic on a console from another terminal (including an X terminal). [131032230060] |But this is something you have to set up in advance. [131032230070] |Instead of trying to catch the messages when they've been output on the text console, arrange to have the messages directed to a different location. [131032230080] |Most such console output will end up in the system logs, in files under /var/log. [131032230090] |Under X (i.e. in graphical mode), you can catch these messages with xconsole, which is part of the standard X distribution. [131032230100] |If xconsole doesn't show the messages you want, edit your question to mention where these messages are coming from. [131032230110] |If you can't get xconsole to show any message, edit your question to include your exact operating system, any configuration steps you've taken, and any error message you saw. [131032230120] |If the messages are not coming from the system logging facility, but from a program you started in the text mode console, you'll be better served by using redirection. [131032230130] |Arrange to start the program like this: [131032230140] |Then you can read the output from the program from anywhere by looking in the file ~/.myprogram.log. [131032230150] |In particular, to watch the file grow in real time, run [131032230160] |If the program is started by your X startup scripts, it would be better to redirect the output from the whole X startup sequence to a file. [131032230170] |In fact many distributions do this automatically. [131032230180] |If you're using a .xinitrc or .xsession file, put the following line near the beginning of the file to redirect the output from subsequent programs: [131032240010] |What does "warning: override: VZ_FAIRSCHED changes choice state" mean? [131032240020] |I am building a Linux kernel, via the Debian linux-2.6 source package. [131032240030] |Now there's CONFIG_VZ_FAIRSCHED=y in a sub-config, which gets merged into the final .config, where apparently also "y" gets used: [131032240040] |The .config used during build: [131032240050] |I could understand the warning, if now "n" would be used, but nothing appears to have been changed?! [131032240060] |This is the output during the make -f debian/rules.gen binary-arch_amd64_openvz_amd64 binary-indep call: [131032240070] |What is this warning referring to? [131032250010] |Blind guess: CONFIG_VZ_FAIRSCHED=y forces a value in some other kernel configuration option. [131032250020] |What does the help text for that option state? [131032260010] |how do I add newlines between lines printed on the command line? [131032260020] |Mail logs are incredibly difficult to read... how could I ouput a blank line between each line printed on the command line. [131032260030] |For example say, i'm grep-ing the log. [131032260040] |That way multiple wrapped lines aren't being confused. [131032270010] |Use sed and replace the whole line by itself plus one extra newline character: [131032280010] |Is this what you are after? [131032280020] |grep SPAM mail.log | while read -r line; do echo; echo $line; done [131032290010] |Use awk to add an extra newline. [131032290020] |This also lets you filter out things you don't want. [131032300010] |If it's for more than just have look, I prefer to send them to a text file and open with a text editor so you can set the lines to wrap or not and do searches easily... and delete the unwanted lines and so on without having to type a lot of commands. [131032300020] |cat file.log >log.txt and gedit log.txt or a terminal editor like nano [131032300030] |Edit: or cp file.log log.txt wich is of course easier and faster... thanks to KeithB comment [131032310010] |sed G [131032310020] |G is not often used, but is nice for this purpose. sed maintains two buffer spaces: the “pattern space” and the “hold space”. [131032310030] |The lines processed by sed usually flow through the pattern space as various commands operate on its contents (s///, p, etc.); the hold space starts out empty and is only used by some commands. [131032310040] |The G command appends a newline and the contents of the hold space to the pattern space. [131032310050] |The above sed program never puts anything in the hold space, so G effectively appends just a newline to every line that is processed. [131032320010] |Resources System V vs BSD [131032320020] |I'm searching for some detailed resources about the differences of System V and BSD concepts. [131032320030] |For example: [131032320040] |
  • Interprocess Communication
  • [131032320050] |
  • Sockets vs TLI
  • [131032320060] |
  • ...
  • [131032320070] |Some sort of pro/cons discussion with historical background would be really nice. [131032320080] |Any ideas? [131032330010] |This is mostly a historic matter, for a number of reasons: [131032330020] |
  • Over the years, the System V based Unices have gotten a lot of BSD in them, and the BSDs have —to a lesser extent —adopted some System V features.
  • [131032330030] |
  • A lot of the differences simply don't matter any more, like XTI/TLI, having been beaten out in the market of ideas by BSD sockets.
  • [131032330040] |
  • The Unix market is consolidating. [131032330050] |There are fewer weird nonstandard differences to deal with these days, and better tools for dealing with the ones that remain. [131032330060] |One big area of difference is in how dynamic linkage works, for instance, but we have GNU libtool to deal with it now.
  • [131032330070] |The best single resource I know of for learning about these sorts of differences is Advanced Programming in the Unix Environment, 2/e by Stevens and Rago. [131032330080] |If you have a special interest in networking and IPC, add in Stevens' Unix Network Programming, volume 1 and volume 2. [131032330090] |If you can find the first edition of APUE, it's still useful. [131032330100] |The main thing you get in the second edition is explicit coverage of Linux and OS X. If you're just trying to use the features, you just have to puzzle out which of the alternatives these newer platforms support.