[131040490010] |Top and bottom panels disappeared in Ubuntu 10.10 (Gnome) [131040490020] |For some reason my top and bottom panels have disappeared. [131040490030] |I can't right-click and add a new panel either. [131040490040] |I tried executing gnome-panel from the terminal, rebooting, but no luck. [131040490050] |Any idea how to recover these panels? [131040500010] |Turns out that uninstalling Evolution also removed gnome-panel (?!?). [131040500020] |I rebooted in recovery mode, then dropped into a netroot shell (terminal with net access) and installed gnome-panel via apt and the panels returned on the next normal boot. [131040500030] |Hope this helps someone else. [131040510010] |Easiest way to duplicate directory over FTP [131040510020] |I want to duplicate a directory on an FTP server I'm connected to from my Mac via the command-line [131040510030] |Let's say I have file. [131040510040] |I want to have files2 with all of file's subdirectories and files, in the same directory as the original. [131040510050] |What would be the simplest way to achieve this? [131040510060] |(I´m a complete newbie to the UNIX command line, so sorry if the question is not clear enough; please ask for any clarification needed.) [131040510070] |EDIT: [131040510080] |With mget and mput you could download all files and upload them again into a different folder but this is definitely NOT what i want/need (I started this question trying to avoid duplicating with this download upload method from the dektop client) [131040520010] |This is wrong now, but keeping undeleted so the comment tree isn't lost [131040520020] |cp copies files and directories; you can give it the -r flag to make it recursively copy everything. [131040520030] |From the folder that contains file: [131040530010] |What you have is not a unix command line, what you have is an FTP session. [131040530020] |FTP is designed primarily to upload and download files, it's not designed for general file management, and it doesn't let you run arbitrary commands on the server. [131040530030] |In particular, as far as I know, there is no way to trigger a file copy on the server: all you can do is download the file then upload it under a different name. [131040530040] |Some servers support extensions to the FTP protocol, and it's remotely possible that one of these extensions lets you copy remote files. [131040530050] |Try help site or remotehelp to see what extensions the server supports. [131040530060] |If you want a unix command line, you need remote shell access, via rsh (remote shell) or more commonly in the 21st century ssh (secure shell). [131040530070] |If this is a web host, check if it provides ssh access. [131040530080] |Otherwise, contact the system administrator. [131040530090] |But don't be surprised if the answer is no: command line access would be a security breach in some multi-user setups, so there may be a legitimate reason why it's not offered. [131040540010] |LFTP supports higher-level commands above what the FTP protocol provides, for example its mirror command provides what you want. [131040540020] |There are other programs with similar features; sitecopy is another example. [131040550010] |wget supports mirroring and ftp: [131040550020] |wget -m ftp://user:pass@0.0.0.0/dir [131040560010] |xfdesktop (xfce4) broken? (can't set wallpaper) [131040560020] |On start-up, xfce4 loads lots of desktop pictures (I have the settings set to 'image list') one after another (about 10, but I have the feeling it gets more and more). [131040560030] |That by itself would be no problem, but then it decides to show no background image, just an awful shade of brown. [131040560040] |Plus, it shows files (icons) on the desktop, which I don't want. [131040560050] |Where could I start to look to fix it? [131040570010] |To remove the icons: right click on the desktop -> Desktop settings -> Icons -> Icon type -> None [131040580010] |Did you directly install xfce, or did you start with something like ubuntu (which installed GNOME by default) then switch over to it? [131040580020] |If you have, boot into your other desktop environment, and try turning off all desktop settings there. [131040590010] |What format does man use? [131040590020] |A piece of software wants to know for its configuration whether my man uses nroff or vt100 "catman" pages. [131040590030] |How do I determine this? [131040600010] |Give nroff a go, most recent versions of 'man' use *roff by default. [131040600020] |Shows under Defaults that nroff is the default on my Ubuntu &OS X systems so should be a safe bet. [131040610010] |Short answer: just pick nroff. [131040610020] |Nroff is the traditional word processor for manual pages. [131040610030] |“Catman” pages are usually manual pages that have been formatted by nroff for use on a text terminal. [131040610040] |Catman pages have little formatting, just boldface and underline, and are justified for a particular terminal width (generally 80 columns). [131040610050] |In the old days, it made sense to install preformatted (i.e. catman) pages to avoid the formatting time, but on a modern (or even not-so-modern) machine the time spent formatting is insignificant. [131040610060] |Some systems have a cache so that each source page is formatted only once, but even that is falling into disuse. [131040610070] |Having the source nroff pages has the advantage that they can be formatted for a different terminal width, for a different character encoding, or for viewing in a non-terminal setting (web browser, pdf, ...). [131040610080] |Look in /usr/man or /usr/share/man to see what's already there. [131040610090] |If you see directories called man followed by a digit containing files that have a lot of lines beginning with with a dot followed by two letters, your system supports nroff man pages. [131040610100] |If you see directories called cat followed by a digit containing files with ^H characters (character number 8, which might be displayed as \010, \x08, or show up as underlining or boldface), your system supports catman pages. [131040610110] |In fact, even if one of these is absent, most systems support both. [131040610120] |For example, Linux systems rarely have any catman page installed but do support them. [131040610130] |Conversely, the base OpenBSD installation comes with catman pages but supports nroff man pages (which are the norm in ports). [131040610140] |A few systems support other formats as well, for example Solaris ships some pages in an SGML format. [131040620010] |SCO Unix run interactive script when sending a print job [131040620020] |I'm working with (read, "around") a proprietary ERP system on top of SCO Unix. [131040620030] |It has several "query at print time" reports where you can assign a printer to send your job to. [131040620040] |You usually input something like "%lp5", which spools your job to printer lp5. [131040620050] |If I want to create a pseudo-printer that will interact with the user and then return control to the ERP how would I go about it? [131040620060] |I have manipulated the LP interfaces scripts in the vein of this article, to include dynamic data into the reports and flow control to a print server. [131040620070] |But now I want to do actual interaction with the user to connect print jobs with a separate HylaFax server that I've built, so I need a way of triggering a shell script and asking the user for fax coversheet information. [131040620080] |Our system has a built in fax system using VsiFax (which I'm trying to subvert), but I don't see how it is performing the same function I'm trying to do. [131040620090] |You usually send your job to the VsiFax system by printing to "@fax" which I don't know if it's a hardcoded printer on the ERP side or if there is some Unix convention that is being used to call a shell script. [131040620100] |I guess what I'm looking for is a resource or some help on what the SCO Unix printer assignment conventions might be related to syntax of printer names (what does "@" and "%" mean and are there other special characters, and how I could call a shell script when sending that print job? [131040630010] |So far as I know (as a regular user of SCO Unix) the "@" and "%" prefixes have no meaning in SCO Unix and are probably something used by the ERP system. [131040630020] |You can list printers using the command lpstat -pDl. [131040630030] |If, as I suspect, you see lp5 and not %lp5 that would confirm that the prefix is something used by the application. [131040630040] |I believe the printer interface scripts are expected to work in the background without any connection to a specific interactive session - so they might not be a suitable place to introduce an interactive dialogue with a user. [131040630050] |If the application invokes lp or lpr - you could probably replace those with a suitable shell script. [131040640010] |Stuck on "Determining IP information for wlan0" at boot [131040640020] |In my struggles to install ClearOS correctly, I now have another problem: After the first boot I keep getting stuck on "Determining IP information for wlan0...". [131040640030] |It doesn't move forward at all. [131040640040] |I've even waited for 20 minutes before continuing, but didn't make a difference. [131040640050] |Right now my comp is unbootable because of this? [131040640060] |Anyway to fix this? [131040650010] |I'm not sure, but it sounds like a dhcp issue. [131040650020] |Maybe the acccess point you want to connect to is not set up with dhcp, or not available? [131040650030] |For now, try pressing ctrl-c when this message appears, sometimes it works (dont know about clearos). [131040650040] |If it works let this service start in background. [131040660010] |What's difference between FISH and SFTP? [131040660020] |Possible Duplicate: What's the difference between SFTP, SCP and FISH protocols? [131040660030] |I use SSH for remote file systems access. [131040660040] |And I use Krusader file manager. [131040660050] |Krusader offers a choice of FTP, SMB, FISH and SFTP connection protocols, and both FISH and SFTP work with an SSH server. [131040660060] |What's the difference among FISH and SFTP? [131040660070] |PS: I don't specify Krusader in the question title because Midnight Commander, for example, supports FISH as well, so that FISH can be something not limited to Krusader. [131040670010] |How to understand what's taking up space? [131040670020] |I'm looking for a linux alternative to WinDirStat. [131040670030] |I would like to know what is taking up space on my hard drives. [131040670040] |A program that works on console and doesn't require a UI is preferred . [131040680010] |If you want a command-line tool, I prefer ncdu, an ncurses version of du. [131040680020] |It scans the disk (or a given folder) and then shows the top-level space usages; you can select a given directory to get the corresponding summary for that directory, and go back without needing to reanalyze: [131040680030] |If you're ok with a GUI program, Filelight is the closest thing to WinDirStat I've found; it shows a graphical view of space consumption: [131040680040] |Like ncdu, Filelight lets you select a given directory to get the breakdown for that directory [131040690010] |Another GUI program is: baobab [131040700010] |Based on your issues in installing ncdu my recommendation would be to use du and sort on together. [131040700020] |For instance: [131040700030] |
  • du /home | sort -rn (will search all files/directories under /home and sort them by largest to smallest.
  • [131040700040] |
  • du -h /home | sort -rh (same but will show it in MB/KB/etc) - Note this requires coreutils 7.5 or newer (sort --version to check)
  • [131040700050] |You can replace /home with any directory of your choice. [131040710010] |There's also this cool python script from /www.vrplumber.com/programming/runsnakerun/ [131040710020] |bzr branch lp:~mcfletch/squaremap/trunk squaremap [131040710030] |It's not the most feature rich, but it's run from a single python script so it's extremely portable. [131040720010] |You should be aware that WinDirStat is actually a port of KDirStat, which is a Linux/KDE program. [131040720020] |So, if you are looking for a Linux alternative to WinDirStat, you certainly should take a look at KDirStat. [131040720030] |It is already packaged in most distros, just install it. [131040720040] |Another alternative is FileLight, already cited by Michael Mrozek, and the Konqueror plugin fsview (you can run it standalone from the command-line). [131040730010] |You could also try GD Map, another GUI tool based on treemaps. [131040740010] |Encrypted SD card corrupted. [131040740020] |I can't mount a encrypted SD card with Truecrypt anymore. [131040740030] |Usually if this happens to a normal partition, runing fsck on it will solve my problems. [131040740040] |But what do I do with a encrypted partition? [131040750010] |To create the /dev/mapper/truecrypt1 device without trying to mount the contained file system, do this (replace /dev/sda1 by the SD card device): [131040750020] |To confirm that there is still readable data to be found, you could first do something like this to look for text content (hit ctrl+c to stop): [131040750030] |Assuming the /dev/mapper/truecrypt1 block device has been successfully created, you can run normal tools like fsck on that device. [131040760010] |yum groupinstall "Development Tools" fails [131040760020] |Running [131040760030] |on my CentOS machine fails. [131040760040] |I get errors such as: [131040760050] |http://mirror.bjtu.edu.cn/fedora-epel/5/i386/repodata/7665d1f4c95b91088577b351525888a460749412-filelists.sqlite.bz2: [Errno 12] Timeout: [131040760060] |Any workarounds / alternatives? [131040770010] |This could be a transient network error. [131040770020] |Wait a bit and try again. [131040770030] |Do other downloads from this site work? [131040770040] |Try browsing http://mirror.bjtu.edu.cn/fedora-epel/5/i386/repodata/ (if this is on a command-line-only machine, use a command-line browser such as lynx, links or w3m). [131040770050] |Do you need to set up a proxy to access the web? [131040770060] |Yum, like most programs, uses the http_proxy environment variable. [131040770070] |If you need a proxy, put this in your ~/.profile (and run it once in your shell so that it takes effect no) (replace the host name and port number by the right values for you): [131040770080] |Try other CentOS mirrors if this particular one isn't working for you. [131040780010] |If you continue to get the errors only for EPEL mirrors, try running yum with the --disablerepo='epel' option as a temporary workaround (i.e. yum --disaberepo='epel' groupinstall "Development Tools", if it continues to happen, you may need to try and find the mirror admin and advise them that something is wrong. [131040780020] |Try Gilles' answer first though, this is a pure workaround. [131040790010] |How to install linux programs? in Red Hat [131040790020] |Ah, the joy of being a noob... [131040790030] |What's the simplest way to download/install software on linux (from bash command line)? [131040790040] |update: clarified this is for Red Hat [131040800010] |For Debian/Ubuntu [131040800020] |For Fedora i think it is [131040800030] |[note] Run these as root. [131040810010] |For Red Hat/Fedora: [131040810020] |For Ubuntu ( run this as root ) : [131040820010] |In debian based system you can use sudo apt-get install foo to download you can use wget [131040830010] |If you are using Red Hat Enterprise Linux, it happens that the package you are looking for is in EPEL, so you can install that: [131040830020] |and then you can yum install ncdu. [131040830030] |If you are using ancient Red Hat Linux, the answer is for the love of all that is holy, time to upgrade to Fedora. [131040840010] |How can I install ncdu on Red Hat? [131040840020] |The answers provided to this question doesn't help. [131040840030] |I'ved tried [131040840040] |But I'm getting [131040850010] |If you are using Red Hat Enterprise Linux, I do not think ncdu is in the RHEL server repositories, repositories. [131040850020] |I do not have a machine where I can check if it is in the workstation repositories, but I suspect it isn't. [131040850030] |If it isn't, one option is the use EPEL (faq): [131040850040] |EPEL (Extra Packages for Enterprise Linux) is a volunteer-based community effort from the Fedora project to create a repository of high-quality add-on packages that complement the Fedora-based Red Hat Enterprise Linux (RHEL) and its compatible spinoffs, such as CentOS and Scientific Linux. [131040850050] |ncdu does seem to be in the EPEL repositories intended to work with RHEL 4 and RHEL 5. [131040850060] |Directions for how to use these repositories can be found here: [131040850070] |http://fedoraproject.org/wiki/EPEL/FAQ#How_can_I_install_the_packages_from_the_EPEL_software_repository.3F [131040850080] |Alternatively, you can always download the tool from the upstream website: [131040850090] |http://dev.yorhel.nl/ncdu [131040850100] |and follow the directions in the INSTALL file. [131040850110] |However, this will require you to chase down dependencies and install the tools needed to build the project. [131040860010] |Augeas not reading all yum.repos.d files. Why? [131040860020] |Hi, [131040860030] |I'm trying to use Augeas to manage some options in yum.repos.d but it's not reading all repo files in there. [131040860040] |Any hint? [131040860050] |And in augtool: [131040860060] |Trying to debug in augtool: [131040860070] |Thanks in advance! [131040870010] |Found that the not-loaded repo files had "gpgkey=" (without value) inside, and this was preventing augeas to load them. [131040870020] |However Augeas did not issued any errors. [131040870030] |I had to find out myself. [131040880010] |How to clear terminal after logging out? [131040880020] |Currently on my laptop when I log out I can still see traces of my last activities (in tty). How can I tell it (Gentoo) to clear the screen before logging out? [131040890010] |If your shell is bash, add clear_console or reset to ~/.bash_logout. [131040890020] |If your shell is zsh, add that command to ~/.zlogout. [131040890030] |You might want to run this only when the shell is a login shell on a Linux console, e.g. [131040890040] |As the system administrator, you can configure the console to always be cleared before showing the login prompt. [131040890050] |The easiest way to do that is to use mingetty instead of getty; you lose support for serial consoles but gain a few features such as screen clearing. [131040890060] |First install mingetty. [131040890070] |Then, assuming you use SysVinit, in /etc/inittab, change lines like 1:2345:respawn:/sbin/getty 38400 tty1 into [131040890080] |The Upstart equivalent would to change exec /sbin/getty -8 38400 tty1 to exec /sbin/mingetty tty1 in /etc/init/tty1.conf (these are Ubuntu paths, you may need some adjustments for Gentoo). [131040900010] |Mount USB (FAT) in Gentoo [131040900020] |Can somebody show me how to make Gentoo mount my USB? [131040900030] |This is what I got when trying mount /dev/sdb1 /mnt: [131040900040] |mount: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so [131040900050] |dmesg says: [131040900060] |FAT: codepage cp437 not found [131040910010] |It seems that you do not have the "codepage cp437" support in the kernel. [131040910020] |Try to Look inside your /proc/config.gz file and search for a line like CONFIG_NLS_CODEPAGE_437=m or CONFIG_NLS_CODEPAGE_437=y. [131040910030] |If you do not find it, you'll have to recompile the kernel to add the needed module. [131040920010] |You need to set codepage and charset in kernel options: [131040920020] |and then recompile kernel... [131040930010] |Minimal Command Line Distro [131040930020] |So, I want to have a VM of a very minimal x86 Linux install, with networking support so I can download packages. [131040930030] |All this VM is going to be used for is to learn NASM assembly, since all of the other Linux installs I have anywhere area all x86_64 installs. [131040930040] |Thanks! [131040940010] |Any distro will have an x86 version. [131040940020] |If you really don't want to run X or anything like that, there are plenty of distros that offer minimal versions. [131040940030] |Ubuntu and debian have minimal installs if you want to go that route. [131040940040] |I think what you'll get the most recommendations for is arch. [131040940050] |It's got a good community with lots of tutorials and recipes for stuff. [131040940060] |Also there's slackware and gentoo [131040950010] |Debian netinstall is really simple to use: http://www.debian.org/CD/netinst/ It may look like it's hard to use but installer asks you a bunch of questions and all you have to do is to answer them and voila: you will have minimal system (it uses 36-38 mb of ram in idle mode with irssi on my pc without X). [131040960010] |Unix equivalent of powershell? [131040960020] |I've always found it awkward when complex shell commands involve parsing text output with awk. [131040960030] |Basically we're converting structured data into text, then parsing the text again to get back at the structured data. [131040960040] |Powershell is a windows shell which avoids that problem by allowing you to pipe typed objects between shell commands instead of just text. [131040960050] |Are there any unix shells which are object-based instead of text-based, like powershell? [131040970010] |No, it is the other way around. [131040970020] |There is no spoon^H^H^Hstructured data. [131040970030] |There is only text. [131040970040] |A big part of the Unix philosophy is based on the idea of outputting text and accepting text as input. [131040970050] |You might want to consider reading "The Art of Unix Programming", which has a nice explanation about this. [131040970060] |Don't get me wrong: I understand your point and I know what you are trying to get at. [131040970070] |There are things like the interactive interpreters of Ruby and Python, which can be used as a shell, but they are not as friendly for basic tasks as Bash is. Try and change directory, for example. [131040970080] |Also, using objects in a shell is not all-that. [131040970090] |If only your shell supports this, on Unix, you would be at a loss. [131040970100] |All the standard Unix text manipulation tools would have to be altered, like grep, awk, sed, etc. [131040970110] |I think there has been an attempt to create something like this a few years back, but I can't remember the name and I haven't heard about it in a long time. [131040970120] |It's probably not going to take off. [131040980010] |There is project, whose goal share similarity with PowerShell: Hotwire. [131040980020] |It combines regular sh with python scripting and window/graphical environment. [131040980030] |You could give it a look. [131040980040] |It's based around object-oriented pipeline that you can extend with your own objects by wrapping existing programs or using Python libraries. [131040990010] |There's actually a project called Pash that aims to implement PowerShell (on top of Mono), but it seems to have stalled. [131041000010] |I would think you could accomplish most of that by writing a bunch of interpreted (or compiled) scripts, then invoking them within the interpreter's shell, which will return or preserve your objects and so on if you want. [131041000020] |You can do this in at least Ruby, Perl, Python, Haskell (e.g., GHCi), JavaScript (e.g., node.js), Matlab, and certainly other languages... [131041010010] |is there a good combination of command-line and graphical file browser? [131041010020] |Is there a feasible solution than combines the advantages of a command-line and a graphical file browser? [131041010030] |For example, the command-line is good to change the directory and execute commands but can't show thumbnails and the file browser is intuitive, gives a good overview on where you are in the tree but you can't "talk" to the computer like in a command-line. [131041010040] |EDIT: for me, as a comman-line user, its more like needing a command-line with additional file-browser capabilities than having a file browser with some command-line features. [131041020010] |Dolphin looks like what you are looking for: [131041020020] |But the terminal is a slave of its directory navigation (if you change the directory in the GUI, it changes in the terminal, but not the other way around). [131041020030] |To change the application directory when you change the current directory in the terminal, you can make your shell send a message to Dolphin to update its view. [131041020040] |Add this to your shell rc files (Warning: not thoroughly tested, but works here for the most common situations, use at your own risk): [131041020050] |Bash: [131041020060] |Zsh: [131041020070] |There is an issue with this. [131041020080] |When the Dolphin window changes the current directory, the terminal loses focus. [131041020090] |You may want to ask for a bugfix (or even complete native support for this feature) to the developers, if you like it. [131041030010] |Konqueror http://www.konqueror.org/ has easy ways of going back and forth between terminal windows and file manager. [131041030020] |See the forum discussion at: http://www.knoppix.net/forum/threads/3838-How-to-Open-Konqueror-in-the-Directory-as-Your-Current-Shell In konqueror typing ctrl-t gets you a terminal in the current directory, and in the shell kfmclient exec . opens konqueror at the current directory. [131041040010] |Gnome Commander is a file manager with a shell command line line at the bottom. [131041040020] |Midnight Commander (mc) is similar, but in text mode. [131041040030] |(Both get their inspiration from Norton Commander.) [131041050010] |Nautilus Terminal is a plugin for Nautilus (Gnome's file manager). [131041050020] |The directories don't follow the command line, but it's reasonably quick to do pwd | xclip, +, + [131041060010] |Keyboard macros for X and/or KDE [131041060020] |I'm looking for a utility to record and playback keyboard macros in X applications (KDE specifically). [131041060030] |I've tried xmacrorec and xmacroplay, but after running them, my mouse and keyboard does not respond properly (i.e. the left mouse button gets stuck in a "clicked" state) and I have to restart X. [131041060040] |Are the any modern alternatives that work under KDE 4.5 and openSUSE 11.3? [131041070010] |KDE has a program called KHotkey. [131041070020] |It's hard to find in the OS, slow and hard to set up and test macros... but it works well once you get the macros working. [131041070030] |I used it for years but once I tried Autokey I dumped it. [131041070040] |Both work system wide. [131041070050] |Autokey is written in python and you can add python scripts to your macro with no problem. [131041070060] |There is an Autokey discussion group. [131041070070] |If you use any version of Ubuntu, you can install from this Autokey PPA, instructions on how to do the install are on the web page. [131041070080] |Make sure you install vs 0.71.1 or later. [131041070090] |Earlier versions have problems with using the shift key to create hotkeys. [131041080010] |XForwarding not loading correct $PATH [131041080020] |I tried to XForward netbeans to my laptop, using the following code: [131041080030] |That did not work, but this did: [131041080040] |My questions: [131041080050] |
  • Why does the first method fail?
  • [131041080060] |
  • How can I make the first method work?
  • [131041090010] |From the ssh(1) manual page (my emphasis): [131041090020] |If command is specified, it is executed on the remote host instead of a login shell. [131041090030] |In other words, it doesn't make a "login" on the remote system when you pass a command to ssh. [131041090040] |It runs your shell in non-login, non-interactive mode, which causes a different set of initialization files to run. [131041090050] |You should check where your PATH variable is being set, and move that to the appropriate file. [131041090060] |If your shell is bash, for example, you should use .bashrc, and not .bash_profile. [131041100010] |ssh example.com somecommand doesn't read your ~/.profile; somecommand is executed directly by the ssh daemon. [131041100020] |When you don't specify a command, the ssh daemon invokes your login shell, which reads your ~/.profile. [131041100030] |(Substitute ~/.bash_profile, ~/.zprofile or ~/.login depending on your login shell.) [131041100040] |There are a few ways to set environment variables for a non-interactive command, but they all require a setting in the server configuration which is typically off by default. [131041100050] |Assuming a recent enough OpenSSH on both sides: [131041100060] |
  • You can have environment variables sent from the client to the server with the SendEnv directive in ~/.ssh/config. [131041100070] |The specific environment variable must be enabled with an AcceptEnv directive in the server configuration.
  • [131041100080] |
  • You can set environment variables through ~/.ssh/environment on the server side. [131041100090] |This must be enabled in the server configuration with the PermitUserEnvironment directive.
  • [131041100100] |
  • Assuming you use key-based authentication, you can also set per-origin variables in ~/.ssh/authorized_keys: add environment="FOO=bar" at the beginning of the relevant line. [131041100110] |Again, you need the PermitUserEnvironment directive in the server configuration.
  • [131041100120] |If you can't or don't want to change the server configuration, you'll have to write the full path to the remote command, or explicitly source your .profile in the remote command. [131041110010] |Use wpa_supplicant without plain text passwords [131041110020] |Hello, I'm running gentoo on my laptop, and I'm currently using wpa_supplicant to handle wifi. [131041110030] |My configuration works and I can connect, but it is required to type in the plain text password into the configuration file. [131041110040] |This doesn't work if I want to connect to a friend's wifi and they want to type in the password instead of telling me what it is. There's no security with plain text passwords. [131041110050] |How can I make this more secure so that some sort of encrypted password is stored instead of plaintext? [131041120010] |wpa_passphrase [ ssid ] [ passphrase ] generates a WPA PSK from an ASCII passphrase for a SSID. [131041120020] |Then store it as [131041130010] |ssh session never exits cleanly [131041130020] |I've been having this issue, that when I exit a ssh session, it never quits properly. [131041130030] |I have to kill it with Ctrl-C. [131041130040] |Example Session Below: [131041130050] |Is there a reason this happens? ( some running proccess that blocks a clean exit perhaps ). [131041130060] |And how can I fix it? [131041140010] |From the ssh man page: [131041140020] |The session terminates when the command or shell on the remote machine exits and all X11 and TCP connections have been closed. [131041140030] |You've killed your shell, but it looks like some application still has a connection open over a forwarded port (the agent, X11, or a forwarding set up with -D, -L, -R or their ~/.ssh/config equivalent). [131041140040] |If you don't know what program is using the forwarding, use lsof -p $pid where $pid is the process id of the ssh client (on the client) or the sshd process that was the parent of the shell (on the server) to find out what ports it has open connections on. [131041140050] |Then use lsof -i -n or netstat -pnt and search for processes that have connections open on these ports. [131041150010] |Disk space on Fedora 12 [131041150020] |I'm using Fedora 12 on my laptop. [131041150030] |I have 10GB disk space and 2GB of them are free. [131041150040] |After 2-3 days uptime the space ends and I must reboot. [131041150050] |After rebooting I get 2GB free space back. [131041150060] |How can I prevent this? [131041150070] |Mostly I use Firefox, Chrome, Gedit, Rhythmbox and in background: httpd, mysqld, conky. [131041150080] |RAM: 1GB, Swap: 1.2 GB. [131041160010] |Firstly, you must find out what is eating away at your space. [131041160020] |I'd suggest you track down the physical file or directory that grows to that size. [131041160030] |The simplest way would be to check the directories in / using: ( I'd suggest running it as root ) [131041160040] |Now, You run that when the computer has freshly started and has not started to eat space yet and you save the output in a file ( ~/record-space ) [131041160050] |And then when your computer is nearing a "FULL" state, you can run the command again saving the output in a second file. [131041160060] |Now you can compare these two files ( ~/record-space and ~/record-space2 ) to see how th e main directories differ... [131041160070] |My favourite way of comparing files is using diff: [131041160080] |update: See Gille's comment to this answer. [131041160090] |Instead of du -hs /*, rather use du -xsh /tmp/* /var/*/* ~/.*. [131041170010] |Some distributions or desktop environments can show a warning if your available disk space drops below a certain threshold; here's how you can cobble your own. [131041170020] |In a terminal, type crontab -e (not as root); this will pop up an editor. [131041170030] |Enter the following line: [131041170040] |This means every five minutes (*/5 * * * *), if the free disk space ("$(df -P / | …)") drops below ([ … -le … ]) 1048576KB (1GB), send you a local mail with the free disk space (cron will send you the output of df /). [131041170050] |You may notice that the “used” and “available” columns only account for 95% of the total; that's because of the reserved space and is not responsible for your problem (the reserved amount does not vary over time). [131041170060] |The most likely places where something might be eating up your disk space are /tmp, /var and your home directory (including their subdirectories). [131041170070] |I second Stefan's tips on setting up a baseline du output and comparing it with the output when the disk is full. [131041170080] |If the space is freed when you boot, there can be several reasons. [131041170090] |Some program is presumably creating large temporary files; maybe these files are cleaned up when the program terminates, maybe they're cleaned up during the boot process, maybe they're cleaned up when the program starts again. [131041170100] |One case that you won't be able to observe with du is if the large files are deleted while the program is using them. [131041170110] |When you delete a file on a unix system, only the file's name disappears at first (the file is “unlinked”); the file's contents only disappear when there are no longer any references to the file: neither a name nor a process having it open. [131041170120] |In other words, if a program creates a large file, opens it and deletes it, the space is only reclaimed when the program closes the file (which happens automatically when the program dies). [131041170130] |You can't see deleted files with du, but you can see them with lsof (“list open files”): [131041170140] |In the lsof output, the next-to-last number before the file name (i.e. the 7th column) is the file size. [131041180010] |How do I use dhcpcd in openwrt instead of udhcpc? [131041180020] |I'm trying to determine the reason my router is not syncing up to my ISP, I do suspect snafu on there, end so I'm trying to replicate my desktops setup which includes using dhcpcd. [131041180030] |Problem is I don't know how to tell OpenWRT to use that after I've installed it on OpenWRT. [131041180040] |Can anyone tell me the steps to install and configure dhcpcd for WAN on OpenWRT? (using backfire 10.03 on a WRT54GL) [131041190010] |Basically speaking, it seems the use of udhcpc is hardcorded into the helper scripts of ifup on OpenWRT. [131041190020] |Basically, ifup is calling setup_interface, from /lib/network/config.sh which has hard coded references to udhcpc. [131041190030] |If you were to backup this file, and make the sufficient edits to the helper function, I imagine you would be able to use dhcpcd, however I make no guarantees that it would work, as I have not tried this. [131041190040] |A bit of background, udhcpc does seem to be the preferred &supported DHCP method in OpenWRT, and dhcpcd was only included due to it's support of RFC#3442 (OpenWRT Ticket 1797). [131041200010] |How to allow a particular user to access the FTP? [131041200020] |Anonymous / FTP users are allowed to access the FTP. [131041200030] |Suppose if there is a user named as JOE then how can I allow him to access the FTP? [131041210010] |Not sure why you chose vsftpd, as the documentation is notoriously lacking/distributed. [131041210020] |However, to answer your question - the simplest method of allowing registered user access is through enabling local users: [131041210030] |There are other options, dependent on your needs, such as storing users in a database engine like MySQL. [131041210040] |For more pertinent information, please check the following pages: [131041210050] |
  • vsftpd configuration - online man page
  • [131041210060] |
  • viki (vsftpd community wiki) - local user configuration
  • [131041210070] |
  • viki (vsftpd community wiki) - virtual user configuration (db)
  • [131041210080] |Assuming you meant you compiled vsftpd when you said "I made my own", then this information should apply. [131041210090] |Let us know if this is an incorrect assumption or if the info provided doesn't assist. [131041220010] |Minimalist window decorations etc in OpenBox or similar [131041220020] |I am currently customising my netbook's ArchLinux install. [131041220030] |I really like the minimalist basic style of things like the ThinMC window borders in Gnome, and the FullFlat Firefox theme. [131041220040] |What options are available to recreate this look on something like OpenBox or LXDE? [131041220050] |(This is a small netbook, so I want to avoid installing loads of Gnome packages...) [131041220060] |[I asked this question on SuperUser earlier, but perhaps this is a better place for it...] [131041230010] |For saving display space on a netbook, you may want to take a look at a tiling window manager, such as wmii. [131041230020] |On my notebook, a venerable Thinkpad R50e, wmii proves very helpful. [131041230030] |EDIT: [131041230040] |If you are more interested in minimalistic-looking themes, you could take a look at a Themes pages for Fluxbox. or one for OpenBox. [131041230050] |As I recall, themes such as Elfin2 are quite minimalistic and do not require any additional dependencies. [131041240010] |I've used dwm for a long time on my netbook. [131041240020] |Its a tiling window manager written in about 2k lines of C. Configuration is done through rewriting config.h and making a changes here &there to suit your needs, build again and install. [131041240030] |Its very very light weight. snapshot netbook attached on 22". [131041240040] |Take a look at DWM showoff on Arch BBS. [131041240050] |My Dwm config - Alt+B - browser, Ctrl+Alt+{left/right/up/down} music, volume control, etc [131041250010] |How is file ownership affected across different systems? [131041250020] |As I understand Unix file systems, any file on a unix system must belong to a group and a user of the said system. [131041250030] |A file cannot belong to a group or user that does not exist on the system. [131041250040] |From that assumption, there are a few questions that come to mind. [131041250050] |What happens to the group and user attributes when media is transferred between computers, be it via a flash drive, a CDROM or a network share. [131041250060] |To whom does the file belong in the new system? [131041250070] |Can you limit the data to only work on your system? [131041250080] |(Not talking about encryption here, just basics.) [131041250090] |Also, when you transfer data between two computers, are there ways to ensure that the group and user attributes stay intact (what belongs to root will belong to root on the new system and the same with the normal user). [131041260010] |Each file and directory in most Unix filesystems have an associated numeric group and user id. [131041260020] |Then there is a mapping (/etc/passwd for users and /etc/group for groups) of ids to names. [131041260030] |When you transfer a file to another system, the numeric ids stay the same. [131041260040] |There may not be an name with that id on the new system. [131041260050] |So if you do a ls -l, you will see numbers instead of user names. [131041260060] |The root user always has user id 0, so it will be the same on every system. [131041260070] |If you intend to move files often, you should make sure that users that are common between the two systems have the same user id on each. [131041270010] |On all native unix filesystems, file ownership is stored in the form of user and group IDs. [131041270020] |This is also the case for basic NFS operation (although there are other possibilities at least in NFSv4) and for traditional unix archive formats such as tar. [131041270030] |A file can in fact belong to a user or group that doesn't exist. [131041270040] |The file belongs to a particular ID, but there's no obligation that the ID is listed in /etc/passwd or other user or group database. [131041270050] |For example, if you store your user database on NIS or LDAP, and the database server is temporarily inaccessible, the users' files still exist. [131041270060] |When you carry removable media from one system to another, you should either ensure that user and group IDs match where relevant, or ignore ownership (e.g. by using a non-unix filesystem). [131041270070] |Root is a bit of a special case because its defining characteristic is that the user ID is 0, everywhere. [131041270080] |The only way to control what someone in physical possession of the media will do with the data is to use an intrinsic means of protection, i.e., one that is not dependent on how they access the system, and keep something to yourself. [131041270090] |You can use a mathematical means of protection: cryptography (encryption for confidentiality, signing for integrity; you keep the password to yourself), or a physical means of protection (e.g. a locked box). [131041280010] |bash functions vs scripts [131041280020] |This site says, "Shell functions are faster [than aliases]. [131041280030] |Aliases are looked up after functions and thus resolving is slower. [131041280040] |While aliases are easier to understand, shell functions are preferred over aliases for almost every purpose." [131041280050] |Given that (true or not), how do shell functions compare to standalone shell scripts? [131041280060] |Does one have particular advantages over the other, or better suited for certain types of tasks? [131041290010] |The main difference between aliases and functions is that aliases don't take arguments¹, but functions do. [131041290020] |When you write something like alias l='ls --color', l foo is expanded to ls --color foo; you can't grab foo into the alias expansion and do something different with it the way you can do with a function. [131041290030] |See also How to pass parameter to alias?. [131041290040] |Aliases are looked up before functions: if you have both a function and an alias called foo, foo invokes the alias. [131041290050] |(If the alias foo is being expanded, it's temporarily blocked, which makes things like alias ls='ls --color' work. [131041290060] |Also, you can bypass an alias at any time by running \foo.) [131041290070] |I wouldn't expect to see a measurable performance difference though. [131041290080] |Functions and standalone scripts have mostly similar capabilities; here are a few differences I can think of: [131041290090] |
  • A function runs inside the shell environment; a script runs in a separate process. [131041290100] |Therefore a function can change the shell environment: define environment variables, change the current directory, etc. [131041290110] |A standalone script can't do that.
  • [131041290120] |
  • A function must be written in the language of the shell you want to use it in. [131041290130] |A script can be written in any language.
  • [131041290140] |
  • Functions are loaded when they are defined. [131041290150] |Scripts are loaded each time they are invoked. [131041290160] |This has several consequences: [131041290170] |
  • If you modify a script, you get the new version the next time you invoke it. [131041290180] |If you change a function's definition, you have to reload the definition.
  • [131041290190] |
  • Functions are faster on heavily loaded systems.
  • [131041290200] |
  • If you have a lot of functions that you may not use, they'll take up memory. [131041290210] |Ksh and zsh, but I think not bash, have a form of function autoloading.
  • [131041290220] |Something that's intermediate between a function and a standalone script is a script snippet that you read with the source or . builtin. [131041290230] |Like a function, it can modify the shell's environment, and must be written in the shell's language. [131041290240] |Like a script, it is loaded each time it's invoked and no sooner. [131041290250] |¹ Yeah, I know, this doesn't apply to tcsh. [131041300010] |How do I prevent GRUB from using/starting any graphical UI? [131041300020] |I have a problem with an older Laptop (Fujitsu Siemens LifeBook S6010, to be precise) and an Ubuntu (10.10, Xubuntu desktop) installation (fresh install). [131041300030] |During installation the graphics hardware was mis-detected and it now is completely impossible to boot the system into GUI. [131041300040] |Any attempt to invoke graphics mode will freeze the machine. [131041300050] |Therefore I'd like to boot the machine into text mode to see if I can fix the graphics issue — probably material for another question, if and when I get there. [131041300060] |However, I was unsuccessful at telling GRUB (1.98) to not use any graphics, at all. [131041300070] |I can get to the GRUB menu and edit one of the available boot configurations, but whatever I tried to express "text only", everything failed (i.e. machine still invokes graphics during boot and promptly becomes unusable). [131041300080] |I have no easy other way to get into the machine (it cannot not boot from CD or USB, for example). [131041300090] |So: What do I need to do to tell GRUB at the boot menu to stop it from using any fancy stuff and get me to a text console? [131041310010] |You can enter single user mode by passing the parameter single or 1 to the kernel. [131041310020] |Single user mode will give you a terminal with root privileges. [131041310030] |It may also help to disable the splash screen and enable verbose mode by removing quiet and splash from the parameter list (if they exist, of course). [131041310040] |To boot into single user mode, from the GRUB menu press e, then look for the line that looks like [131041310050] |and add single to the end, removing quiet and splash if they exist so that it becomes [131041310060] |or, alternatively [131041320010] |What does the .d stand for in directory names? [131041320020] |I know many directories with .d in their name: [131041320030] |Does it mean directory? [131041320040] |If yes, from what does this disambiguate? [131041320050] |UPDATE: I've had many interesting answers about what the .d means, but the title of my question was not well chosen. [131041320060] |I changed "mean" to "stand for", I hope this is clearer now. [131041330010] |It doesn't mean directory per se, basically what is happening is that directories that end in '.d' (note these are usually only ever in /etc), take configuration parts. [131041330020] |This is designed so distros can include universal defaults in for instance /etc/yum.conf, but then there is a easy to use method for users or other packages to append their own yum configurations in a safe way that won't be overwritten. [131041330030] |As an example for yum... [131041330040] |If I wanted to start using EPEL on my RHEL5 or CentOS Box, I can configure a new repository in the /etc/yum.repos.d folder, (say /etc/yum.repos.d/epel.repo) or install the epel-release package that creates the file automatically, without modifying my default configuration or causing file conflicts that don't need to happen. [131041330050] |What will happen, is most programs will read their default configuration (/etc/yum.conf for instance) and then iterate over their .d folders including configuration snippets into the running program. [131041330060] |Hope it explains it for you. [131041340010] |More generally, the .d directories (/etc/httpd/conf.d, /etc/rc.d, /etc/being another example), indicates that the files contained will be read and used, often for configuration, if they match a given pattern and do not require being explicitly added to some master list. [131041340020] |So if you add files of the form *.repo to /etc/yum.repos.d, yum will use it when running without needing to add it to a list of configurations /etc/yum.conf. [131041340030] |If you add files of the form *.conf to /etc/http/conf.d, they will be read by Apache without needing to be explicitly added to /etc/httpd/conf/httpd.conf. [131041340040] |Similarly, chkconfig to files in /etc/init.d, cron jobs in /etc/cron.d. [131041350010] |I think, but cannot document, that the .d indicates that the directory is associated with a daemon. [131041350020] |Evidence would indicate that this is at least plausible: [131041350030] |Somewhere in the deep recesses of the little bits of ancient Unix history still rattling around in the back of my mind behind the cobwebs, this calls out to me as the correct answer. [131041350040] |I believe it may have come from a time when the first mammals roamed the earth before the dinosaurs began to die out and man pages were not only kept on the system but also physically in racks measured by the foot. [131041360010] |Excerpt from a Debian mailing list (emphasis added): [131041360020] |When distribution packaging became more and more common, it became clear that we needed better ways of forming such configuration files out of multiple fragments, often provided by multiple independent packages. [131041360030] |Each package that needs to configure some shared service should be able to manage only its configuration without having to edit a shared configuration file used by other packages. [131041360040] |The most common convention adopted was to permit including a directory full of configuration files, where anything dropped into that directory would become active and part of that configuration. [131041360050] |As that convention became more widespread, that directory was usually named after the configuration file that it was replacing or augmenting. [131041360060] |But since one cannot have a directory and a file with the same name, some method was required to distinguish, so .d was appended to the end of the configuration file name. [131041360070] |Hence, a configuration file /etc/Muttrc was augmented by fragments in /etc/Muttrc.d, /etc/bash_completion was augmented with /etc/bash_completion.d/*, and so forth. [131041360080] |Sometimes slight variations on that convention are used, such as /etc/xinetd.d to supplement /etc/xinetd.conf, or /etc/apache2/conf.d to supplement /etc/apache2/apache2.conf. [131041360090] |But it's the same basic idea. [131041360100] |Generally when you see that *.d convention, it means "this is a directory holding a bunch of configuration fragments which will be merged together into configuration for some service." [131041360110] |For part 2, the reason for the ".d", my best guess would be "distributed", as in not part of the main configuration file, but still part of the configuration. [131041370010] |The ".d" suffix here means directory. [131041370020] |Of course, this would be unnecessary as Unix doesn't require a suffix to denote a file type but in that specific case, something was necessary to disambiguate the commands (/etc/init, /etc/rc0, etc/rc1 and so on) an the directories they use (/etc/init.d, /etc/rc0.d, ...) This convention was introduced at least with Unix System V but possibly earlier. [131041370030] |The init command used to be located in /etc but is now in /sbin on modern System V OSes. [131041380010] |Configure Atheros AR9285 wireless in Gentoo [131041380020] |My laptop has an Atheros AR9285 wireless card. [131041380030] |By following the "Network Configuration" section in the Gentoo handbook I chose the ath9k module. [131041380040] |The modules seem to be loaded correctly: [131041380050] |And the interface also shows up in ifconfig: [131041380060] |However, I cannot do a network scan: [131041380070] |And the interface doesn't seem to be recognized: [131041380080] |What can I try to make it work? [131041380090] |PS: I also have Ubuntu on this laptop and wireless is working fine. [131041390010] |If you use DE, it's better to use NetworkManager (description of configuring NM on Gentoo). [131041390020] |Otherwise, you need to edit the net configuration file(/etc/conf.d/net): [131041390030] |and then run /etc/init.d/net.wlan0 start to start it. [131041400010] |I got the solution on Gentoo Forums. [131041400020] |It turned out to be a mis-configured kernel. [131041400030] |Hope that helps anyone who has the same problem :) [131041400040] |Here is the kernel configuration that works (from the post that I linked to above): [131041410010] |How can I disown it a running process and associate it to a new screen shell? [131041410020] |I think the title says it all. [131041410030] |I have a running program on an ssh shell. [131041410040] |I want to pause it and be able to unpause it's execution when I come back. [131041410050] |One way I thought of doing that was to transfer it's ownership to a screen shell, thus keeping it running in there... unless there is a different way to proceed? [131041420010] |Sorry, this may not be possible. [131041420020] |You can revoke “ownership” of the program from the shell with the disown built-in: [131041420030] |However this only tells the shell not to send a SIGHUP signal to the program when the shell exits. [131041420040] |The program will retain any connection it has with the terminal, usually as standard input, output and error streams. [131041420050] |There is no way to reattach those to another terminal. [131041420060] |(Screen works by emulating a terminal for each window, so the programs are attached to the screen window.) [131041420070] |It may be possible to reattach the filedescriptors to a different file by attaching the program in a debugger and making it call open, dup and close. [131041420080] |This requires that you know very precisely what you're doing. [131041430010] |I don't use it regularly, but neercs claims to support this. [131041430020] |It's a screen-like program with miscellaneous fancy features like better pane management, but the main thing it offers is the ability to import a process into a pane [131041440010] |There's also a small utility called retty that lets you reattach running programs to another terminal. [131041450010] |Using GNU screen is your best bet. [131041450020] |Start screen running when you first login - I run screen -D -R, run your command, and either disconnect or suspend it with CTRL-Z and then disconnect from screen by pressing CTRL-A then D. [131041450030] |When you login to the machine again, reconnect by running screen -D -R. [131041450040] |You will be in the same shell as before. [131041450050] |You can run jobs to see the suspended process if you did so, and run %1 (or the respective job #) to foreground it again. [131041460010] |Best Dictionary Software for Linux [131041460020] |Can anyone suggest a good "Dictionary" software in Linux. [131041460030] |I have artha, but I am actually expecting a better one. [131041460040] |Ok here are things which i look out for in a dictionary: [131041460050] |
  • Good database
  • [131041460060] |
  • Word pronounciation (This is not available in Artha.)
  • [131041470010] |Goldendict: http://goldendict.org/ [131041480010] |My favorite is the "dict" command. [131041480020] |It doesn't pronounce words aloud, but it will give you the written pronunciation. [131041480030] |I'd also recommend StarDict, which has a GUI. [131041490010] |As for the database, and in the case you are looking for an English-English dictionary (you haven't stated that explicitly! :( ), I'm quite content with GCIDE (derived from Webster1913; has pronunciation and middle-quality etymologies) and wordnet. [131041490020] |As for the interface, I use these databases installed in my local dictd through emacs-dictionary client. [131041490030] |(Formerly, I used to use Stardict to access these databases.) [131041490040] |Packages with the mentioned stuff in the distro I use: [131041490050] |
  • http://prometheus.altlinux.org/en/Sisyphus/srpms/dict-gcide
  • [131041490060] |
  • http://prometheus.altlinux.org/en/Sisyphus/srpms/wordnet
  • [131041490070] |
  • http://prometheus.altlinux.org/en/Sisyphus/srpms/dictd
  • [131041490080] |
  • http://prometheus.altlinux.org/en/Sisyphus/srpms/emacs-dictionary
  • [131041490090] |
  • http://prometheus.altlinux.org/en/Sisyphus/srpms/stardict
  • [131041500010] |Simple "Variable" Bash File [131041500020] |So I just want to make a simple bash file, that takes a file name as a parameter. [131041500030] |In that bash file, I want to take the name, before the extension, and have it as a "variable", to use in other places. [131041500040] |For example, if I was to run bash_script_name sample.asm, the bash script would run: [131041500050] |So basically the form of bash_script_name $().asm [131041500060] |How ever you would do that in bash. [131041500070] |I dunno, because I have almost no bash experience. [131041510010] |The first argument to the script will be in $1. [131041510020] |You can use a bash string replacement to pull the extension; this removes everything from the last occurrence of . forward, and stores the result in $filename: [131041510030] |Then you can use $filename in your script wherever you want: [131041520010] |Task Switcher inside VNC [131041520020] |I run a VNC client (tightvnc) along with other applications on a Windows machine. [131041520030] |Inside my VNC session, I typically have several xterms and gvim windows open. [131041520040] |How can I switch between the applications within VNC? [131041520050] |If I do ALT-TAB, that results in switching between the applications in Windows where the whole VNC is considered as a single application; I do not want that. [131041520060] |Is there some way to configure some key bindings, any two/three keystroke is okay for me, to do the job? [131041530010] |This probably does belong on SuperUser, but, here's a solution. [131041530020] |I use the vnc viewer from TightVNC (so, this might not work on all vnc viewers). [131041530030] |On the tool bar at the top of the vnc viewer window there is an ALT modifier button. [131041530040] |Click that (it should remain pressed). [131041530050] |Then, just press tab. [131041530060] |Once you've got the window you want, click the alt button again to un-press it. [131041540010] |You should be able to modify the keyboard shortcut assigned to switching windows on the VNC server side desktop. [131041540020] |You didn't specify what desktop environment you are using but on my computer (Ubuntu 10.10 with Gnome) this is the Keyboard Shortcuts control panel from the System menu (System >Preferences >Keyboard Shortcuts). [131041540030] |The Alt-Tab function is near the bottom (under "Window Management", labelled "Move between windows, using a popup window"). [131041540040] |Change it from Alt-Tab to something that isn't a shortcut on either your Windows computer or the apps you're using on the VNC server side. [131041550010] |Problem installing packages on my Redhat machine [131041550020] |This is what I get [131041550030] |What is wrong here? [131041560010] |I think that something is wrong with repository settings. [131041560020] |Check entries in /etc/yum.repos.d/ or /etc/yum.conf or /etc/yum/... [131041570010] |Have you tried 'yum clean all'? [131041580010] |Okay, a couple of things here: [131041580020] |Your repo location is apparently file://localhost/tmp/ (I'm not sure about using file://localhost/ but I'm assuming that it's a shortcut for going file:///, but the main issue is the use of /tmp in that path. Files located under /tmp will get cleaned out on reboot (most times). [131041580030] |Which will explain later failures. [131041580040] |So, step 1 is restore your local repository (using the same method as you used to create it the first time, I'd recommend a location other than /tmp if you intend on using it again in the future - remember you edit your repository entry in yum.conf or yum.repos.d/ with the new path) or connect it to RHN (I'm assuming based on the directory structure this repo source you are using is of the RHEL 5 GOLD tree). [131041580050] |Once you have the repository setup, you will need to either install git from source, or from EPEL (Extra Packages for Enterprise Linux). [131041580060] |Just to note however: [131041580070] |
  • EPEL packages are built against the latest versions of RHEL, so if you are using 5.0 then you may have dependency conflicts, This is why RHN (subscription required) is the best choice for fixing your repository issue.
  • [131041580080] |
  • If you aren't using RHEL, then you will need to fix your CentOS/OUL/SL repository configurations by hand, however the EPEL steps are equally valid.
  • [131041590010] |Microphone always picks up sound and routes it to speakers [131041590020] |I've started running into a kind of strange problem on my laptop, and Google hasn't proved to be very helpful so far. [131041590030] |Essentially, at seemingly random times, my microphone will start sending output directly to my speakers/headphones and I cannot disable it. [131041590040] |Going through the Gnome GUI and muting my microphone doesn't stop the sound, and disabling the capture channel in alsamixer doesn't help either. [131041590050] |For that matter, I can set every channel to a level of "0" in alsamixer, but if I unmute the master I'll still hear microphone input. [131041590060] |So far the only thing that solves the issue is rebooting my system, but that's clearly an inconvenient "workaround" for the problem. [131041590070] |If I was on a desktop this might not bother me much, but my mic is integrated into my laptop so my typing and touchpad clicks get picked up and amplified right through my headphones (which is incredibly annoying, obviously). [131041590080] |This is on a fairly fresh Fedora 14 install, but the problem started on 13. lspci and alsa-info report my sound card as: [131041590090] |and lsmod notes that the snd_hda_intel module is loaded. [131041590100] |Has anybody experienced this before? [131041590110] |Any helpful hints? [131041590120] |It might very well be a simple solution, but I just can't seem to figure out what it is. [131041600010] |As a last resort, you could disconnect the microphone from the board... [131041610010] |Well I've fixed this for myself, though I'm unsure of the exact cause still. [131041610020] |I have Pandora One installed on my machine, and I noticed last week that it was running at startup/login. [131041610030] |I generally dislike having applications run at startup unless they're actually necessary for general functionality, so I took it out of my startup lists. [131041610040] |Since then, this problem has stopped occurring. [131041610050] |My guess is that either Pandora or Adobe AIR as a whole was grabbing my sound card at startup and locking it full on, then not resetting the levels/releasing it after exiting. [131041610060] |Why it would be doing this, I have no idea, but that's the best I can come up with at this point. [131041610070] |I did install Pandora before I went from F13 to F14, so that would explain why the problem persisted across versions/installs. [131041610080] |This is just a guess, though, so if anyone can provide a legitimate explanation then I'm all ears. [131041620010] |remove extra tilespace from a montage (ImageMagick) composite image? [131041620020] |I have a bunch of photos. [131041620030] |They're all the same height, and I'm trying to put them together into a composite image using ImageMagick's montage program via Bash. [131041620040] |The problem is that by default, the tile size (one image occupies one tile) is equal to the image with the largest dimensions. [131041620050] |Narrow images, therefore, are surrounded by a lot of white space. [131041620060] |I want to remove this white space. [131041620070] |How can I do it? [131041630010] |Try something like this: [131041630020] |This will make the border between images as small as possible and whatever is there will be transparent. [131041630030] |To see a demo of the difference using builtin images, try these and compare: [131041630040] |See Montage Usage. [131041630050] |If you post an example of what you're getting and manually edit together an example of what you'd like as a result, we might be able to get a little closer to that. [131041640010] |redirection to cd command [131041640020] |Hi, is it possible to redirection the output of a command to "cd"? [131041640030] |For example, I have searched for a directory using locate and got the path to it. [131041640040] |Now, instead of writing cd path, can I redirect the output to cd? [131041640050] |I've tried this: [131041640060] |But no luck. [131041640070] |It probably isn't something very useful but I'm curious [131041640080] |Thanks [131041650010] |You want command substitution, not redirection: [131041650020] |The bits between the $( and the ) are run as a command and the output (stripped of any final newline) is substituted into the overall command. [131041650030] |This can also be done with ‘back ticks’ (“`”): [131041650040] |The dollar-paren syntax is generally preferred because it is easier to deal with in nested situations: [131041660010] |Useful Linux Podcasts [131041660020] |I'm always looking for podcasts that can help me keep up with operating systems and development. [131041660030] |That said, I typically listen to the Linux Outlaws podcast, but was wondering if there are other Linux/Unix podcasts that many of you find helpful or informative, both with learning Linux or keeping up with the changes to it. [131041670010] |I'm not a huge podcast guy but you might want to try TuxRadar It's one of the better Linux ones I've heard. [131041680010] |About Linux kernel itself, there is only one: http://www.kernelpodcast.org/. [131041680020] |Although the author is asking for help to keep up with the constant flood of lkml, it's not very regular those days. [131041690010] |I've been listening to the Going Linux podcast and find it quite easy to listen to. [131041690020] |They cover subjects easy enough for beginners and also go deeper in following podcasts. [131041690030] |Once a month, they play a recording of one of them answering questions about Linux on the radio. [131041690040] |In my opinion, this is a good entry level podcast. [131041700010] |Roughly weekly, Randal Schwartz puts out an episode of FLOSS Weekly. [131041700020] |This will take a look at some Free Software project by inviting a leader in the project on to answer questions. [131041700030] |Common that I've noticed are: [131041700040] |
  • What does it do?
  • [131041700050] |
  • Who started it?
  • [131041700060] |
  • How mature is it?
  • [131041700070] |
  • What license is it under? [131041700080] |Does the leader being interviewed know why it's under that one?
  • [131041700090] |
  • How did interviewee get involved with the project?
  • [131041710010] |Two links from me: [131041710020] |
  • Sourcetrunk - in each episode author presents some useful free software applications. [131041710030] |Even some old episodes are worth to listen - sometime you could find some interesting application...
  • [131041710040] |
  • The Linux Action Show! - it's been a long time since last time when I listened this one, but if I remember correctly it was news about Linux software and hardware...
  • [131041720010] |Big tab spacings with Kate [131041720020] |Is there a way to configure Kate to use tab spaces of more than 16 spaces? [131041720030] |I am using Kate to make up a tab separated file for import into a database and some of the data needs about 30 spaces between tab stops. [131041730010] |I think you are misunderstanding the purpose of tab separated data files: they are designed for easy program import, not to be visually pleasing to humans. [131041730020] |Since you are importing the data into database, explore the report generation tools available to you from the database. [131041730030] |You will have far more flexibility; for example, you can make a very long field wrap to multiple lines rather than taking up a huge chunk of horizontal space. [131041730040] |If this is not suitable, tabs are an archaic and inconvenient way of forming readable tables and tools like Perl (the backronymmed "Practical Extraction and Report Language") can do far better. [131041740010] |What steps does the system go through when handling an SSH connection? [131041740020] |What steps does the system go through when handling an SSH connection? [131041740030] |
  • We try to log in via ssh
  • [131041740040] |
  • sshd starts pam and pam module to authenticate us
  • [131041740050] |
  • Depending on pam configuration, we need to provide username and password (pam checks passwd and shadow files)
  • [131041740060] |
  • pam checks for hosts.allow/deny, /etc/shells, and other things
  • [131041740070] |
  • If everything goes fine we are logged in
  • [131041740080] |
  • ???
  • [131041740090] |
  • Shell is started
  • [131041740100] |So my question is what mechanism is responsible for checking which shell is assigned to the user in their passwd file (in step 6)? [131041740110] |Is it pam itself, some specific pam module, sshd, or something else? [131041740120] |I know that I can replace the passwd file (for checking username and password) by writing a pam module, but how can I replace the passwd file for the shell entry? [131041750010] |As far as I know, PAM doesn't determine the user's shell, this is left to the application. [131041750020] |PAM's session modules perform generic actions and checks that must be done for on every login using that particular service. [131041750030] |If the application then wants to start a shell, it is free to do so, and will typically look up the shell in the user database. [131041750040] |Assuming your question is about OpenSSH, that's exactly what it does: once the user is authenticated, and the PAM session stuff has been done (if configured to use PAM¹), the ssh server looks up the shell in the user database (directly, not through the PAM library). [131041750050] |The user database isn't limited to /usr/passwd and friends. [131041750060] |On Linux (which I assume you're using since you mention shadow), what makes up the user database is determined by the passwd setting in /etc/nsswitch.conf. [131041750070] |In multi-computer setups, common additions to the local database are NIS and LDAP. [131041750080] |If you want to use a shell that isn't the one in /etc/passwd, this may be what to configure (although it would be a bit strange, and maybe people can offer better suggestions if you tell us what you're trying to accomplish). [131041750090] |If you want to have users without full shell access, the natural solution is to change /etc/passwd to put a restricted shell — perhaps rssh to allow only a few file-copying-type applications such as scp, rsync and cvs. [131041750100] |You can also use forced commands in the user's ~/.ssh/authorized_keys file. [131041750110] |If you'd like to see a trace of what the ssh server is doing, start the daemon as ssh -ddd. [131041750120] |You can also get the client's view with ssh -vvv, though here the server's view is what will interest you most. [131041750130] |¹ OpenSSH only uses PAM if it is configured with PAM support and the UsePAM directive is set to yes in sshd_config. [131041750140] |Even when it uses PAM, it offers other authentication methods in addition to PAM; in particular public key authentication does not go through PAM. [131041760010] |How to detect and remove a Linux trojan? [131041760020] |I recently (re)stumbled upon this: [131041760030] |
  • Linux Trojan Goes Unnoticed For Almost A Year (Unreal IRCd)
  • [131041760040] |Yes, I know that adding some random PPA/software from an untrusted source is asking for trouble (or worse). [131041760050] |I never do that, but many do (many Linux blogs and tabloids promote adding PPAs for fancy apps, without warning that it may break your system or worse still, compromise your security.) [131041760060] |How can a trojan horse or a rogue application/script be detected and removed? [131041770010] |If I understand correctly "trojan" described in this article couldn't be discovered in "normal" way as "normal" malware. [131041770020] |This IRCd was behaving normally until he was used, so administrator could find this security hole only when: 1) it was used and action made by this hole caused entry in logs or was visible in some other way, 2) reading source code. [131041770030] |"Real" Linux malware should be also detected by AV software for Linux or AV LiveCD Rescue Disks, so you could scan computer using this software. [131041770040] |As you can see in SecureList in list there is 1941 entries with Linux in name and that software should be detected by Kaspersky software. [131041770050] |Quick look to this list shows that many entries are about some DDoS tools and exploits or tools that cannot spread automatically and could be used only as tools for attack (so aren't harmful). [131041770060] |For checking for backdoors/rootkits installed by cracker you could use tool that checks file checksums (you should generate list of files and checksums on clean system and update it after server software update). [131041770070] |Every new file or file with wrong checksum is suspicious. [131041770080] |List of checksum and tool that generate it should be on read only medium (cracker could also change for example md5sum for it's own version that shows wrong checksums). [131041770090] |This way of finding malware could be used on 'stable' systems where software isn't upgraded every day. [131041770100] |Some malware could be detected by running netstat locally to check for network traffic, but if system is infected data showed by netstat could also be changed. [131041770110] |In this case some solution is to monitor network traffic from another computer (for example from router, to check what traffic is sent to the internet). [131041780010] |There's no general recipe. [131041780020] |If your system has been infected by an unknown trojan, all you can do is reinstall. [131041780030] |If you know that the trojan operates in a certain way — for example you know that the trojan doesn't infect the kernel — there may be a less harsh way of recovering. [131041780040] |But that's entirely dependent on knowing how the trojan behaves. [131041780050] |If all you have is the symptoms (such as your computer sending spam without your consent), there's no general technique: the trojan detector has to be smarter than the trojan designer (and lucky). [131041780060] |As far as trojans are concerned, detection and hiding are like gun and armor: there is a technological escalation, and neither party has an intrinsic advantage (though hiders do have a head start). [131041780070] |Many systems have a secure distribution channel in place. [131041780080] |For example, when you install a package from the Ubuntu repositories with the apt-based tools (apt-get, aptitude, synaptic, software center, …), the tool checks that the package is signed (vetted) by someone Ubuntu trusts. [131041780090] |(Most distributions have a similar mechanism.) [131041780100] |When you install a package from a PPA, all you can know is that the PPA owner vetted the package, which is no help if you have no reason to trust the PPA owner in the first place. [131041780110] |About trojans and backdoors, I strongly recommend reading Ken Thompson's Turing award lecture, Reflections on Trusting Trust. [131041780120] |To summarize, he changed the compiler so that when compiling the login program, it would add code that allowed him to log in with a secret password; then he changed the compiler so that when it compiled itself, it would insert the code to add the backdoor; then he recompiled the whole system (in particular the login program and the compiler); finally he restored the compiler source to the original, unquestionable source. [131041780130] |Again, read Ken Thompson's article; then you may also read David Wheeler's counterpoint, perhaps best apprehended through Bruce Schneier's blog article. [131041790010] |SELinux and AppArmor exist for prevention of trojan / rootkit and other infections. [131041790020] |I tell the case for SELinux, which I know better. [131041790030] |With SELinux enabled, you give a context to all the process (daemon included) you install on the machine. [131041790040] |You also label the file system to work with the context, matching them. [131041790050] |When a process tries to do something not within its context, you receive a message, and, if SELinux is in enforcing mode, the action cannot complete. [131041790060] |This way, if your ircd trojan was willing to overwrite the ps command or something else (common strategy for trojans / rootkits / worms to avoid detection), i would not be allowed to do that. [131041790070] |And you would be informed. [131041790080] |I knkow it's difficult to configure, but my machines are working with SELinux enforced right now, and my (two) Fedora laptops can do anything a desktop needs without too much hassle. [131041790090] |Even my home server is now in enforcing mode. [131041790100] |Another strategy is a regular run of rootkit detectors which calculate a checksum for the cirtical commands, and inform you regarding changes in the basic commands. [131041790110] |I work with both the SELinux and the rkhunter enabled (plus a clamav antivirus). [131041790120] |Regards [131041800010] |How does partprobe work? [131041800020] |I was looking for a way to refresh the scsi bus (or any other bus, for that matter) that would allow my kernel ( 2.6.18-194-el5 on CentOS 5.5) to know about the partitions on a drive, and I couldn't find a way. partprobe did it instantly. [131041800030] |How? [131041800040] |Since it's important, here's what I was doing: [131041800050] |I wanted to get some practice in partition-specific things like resizing, backing up the MBR and restoring it, and so on. [131041800060] |I had created a 20GB partition on /dev/sdb, backed up the MBR: [131041800070] |dd if=/dev/sdb of=sdb.mbr bs=512 count=1 [131041800080] |then I went into fdisk, deleted the partition, wrote it, and exited. [131041800090] |ls /dev/sdb* [131041800100] |showed that there was no partition, and [131041800110] |fdisk -l /dev/sdb' [131041800120] |matched, so I figured I was good. [131041800130] |I then reversed the dd: [131041800140] |dd if=sdb.mbr of=/dev/sdb bs=512 count=1 [131041800150] |Of course, I didn't do anything at that point, so [131041800160] |ls /dev/sdb* [131041800170] |didn't list any partitions, but [131041800180] |fdisk -l [131041800190] |showed the partition, presumably because it reads the first 512 bytes on the disk and doesn't rely on the kernel. [131041800200] |I knew that I'd have to refresh the bus, so I went into into /sys/class/scsi_host/host1, and did [131041800210] |echo "- - -" >scan [131041800220] |and doing [131041800230] |ls /dev/sdb [131041800240] |didn't show anything new, so then I went to /sys/bus/scsi/devices and for each of the listed devices, I did [131041800250] |echo 1 >rescan [131041800260] |and that didn't work. [131041800270] |I then did more research on the problem, and came across 'partprobe', which comes with parted. [131041800280] |I ran it, and it worked instantly. [131041800290] |If I don't get a likely answer here, I'm probably going to just go get the source and look it up, but I figure there are wizards here beyond me, so I thought I'd appeal to you all. [131041810010] |Partprobe calls the BLKRRPART ioctl, which is documented in, err, include/linux/fs.h, and beyond that the kernel source (the meat is in rescan_partitions()): [131041810020] |The easiest way to find this out is to run strace -e raw=ioctl -e open,ioctl partprobe /dev/sdb. [131041810030] |I think what you tried with /sys/*/*scan tells the kernel to check if there's been a change of drive. [131041810040] |That doesn't help if the drive hasn't changed (or has been hotswapped in a way that the kernel doesn't detect?) but the partition structure on it has changed. [131041820010] |In OSX ssh-keygen creates a key but then the session won't connect [131041820020] |I made a key, but it logs me back out as i try to setup passphraseless logins to localhost: [131041820030] |The same thing happens when I try to login with using the hostname as well. [131041820040] |What am I missing? [131041830010] |If you provide your SSH key by hand does it work? [131041830020] |If so, the problem is most likely your SSH agent that didn't register your new key [131041840010] |You could try to use the following command juts after calling the ssh-keygen command: [131041840020] |ssh-copy-id -i id_rsa.pub localhost [131041840030] |It should copy your public key to the remote host (here your own computer as you used localhost) and activate it in the proper file. [131041840040] |Note: Sometimes and with older version of sshd (the SSH serveur process) the file is named authorised_key, check you sshd man page for the exact name. [131041850010] |Why does xargs causes apt-get to abort? [131041850020] |I'm trying to remove a list of packages from a file. [131041850030] |My command is as follow : [131041850040] |packages is my file containing a list of packages I want to remove. [131041850050] |Everything seems to work well except apt-get abort instead of letting me choose yes or no. [131041850060] |I know I can get around this with the -y option, but I would like to know why this is happening and how can I keep the interactive choice. [131041860010] |A more general solution would be [131041860020] |where you will have a problem if the list of packages is really long. [131041860030] |The reason that it isn't working is that apt-get is trying to read your confirmation from the standard input which - because of the pipe - is attached to cat. [131041860040] |Contrariwise, sudo does the Right Thing by asking your password by opening /dev/tty directly. [131041860050] |Apt should do this but apparently doesn't. [131041870010] |will direct xargs to read arguments from packages, and so it will leave stdin unmolested. [131041880010] |X stuck when using OpenGL [131041880020] |On a stock Dell, RHEL 5.3, my X gets stuck when running any OpenGL program for more than a few seconds. [131041880030] |After a few seconds, the screen freezes, and after another few seconds sometimes the screen turns white. [131041880040] |Any openGL program does that. [131041880050] |I wrote a very simple program that uses only very basic polygon drawing, and it still causes X to freeze. [131041880060] |Killing X won't help it recover. [131041880070] |Both dmesg and the X log don't show any special errors except of [131041880080] |Similar error message appears after I execute an glut OpenGL program. [131041880090] |What could be the trouble? [131041880100] |How can I further debug the issue? [131041890010] |Probably a problem with your video driver. [131041890020] |Download the latest driver for you video card from the vendor's site if it's Nvidia or ATI/AMD, otherwise look for supported OpenGL extensions in your current drivers. [131041900010] |GUI archive manager that works well over ssh [131041900020] |I'm using file-roller and it doesn't work well when my archive file is accessed via ssh (it throws an error when I try to open it). [131041900030] |Any alternatives? [131041910010] |You can access remote files using fish:// or sftp:// with every KDE application. [131041910020] |For example you can connect to the remote host using file managers like Dolphin or Konqueror and after that every file that you click will be open (in KDE app) like it was file on your local drive. [131041910030] |Archives will be opened in Ark (KDE archive manager). [131041910040] |And of course you can open archives directly in Ark (File -> Open -> sftp://remotehost/path/to/file)... [131041910050] |Another alternative that I know, that it works is Emacs... ;) But before you try it you should look at Emacs learning curve... ;) [131041920010] |It Works For Me™. [131041920020] |Gnome applications have built-in support for file access over ssh through Gvfs (formerly Gnome-VFS). [131041920030] |Another way to access files over ssh is sshfs. [131041920040] |It requires an OS that supports FUSE, but most unices (Linux, Mac OS X, *BSD, Solaris, …) do these days. [131041920050] |Since the files are presented through the ordinary filesystem interface, no specific application support is required. [131041920060] |I don't know if there's a GUI wrapper for it; the command-line workflow is [131041930010] |put history command onto command line without executing it [131041930020] |Hi, [131041930030] |I use !n where (n) is the line number for executing a line in the history file I want executed at the command prompt which I find via history|less. [131041930040] |But there is a command line history event I wish to manually modify. [131041930050] |How can I insert into the command line a history events contents without it actually executing so I can modify and then press return? [131041930060] |Best, [131041940010] |If you use bash, just edit ~/.bash_history, add whatever command you want into it and close / reopen the console (or logout/login if you are in cli only). [131041950010] |Using Ctrl+r you can search history: [131041950020] |Any command that you find could be edited... [131041950030] |I think that I found exactly what you need: run shopt -s histverify and next time when you want to use !n command will be not executed but only put to command line... [131041960010] |To request that the command be printed rather than executed after history substitution, add the :p modifier, e.g. !42:p. [131041960020] |The resulting command will also be entered in the history, so you can press Up to edit it. [131041960030] |If you have the histverify option set (shopt -s histverify), you will always have the opportunity to edit the result of history substitutions. [131041960040] |The fc builtin gives limited access to history expansion (no word designators), and lets you edit a previous command in an external editor. [131041960050] |You can use !prefix to refer to the last command beginning with prefix, and !?substring to refer to the last command beginning with substring. [131041960060] |When you know what you're looking for, this can save a lot of time over history | less. [131041960070] |Another way to search through previous history is incremental search: press Ctrl+R and start entering a substring of what you're looking for. [131041960080] |Press Ctrl+R to go to the previous occurence of the search string so far and Ctrl+S if you've gone too far. [131041960090] |Most keys other than Ctrl+R, Ctrl+S, Backspace and ordinary characters terminate the incremental search and have their usual effect (e.g. arrow keys to move the cursor in the line you've reached, Enter to run the command). [131041970010] |You can use magic space to expand history before hitting enter. [131041970020] |In your .inputrc, map space to magic space: [131041970030] |Now, whenever you type a space after a history specification, it'll be immediately expanded - handy if you want to edit it, too! [131041980010] |Take a look at the history-expand-line command, bound to Alt+^ by default. [131041980020] |It will expand the line in-place which you can then edit. [131041990010] |What is your favourite shell script GUI/CLI editor and why? [131041990020] |I'm using vim for editing bash scripts currently, but i really need to set it up and/or install plugins. [131041990030] |Plugin suggestions welcome. [131041990040] |Either way i'd like to see which editors/IDEs are there for this job. [131042000010] |I love Geany [131042000020] |It's a quick GUI editor that can manage small projects if necessary (it can remember list of files and a few other neat things). [131042000030] |It supports many syntax highlighting including Shell scripting. [131042000040] |It supports plug-ins, and I have used the VC (version control) plug-in once, but the basic features of Geany are enough for most of the work I do with it. [131042010010] |Another cool editor, though the UI looks a bit old now, is Nedit. [131042010020] |It is more powerful than Geany as it can support ctags which you can use to navigate through your code (finding the definition of a function or variable, etc.) [131042010030] |It's really light-weight, fast to launch. [131042010040] |However, the user experience might not please everyone. [131042010050] |I have been using it for a long period to develop shell and C/C++ code. [131042010060] |Though I use more now Geany and Eclipse CDT for these purposes. [131042020010] |gedit can be a great editor when extended with gedit-plugins [131042030010] |I use both BBEdit (Mac text editor) and vi(m). [131042030020] |BBEdit has a command line counterpart which works great for integrating with the underside of the Mac and other CLI tools. [131042030030] |vi(m) is on essentially every *nix system out there. [131042030040] |Knowing vi(m) is beneficial due to its availability. [131042030050] |Hope that helps with your search! [131042030060] |Have a wonderful day. [131042030070] |~ tim [131042040010] |I found this: http://www.vim.org/scripts/script.php?script_id=365 [131042040020] |It is really good for bash scripting. [131042050010] |Emacs is rather good, there's been a built-in shell scripting mode for some time. [131042060010] |Force dhcp client to get a new lease [131042060020] |I have a linux DHCP server running on my network. [131042060030] |I recently found out that I can assign specific IP addresses to clients based on their MAC address by modifying the dhcpd.conf file. [131042060040] |Now is there something I can do from the server side that would invalidate a specific client's lease, forcing it to get a new one from the server (after I have added entries in dhcpd.conf), without releasing/renewing on the client side? [131042070010] |You might want to lower your default-lease-time and max-lease-time in dhcpd.conf. [131042070020] |This should force your clients to obtain a new lease once the time expires. [131042080010] |The answer to this depends on how you previously configured the DHCP server. [131042080020] |Normal DHCP behaviour is this: [131042080030] |
  • Lease is given a lease time perhaps 7days.
  • [131042080040] |
  • Client machine starts requesting a new lease half way through the current lease period.
  • [131042080050] |
  • Client machine only stops using the IP address when it either gets a new lease from the same DHCP server or the lease has expired.
  • [131042080060] |The consequence of this is that you need to start planning your network maintenance. [131042080070] |When you are going to make a change that will require new IP settings, about "lease time" ahead, you need to reduce the lease time down to a more dynamic setting (e.g. 30 minutes). [131042080080] |that way changes in DHCP will be rolled out smoothly, and then when you are ready, you increase the lease time back to a more sensible value. [131042080090] |Do not leave it at 30 minutes as it will mean that should the DHCP server fail, half your machines will be connectionless in 15 minutes. [131042080100] |You can force through a change in lease by asking everyone to reboot their computers (or for the more technically capable, releasing and then renewing their leases) [131042090010] |Broadcast to all users in friends list with kopete? [131042090020] |in kopete you can right click a group and send a message to the group. [131042090030] |It also seems there's a hidden toplevel group that you can move users to. [131042090040] |Is it possible to send a message to this toplevel group so that all users in your friends list receive it? [131042100010] |as far as I have found this is not possible, so I opened a feature request bug for it. [131042110010] |What is the difference between X and XFree? [131042110020] |Why are there two programs for that? [131042120010] |X refers usually to the X Window System, a networking protocol and a software which supports drawing application windows on your screen. [131042120020] |Another synonym for the protocol is X11. [131042120030] |XFree86 was the reference implementation of the X Window System until 2003 there was some trouble concerning the license for the new release, which was seen incompatible to the GPL from many developers. [131042120040] |They left the XFree86 project, founded the X.Org Foundation and created X.Org, which is another implementation of the X Window System. [131042120050] |The development of XFree86 still continues. [131042130010] |X is short for X Window System, which is the architecture specification and protocol that allows Unix graphical applications (clients) to connect to a display (server) in order to display the GUI and interact with the user. [131042130020] |XFree(3) is one of the functions defined by the X library, that is used to free memory allocations, just like free(3). [131042130030] |Perhaps you meant XFree86, which is a specific implementation of the X Windows System. [131042140010] |How do I count all the files recursively through directories [131042140020] |I want to see how many files are in subdirectories in there subdirectories to find out where all the inode usage is on the system. [131042140030] |Kind of like I would do this for space usage [131042140040] |which will basically give me the amount of space used in the directories off root. but in this case I want the number of files, not the size. [131042150010] |Try: [131042150020] |as a starting point, or if you really only want to recurse through the subdirectories of a directory (and skip the files in that top level directory) [131042160010] |Give this a try: [131042160020] |It should work fine unless filenames include newlines. [131042170010] |Thanks to Gilles and xenoterracide for safety/compatability fixes. [131042170020] |The first part: find -maxdepth 1 -type d will return a list of all directories in the current working directory. [131042170030] |This is piped to... [131042170040] |The second part: while read -r dir; do begins a while loop - as long as the pipe coming into the while is open (which is until the entire list of directories is sent), the read command will place the next line into the variable "dir". [131042170050] |Then it continues... [131042170060] |The third part: printf "%s:\t" "$dir"; will print the string in "$dir" (which is holding one of the directory names) followed by a tab. [131042170070] |The fourth part: find "$dir" makes a list of all the files inside the directory name held in "$dir". [131042170080] |This list is sent to.. [131042170090] |The fifth part: wc -l; counts the number of lines that are sent into its standard input. [131042170100] |The final part: done simply ends the while loop. [131042170110] |So we get a list of all the directories in the current directory. [131042170120] |For each of those directories, we generate a list of all the files in it so that we can count them all using wc -l. [131042170130] |The result will look like: [131042180010] |The following solution counts the actual number of used inodes starting from current directory: [131042180020] |To get the number of files of the same subset, use: [131042180030] |For solutions exploring only subdirectories, without taking into account files in current directory, you can refer to other answers. [131042190010] |ls command: what does the first line mean? [131042190020] |Hi, I haven't been able to find this through internet, when I make ls -l I get this: [131042190030] |But what does the "total 2020" mean? [131042190040] |I only have 3 files so it's not the number of files or directories, and I guess it's not the size neither. [131042190050] |So what is it? [131042190060] |Thanks [131042200010] |The number of 1kB blocks used by the files in the directory, non-recursively. [131042200020] |Use ls -lh to have some more meaningful output. [131042210010] |How can I manipulate the content of a file, by duplicating and changing some parts? [131042210020] |I want to manipulate a text-file. [131042210030] |It contains many blocks of the form [131042210040] |I want to duplicate each of these blocks and add and remove a line of it's content. [131042210050] |Can I script that? [131042220010] |Well, you can script anything. [131042220020] |However, if I were doing this, I would use vim macros. [131042220030] |(If you are not familiar with vim already, you should learn it, but otherwise ignore this) [131042220040] |A few basic pointers: [131042220050] |q -- start recording a macro [131042220060] |qx -- stop recording a macro and name it 'x' [131042220070] |@x -- run the macro named 'x' [131042220080] |A macro will immediately re-run whatever commands you typed during the recording session. [131042220090] |So if you wanted a macro to duplicate a block like that type: [131042220100] |There are plenty of good resources and examples out there for vim usages and vim macros. [131042220110] |For what it's worth, sed is a sort of a command line version of vim, so you might be able to adapt what I said to sed, but I'm less familiar with it, so I can't vouch for it. [131042220120] |~~ edit ~~ [131042220130] |Another thing that makes this more useful is vim's ability to open up multiple files. [131042220140] |Multiple files opened are referred to as buffers. [131042220150] |You activate this by having multiple filenames after vim (IE vim *.txt to open all txt files) [131042220160] |To run a macro on multiple buffers, first open up all the files at the same time. [131042220170] |Then, use :bufdo normal @x to run the macro x on each buffer. [131042220180] |Note, you must have :w as the last step of the macro to avoid getting stuck when it tries to switch to the next buffer if the current one isn't saved. [131042220190] |:bn will take manually to the next buffer. [131042220200] |Also, see http://stackoverflow.com/questions/1291962/replay-a-vim-macro-until-end-of-buffer for how to run a macro for each line. [131042220210] |Mix and match :) [131042230010] |The exact tool to use will depend on the specifics of the job. [131042230020] |If the job is only going to happen once, you might consider using a macro in vim or emacs. [131042230030] |If you truly want to script it, I would look into sed: [131042230040] |Sed is a stream editor. [131042230050] |A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline). [131042230060] |Again, the exact way to do this is will depend on your situation, but to add a line after a line starting with PATTERN you can do this: [131042230070] |To add a line before a line starting with PATTERN you could do something like this: [131042230080] |To remove a line starting with PATTERN [131042230090] |The trick will be to find the correct PATTERN that will catch only the lines you want. [131042230100] |You can combine these by doing soemthing like this: [131042240010] |The natural tools for this are awk and Perl (assuming you want to script: for a once-off, the natural tool is an interactive editor). [131042240020] |Here's an awk script that duplicates all CLASSEND blocks (no balancing supported: each CLASS matches the next END), except that foo lines are omitted from the second copy. [131042240030] |Here's a sed solution; don't take it too seriously. [131042240040] |Don't expect it to behave if the CLASS/END lines are not in strict alternation. [131042250010] |And Python solution from me: [131042250020] |I think that it is easiest to understand and modify than awk version (if you don't know awk)... [131042250030] |Btw awk is next language on my list of languages that I want to learn... ;) [131042260010] |Is screen useful? [131042260020] |When I need to open different processes or terminals that I need to check, I just open a new tab in my terminal and use different workspaces in my machine to keep everything organized. [131042260030] |I do some web development, using a Linux machine. [131042260040] |I've seen that a lot of people use screen to accomplish what I'm doing, but I can't see any advantage. [131042260050] |In fact, I thought it would be worse since now I have to remember all states in screen instead of having some terminals in a workspace named "terminals". [131042260060] |What am I missing? [131042260070] |How do you actually use screen? [131042270010] |It's particularly useful when you don't have access to a graphical environment. [131042270020] |For example, when you're on an ssh connection with no X11 forwarding. [131042280010] |I use screen both locally and remotely. [131042280020] |I find that I use screen because it gives me the ability to [131042280030] |
  • Run multiple tasks without making multiple ssh connections to a remote server,
  • [131042280040] |
  • Run a long-running task in screen, detach, disconnect. [131042280050] |The job will still be running in screen and I can come back later, reattach, and check its progress.
  • [131042280060] |
  • Have a more or less persistent workspace on a server, which is nice when I am doing something that involves multiple steps over the course of a day.
  • [131042280070] |
  • Receive important system information in a non-intrusive way using the screen profile customizations provided by byobu.
  • [131042280080] |
  • Use "Named Tabs": In screen I can give each "tab" in screen a name, allowing me to instantly know where to switch to.
  • [131042280090] |
  • Use more keyboard shortcuts. [131042280100] |If you do most of your work at the computer, not having to use the mouse is a real plus. [131042280110] |I find that screen's keyboard shortcuts provide a bit more power, but this may just because I've never invested in truly learning all of the GTK shortcuts.
  • [131042280120] |Here is a screen shot of a recently started screen session using byobu and other customizations: [131042290010] |I know people that use screen as a tabbed console; I don't. [131042290020] |It's very useful if you want to leave interactive programs open without actually having a console connected all the time, especially if you want to be able to access those programs from multiple computers over SSH. [131042290030] |For example, I keep my IM client open in a screen session on a server, so I'm always online, and I can connect to it from whatever computer I happen to be on [131042300010] |Heck yes! [131042300020] |Screen (along with synergy) is one of my favorite programs. [131042300030] |I use it every time I connect to our servers, and often just on my local machine. [131042300040] |Beyond what others have already mentioned, screen protects you from blips in network connections. [131042300050] |When I'm working remotely (coffee shop, airport, etc) our VPN doesn't always play well with some networks. [131042300060] |The VPN will disconnect and reconnect often. [131042300070] |Using screen protects what you're working on from getting lost if one of these blips happens at a bad time. [131042300080] |Regarding 'remembering all the states', it helps to set up a status bar. [131042300090] |In my .screenrc file, I have the following (among other stuff) [131042300100] |This shows details about where I am, which tab I have open. [131042300110] |I will name my tabs based on either what server that tab is connected to, what folder I'm in, what process/script is currently running, or what file I have open. [131042310010] |Down to basics: it allows you to detach session and "transfer" running cli apps from one env to another (you can use the same irssi client in X and then in tty4 without closing irssi and reopening session in it). [131042310020] |I find pretty annoying to have to reopen programs when i transfer some work and running apps from Xorg server to cli env (ttyX terminals). [131042310030] |This way i just type [131042310040] |screen -R [131042310050] |and voila: my vim session, my moc playlist, my alpine mails, my last used dir in mc, my rss reader etc. are loaded in my terminal in a blink ov an eye without any reconnection or re-authorization. [131042320010] |Yes, screen is useful. [131042320020] |Here's why in 8 easy steps: [131042320030] |
  • ssh you@somehost
  • [131042320040] |
  • screen
  • [131042320050] |
  • start doing something really important
  • [131042320060] |
  • unplug the router / turn off the power in the building / spill coffee on your laptop (etc[*])
  • [131042320070] |
  • panic
  • [131042320080] |
  • get things back up an running
  • [131042320090] |
  • ssh you@somehost
  • [131042320100] |
  • screen -d -r
  • [131042320110] |
  • continue doing what you were doing before #4
  • [131042320120] |Ok, so that's 9 steps, but... you get the idea. screen is also great for all the other things people have mentioned, as is tmux, a BSD licensed alternative that is somewhat new to the game. [131042320130] |[*] here, etc refers to anything not involving the host you initially ssh'd to. screen isn't that good.