Standard solution for displaying messages either on shell or with window managers gui

Is there a standard solution to display messages from within bash scripts eiter on the commandline if the shell is a login shell or in a new window in the present window manager's GUI? Specifically I am running kde which has the tool `kdialog` to display messages. However I would prefer a solution which is independent of KDE but uses KDE style if it is running. Also it should allow to ask for user input etc.


How to make a standalone application appear on the Mint menu?

How can I make the executable file of a standalone application appear on the mint menu so that I can execute it from there? What I currently do is to add the application path to the `PATH` variable and execute it from command line like this: `AppName &`. I don't know how I can add the application to the mint menu though. Any advice would be appreciated. I am on `Linux Mint 15 (Mate)`.


Gnome 2 desktop shortcut: Run a script having commands changing the environment

I want to launch a script (that ultimately launches an editor) with a single click in GNOME 2. To this end I have a script which sources the environment variables first and then ultimately launches the editor. The script looks something like:               #!/bin/sh     source variablesFile     editor $1      From the terminal I can easily launch the editor with:               $ ~/script myFile.txt       Now, what I want to achieve is have an icon in the taskbar/Desktop, from which I can double click and start typing, just like gedit. I tried the following way: ![enter image description here](http://i.stack.imgur.com/4XoSS.png) but it did not work (mostly because the environment variables could not be changed). I also tried: ![enter image description here](http://i.stack.imgur.com/RvCWY.png) but a terminal window flashed and went away. No idea what happened. Any clues?


How do I add eclipse to my gnome shell favorites?

I run gnome shell 3.6 and Eclipse 4.2. I installed Eclipse manually, in my /opt directory, because the Ubuntu package for Eclipse is very outdated. I've created a .desktop file for it, and placed in in ~/.local/share/applications. It looks like this:               [Desktop Entry]     Type=Application     Name=Eclipse     Comment=Eclipse Integrated Development Environment     Icon=/opt/eclipse-4.2.1/icon.xpm     Exec=/opt/eclipse-4.2.1/eclipse     Terminal=false     Categories=Development;IDE;Java;      I can run Eclipse from the Activities menu; if I hit the super menu and type in "Eclipse" and run it, it starts just fine, and shows up in my launcher/sidebar/dock/whatever it's called. But if I right-click on its icon, there is no "Add to favorites" option. (I notice this is also the case if I run some very old programs, like xeyes and xcalc. it's amazing these are still distributed!) So what is it about a program that determines whether or not the "Add to favorites" option is available? if I knew and understood that, maybe it'd set me on the right path to fixing this Eclipse problem.


How to get my own IP address and save it to a variable in a shell script?

How can I get my own IP address and save it to a variable in a shell script?


How do I set mouse double click speed in Lubuntu

I'm using Lubuntu 11.10. The only problem I have that the mouse double click speed is a bit high (it seems to me that it is around 100-200ms) and I would like it to set it to around 500ms. Is there a way to do it? I tried using Openbox Configuration Manager but that only changes the double click speed for window headers. But in PCManFM for example it is still around 200ms.


Force fsck at boot time on the root file system (prior to mounting file systems, without Single-User mode)

I just wonder if there are any solutions available at all (Googled for 2 hours). How to automatically force fsck disks after crash in `systemd`? - does not mean anything. Setting `fsck_y_enable="YES"` and `background_fsck="NO"` in `/etc/rc.conf` don't do anything. My root file system is not clean and has a lot of errors (due to a power outage - unexpected shutdown, not because hard drive or hardware are bad). `fsck` shows errors:               root@host2:/usr/home/alex # fsck     ** /dev/mirror/gm0p2 (NO WRITE)     ** Last Mounted on /     ** Root file system     ** Phase 1 - Check Blocks and Sizes     ** Phase 2 - Check Pathnames     ** Phase 3 - Check Connectivity     ** Phase 4 - Check Reference Counts     UNREF FILE I=8268305  OWNER=root MODE=140777     SIZE=0 MTIME=Jun  6 21:58 2014     CLEAR? no      [skipped 100+ lines] I don't have physical or KVM access to the server. This is `gmirror`ed drive               FreeBSD host2.domain.tld 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Thu Sep 26 22:50:31 UTC 2013 root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64          # Device                Mountpoint      FStype  Options Dump    Pass#     /dev/mirror/gm0p2       /               ufs     rw      1       1     /dev/mirror/gm0p3       none            swap    sw      0       0


Deleting ssl.conf a problem in apache set up?

In a desperate attempt to stop warnings from a free ssl cert I set up a while back and not knowing how to undo it I ended up deleting my ssl.conf file in the etc/ssl folder but now I am wondering if that comes with apache by default and necessary for running other programs? The problem I was having besides the warnings of untrusted site because have multiple sites running off the one IP , every time https preceded any of the sites they would naturally go to root site instead of individual sites which is something I had to somehow stop but I am sure my methodology is all wrong. At least now https site not found until I can pay for a certificate. What SHOULD I have done?               ca-bundle.crt  ca-bundle.trust.crt  localhost.crt  make-dummy-cert    Makefile     renew-dummy-cert      These are exact certs located in /etc/ssl so I could recreate that folder if I wanted but I won't because I think it was created when I went through process of setting up untrusted ssl cert. I don't even know where I can EDIT those registration details but I would love to know.


How to disable Alt-Arrow switching of Virtual Consoles?

The following happens on different Linuces: When I'm in a virtual console, hold `Alt` and press `←` or `→`, the virtual ttys cycle. This is really annoying as I'm using fish-shell which also uses this key combo. I _could_ remap fish's short cuts, but I don't want to. Instead I want to disable the linux function or remap it. How can I disable or change the tty-cycling-key-combo?


Possible corrupt passwd file

I did a recovery of the server and reset the root password to a new one because for some reason, the original was not being recognised. It still is refusing to accept the password in ssh for root. After further research, it appears that it could be a corrupt etc/passwd file. Parallels state that running this command:               cat /etc/passwd | grep ^root | hexdump -c       the end of the file should end with, \n but mine ends with \r \n. This file I checked as a user with /bin/bash privs. Now the problem. I cannot check the passwd file at root. Any ideas? I understand there are 2 etc/passwd locations. 1 for each user allocated on the system and the 2nd is in the etc root area. Thanks


archive.ubuntu.com missing raring-updates

My Linux Mint 15 install on VirtualBox was working great up until about two days ago, when the updater started throwing a ton of errors and refuses to progress with any `apt-get update`, `apt-get install`, or `apt-get upgrade`. They are 404 errors on the `archive.ubuntu.com` site, under the `/ubuntu/dists/raring-updates` folder. I looked at it, it doesn't exist. Here's a direct link, which shows there is no raring-updates. Where has `raring-updates` gone and what can I do to fix this?


Give a user the permission to access files in a directory

I have mounted a volume from NAS storage to my Solaris 10 machine using NFS. I want to give read/write permission for a user to the directories and subdirectories and files. I have tried               setfacl  -m user:biptip:rwx,mask:rwx NIADOCS/*     setfacl -R -m d:u:biptip:rw,u:biptip:rwX NIADOCS      but I am not able give the permission.


How to grep for a single quote?

I am grepping through some VB source files. I use the following query -                    grep -nr "GlobalCommArea\s*=\s*.*\.Transaction" .       Some of the lines, however, are commented and begin with a single line comment. A single line comment in VB starts with a single quote - ' Unfortunately, I cannot simply remove all those lines that have a single quote in them, because some of the lines have a single quote comment after the line of code. So I tried something like this to remove the single quote at the start of the line                    grep -nr "GlobalCommArea\s*=\s*.*\.Transaction" . | grep -v "^\s*'"      However, this did not work. How to do this?


Run script when specific users logout

I need to run my application in screen when specific users are logged out and kill the screen when someone from my user list logged in. So I am thinking about bash script, which will be called periodically from cron and:   1. Checks if specific users are logged in.   2. If nobody is logged in - spawn screen and save pid to file or do nothing if pid file already exists   3. If someone is logged in - read pid from file and kill screen I am looking for more sophisticated alternatives, which will eliminate periodically running script from cron.


Route incoming network requests for a given port to different applications

I have an application that listens for connections on a port, but I occasionally take it down for updates and the like. I'd like a way to configure the system such that if that program is running, requests for that port are sent to the application, but if it's not running the requests are directed to some other application (that can return a "temporarily unavailable" message). What's the easiest way to accomplish that? I don't have root access on the target machine, so I'd prefer to avoid things like `iptables`. I've considered a helper application that does nothing but route connections to the other two applications, but I'm hoping there's an easier way


Locate enscript reported non-printable chars

I'm making a postscript of a bunch of C code, and `enscript` reports I have 2 non-printable chars               [ 91 pages * 1 copy ] left in a.ps     2 non-printable characters     non-printable character codes (decimal):     128 153      However I couldn't find these chars with `grep`               grep -r $'\231' *     grep -r $'\200' *      Is there a way to let `enscript` report which lines contain the non-printable chars?


Mount filesystems after boot to avoid fsck delay for sshd

I'm trying to optimise the overall downtime and improve availability in case of system failure. I'm specifically concerned about the reboot (e.g. after a kernel panic) taking so long that I don't actually know if the system is or is not doing OK, since I don't have the serial console to a particular server. What would be the proper way to mount all non-essential filesystems immediately after boot in OpenBSD, instead of prior to `sshd`? I have about two dozen filesystems, what I'm thinking is that perhaps only the most essential ones should be `fsck`'ed and mounted first, then `sshd` be started, then all the rest are `fsck`'ed and mounted immediately afterwards. What would be the best practice to do something like that?


How to activate reverse tethering on CentOS 5

Most examples for reverse tethering are for Ubuntu. They go something along these lines:   1. Attach smartphone   2. Configure usb0   3. Start reverse tethering on the smartphone   4. Use the PC network via USB from your smartphone Now I do not want to use Ubuntu. I want to use CentOS 5. I've got the CentOS 5 Plus XEN Kernel active, so some features should be available there, too. So far I found that I will probably have to:   * Actiate the kernel-module `rndis_host`, that will enable   * `usbnet` and that should make   * `usb0` appear as network device The latter does not happen, `lsusb` shows the correct tags for my attached smartphone. What am I missing here? There has been a similar question, but the question is not that "on the mark" and also doesn't have any answers yet either.


User Mode Linux compile fails

I am trying to compile User Mode Linux on a 64 bit machine with `defconfig` and getting the following error.               arch/x86/um/user-offsets.c:1: sorry, unimplemented: code model "large" not supported yet      Any idea what this means?


Chat application for monitoring with scripts

I am looking for a chat application, which would have the ability to interact with a shell script. I need this for a home project. An example of the usage would be: A client sends a chat message to a server. It analyzes the incoming message and takes an action in the form of executing a (`bash`) script. Initially the idea came from this wonderful article. My case is similar, but I will be not using a modem, rather `gnokii` or `Gammu`/`Wammu` with a mobile phone. For the server I am using Debian Wheezy. The clients should be able to use Windows, Linux (Debian in most cases) and Android. Therefore ideally this system would use Skype - both for the chatting and for voice calls. However, Microsoft has decided to drop the support on Skype APIs and that would make the job harder. I am also not very experienced with `Delphi` and `Python`, as there seem to be some APIs and libraries for those languages. I have some background in `C`, `bash` and `Perl`. So, I considered using a bot in Skype like `sevabot`, but have not tried that yet. In addition, it is not very sure for how long Skype will have the existing APIs. Another very nice option seems to be `LinPhone` with all the above features available. I would need to figure out a bit deeper the interaction with `linphonec` and `linphonecsh`, but this software seems to be quite nice. Other ideas that came are using `Pidgin` or any other chat client that could fulfill the above requirements. Another option would be if I could get this idea realized in the form of a webpage. I have an apache webserver on the Debian machine, which is running a small Wordpress site. But I think such a setup will be harder to do and not so efficient. And finally, maybe one of the easiest options would be to use E-mail for such a communication. However, this would be not so streamlined and efficient. I would appreciate all the ideas you may have. Which is the most efficient, fast and long-lasting manner to accomplish this goal?


why would curl and wget result in a 403 forbidden?

I try to download a file with `wget` and `curl` and it is rejected with a 403 error (forbidden). I can view the file using the web browser on the same machine. I try again with my browser's user agent, obtained by http://www.whatsmyuseragent.com. I do this:               wget -U 'Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0' http://...      and               curl -A 'Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0' http://...      but it is still forbidden. What other reasons might there be for the 403, and what ways can I alter the `wget` and `curl` commands to overcome them? (this is not about being able to get the file - I know I can just save it from my browser; it's about understanding why the command-line tools work differently) **update** Thanks to all the excellent answers given to this question. The specific problem I had encountered was that the server was checking the referrer. By adding this to the command-line I could get the file using `curl` and `wget`. The server that checked the referrer bounced through a 302 to another location that performed no checks at all, so a `curl` or `wget` of that site worked cleanly. If anyone is interested, this came about because I was reading this page to learn about embedded CSS and was trying to look at the site's css for an example. The actual URL I was getting trouble with was this and the `curl` I ended up with is               curl -L -H 'Referer: http://css-tricks.com/forums/topic/font-face-in-base64-is-cross-browser-compatible/' http://cloud.typography.com/610186/691184/css/fonts.css      and the wget is                wget --referer='http://css-tricks.com/forums/topic/font-face-in-base64-is-cross-browser-compatible/' http://cloud.typography.com/610186/691184/css/fonts.css      Very interesting.


what is the meaning of 1 at the end of awk script

I was reading this awk script `awk -F"=" '{OFS="=";gsub(",",";",$2)}1'` I want to know what is the function of `1` at the end of it


I cannot succeed in using the fluxbox ResizeTo function

I often use a stack of terminals one above the other. And I've notice I do it always the same way, resizing each terminal window so as it occupies circa 1/3rd of the screen. I wanted to have a short key for doing this automatically. Obviously the command exists (cf. fluxbox manual), called ResizeTo. in `~/.fluxbox/keys` I have tried:   * `Shift Mod4 a :ResizeTo -100% -33%`   * `Shift Mod4 a :ResizeTo 100% 33%` I've also launched `Reconfigure` so as to have the new keymapping working. However when pressing `Shift + Windows key + a`, there is nothing happening. Any idea what I'm doing wrong ?


Are there any virtualization solutions for OpenBSD that aren't from ports?

I'm searching for a virtualization solutions for an OpenBSD host and a CentOS guest. What are my options? I'm searching for one that doesn't use packages from ports. Are there any?


Problem with mouse scroll under one user

I have three users set up on my system (Debian testing / x64 / Xfce 4.8). For two of them scrolling with the mousewheel works perfectly, but for one user it doesn't work properly in Xfce. The mouse-wheel scrolling will work, but only when the mouse is over a scrollbar (horizontal or vertical) (e.g. in Thunar or when over the workspace-switching applet). This method doesn't work at all in iceweasel. I've tried deleting .gconf* and .config/xfce* but I still can't see why the mouse doesn't scroll. The home partition has survived several linux distro installs, so there may be odd files knocking around, but don't want to lose all settings etc that do work. Keyboard - Cherry Cymotion Master Linux (Num lock on/off makes no difference) Mouse - Logitech MX518 Both autoconfigured at startup (attempts to manually configure by creating an xorg config file actually fails with "Number of created screens does not match number of detected devices. Configuration failed")


Linux installation in RAID

I am a fairly new systems administrator and I have to configure the RAID on a Linux machine. From my understanding so far, RAID is an array of multiple disks. I have some questions though. **Question 1:** If I have five _500 GB_ HDD, these 5 HDDs together are termed as RAID disk.Is this right? **Question 2:** I presume the machine is brand new with nothing inside it. So, I just have a machine with RAID solid state disk. If I have to install RHEL or Ubuntu or any linux distribution in these hard disks, how should I install? Should I install the OS in any one of the disk and use RAID tool like **Mdadm**? **Question 3:** I believe the RAID disk is being configured for some software. So, is there any particular configuration I need to look out for?


Where to create virtual link for chroot?

I've tried to pass this step of lfs but when i put:               chroot "$LFS" /tools/bin/env -i      I got:               chroot: failed to run command '/tools/bin/env': No such file or directory      So i search about it and realized that i should check shared library so i did:               $ldd /bin/bash      linux-gate.so.1 =>  (0xb7787000)     libtinfo.so.5 => /lib/i386-linux-gnu/libtinfo.so.5 (0xb7746000)     libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb7741000)     libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb7591000)     /lib/ld-linux.so.2 (0xb7788000)      and               $ldd /tools/bin/env     linux-gate.so.1 =>  (0xb76f0000)     libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb7522000)     /lib/ld-linux.so.2 (0xb76f1000)      And it looks for loader which is there(ld-* files) and i should create some virtual link to solve it,but i don't know where to put it and it should link which to what?


Make zsh alt-f behave like emacs alt-f

In emacs, `M-f` moves the caret to the end of the next word. In zsh, `M-f` (or rather `alt-f`) moves the caret to the beginning of the next word. For a more consistent experience, I'd like to have zsh `alt-f` mirror emacs behavior. How can I do this?


Local DNS Server Refuses to Ask itself for DNS

I am running Debian 7 and have set up a DHCP and DNS server. Everything is working nicely, except for the server itself not following the DNS entries in BIND. The problem is that `/etc/resolv.conf` is populated by an upstream gateway as its primary DNS. After manually changing the entry to point to itself instead of the upstream gateway, the DNS server uses the BIND settings before requesting DNS from the gateway. Unfortunately, upon reboot or re-connect of the interface, `/etc/resolv.conf` reverts back to using the gateway, putting me back into the problematic situation. I'd like to keep dynamic IP on that interface, while using a static nameserver. Is this possible?


What does it mean to be "sh compatible"?

I've seen the phrase "sh compatible" used usually in reference to shells. I'm not sure if it also applies to the programs that might be run from within shells. What does it mean for a shell or other program to be "sh compatible"? What would it mean to be "sh incompatible"? Edit: This question asking the difference between bash and sh is very relevant: http://stackoverflow.com/questions/5725296/difference-between-sh- and-bash I'd still like a direct answer to what it means to be "sh compatible". A reasonable expectation might be that "sh compatible" means "implements the Shell Command Language" but then why are there so many "sh compatible" shells and why are they different?


bash/shell pathname expansion for mkdir, touch etc?

So doing something like this in `bash` and most other shells won't work to create multiple subdirectories or files within subdirectories...               mkdir */test     touch */hello.txt      There are of course many ways of actually doing this, my preferred one is to use `find` when possible rather than using a `for` loop, for readability mainly. But my question is, why do the above not work?   From what I understand it's because the full destination file/path does not exist but surely that's a good thing if I'm trying to `mkdir` or `touch`. I've always just moved on and never really questioned it.   But does anyone have a decent explanation for this that will help me understand once and for all?


What is difference between GTK and QT applications?

Many packages available with GTK and QT versions. So, What is difference between them? Is there any difference in performance or working method?


Zorin OS: Low disk space message

I am frequently getting low disk space error and attached screen displayed. Let me know what to do.


Default umask 077 not applied at session start

I cannot get the default umask for a session to be `0077`. I have edited `/etc/login.defs` and set the value to `077` there:               UMASK           077      Also I've made sure the following entry exists in `/etc/pam.d/common-session`:               session optional                        pam_umask.so      While this configuration seems to work when the user logs in using `su` it doesn't when the login happens through mdm. Both mdm and su configuration files in pam.d include common-session.               username@hostname ~ $ umask     0022     username@hostname ~ $ su username     Password:     username@hostname ~ $ umask     0077      This problem does not occur when using GDM or LIGHTDM instead of MDM. Any ideas on what could be a possible cause of this?


problems installing lcov on Debian 6

I have been stuck for a few hours trying to install lcov on a debian 6 box. Any help would be greatly appreciated! What I have tried the following in the command line:               root@damrod-ci:/etc/munin/plugins# apt-get install lcov     Reading package lists... Done Building dependency tree     Reading state information... Done     You might want to run `apt-get -f install' to correct these: The following packages have unmet dependencies:   libpango1.0-0: Breaks:     plymouth (< 0.8.3-19) but 0.8.2-2ubuntu2.2 is to be installed E:     Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).                    root@damrod-ci:/etc/munin/plugins# apt-get -f install     Reading package lists... Done Building dependency tree        Reading     state information... Done Correcting dependencies... Done The     following packages were automatically installed and are no longer     required:   libgnumail-java libts-0.0-0 libcdio10 junit4     libgsf-1-common libarchive1 libntfs10 libgeronimo-jms-1.1-spec-java     libcdio-paranoia0 libcupsimage2   libgphoto2-port0 libmagickcore2     libservlet2.4-java antlr gvfs-backends obex-data-server     libimobiledevice0 libmockobjects-java libgnuinet-java   libasm2-java     libproxy0 libplexus-component-api-java libmagickwand2     libsoup-gnome2.4-1 libdirectfb-1.2-0 libxstream-java     libpango1.0-common   libgnujaf-java radiusclient1 libgsf-1-114 ivy     libopenobex1 lm-sensors libradius1 fancontrol libxpp3-java libgs8     psfontmgr tsconf ghostscript   libcdio-cdda0 libhamcrest-java groovy     libexif12 libpaper-utils libxcb-render-util0 libbluetooth3 libpaper1     libjs-mootools libgphoto2-2 Use 'apt-get autoremove' to remove them.     The following extra packages will be installed:   plymouth The     following packages will be upgraded:   plymouth 1 upgraded, 0 newly     installed, 0 to remove and 278 not upgraded. 179 not fully installed     or removed. Need to get 0B/141kB of archives. After this operation,     69.6kB of additional disk space will be used. Do you want to continue [Y/n]? y WARNING: The following packages cannot be authenticated!       plymouth Install these packages without verification [y/N]? y (Reading     database ... 85730 files and directories currently installed.)     Preparing to replace plymouth 0.8.2-2ubuntu2.2 (using     .../plymouth_0.8.3-20_amd64.deb) ... Unpacking replacement plymouth     ... dpkg: error processing     /var/cache/apt/archives/plymouth_0.8.3-20_amd64.deb (--unpack):      trying to overwrite '/lib/libply-splash-core.so.2.0.0', which is also     in package libplymouth2 0.8.2-2ubuntu2.2 Processing triggers for     initramfs-tools ... update-initramfs: Generating     /boot/initrd.img-2.6.32-33-server Processing triggers for ureadahead     **... Errors were encountered while processing:      /var/cache/apt/archives/plymouth_0.8.3-20_amd64.deb E: Sub-process     /usr/bin/dpkg returned an error code (1)      My sources.list               #############################################################     ################### OFFICIAL DEBIAN REPOS ###################     #############################################################          ###### Debian Main Repos deb http://ftp.nz.debian.org/debian/ squeeze main contrib non-free  deb-src http://ftp.nz.debian.org/debian/     squeeze main contrib non-free           ###### Debian Update Repos deb http://ftp.nz.debian.org/debian/ squeeze-proposed-updates main contrib non-free           ##############################################################     ##################### UNOFFICIAL  REPOS ######################     ##############################################################          ###### 3rd Party Binary Repos          #### Dotdeb - http://www.dotdeb.org deb http://packages.dotdeb.org oldstable all               ####### 3rd Party Source Repos          #### Dotdeb (Source) - http://www.dotdeb.org deb-src http://packages.dotdeb.org oldstable all


In Gnome, how do I decide whether to accept a PackageKit software source?

When I try to install software in the Gnome environment of Linux (mine is openSUSE) from a repository that I have not used before, PackageKit asks me to respond "Yes" or "Cancel" to a dialog "Software signature is required". How can I as a user or administrator get over the discomforts of this dialog? Or, how can Gnome correct them? I'm not merely complaining. I mean, yes, this dialog makes me want to rant about all the dialogs that say, in effect: "Would you like to daydream instead? [Y] [N]" But I actually want to know how to decide my answer to the dialog so that I can get software that I need from repositories while using my best judgment to authorize particular repositories or not. An important advantage of using repositories is that I'll be notified of updates.   * I can only see that the dialog appears after my request to install software. I doubt that the information in the dialog proves that it relates to my request. If I conclude that the dialog appears _because_ of my request, I may be committing the logical fallacy of _post hoc ergo propter hoc_.   * The facts claimed in the dialog are not attributed to a specific information source. I don't know why those are the facts that I must verify.   * I'm left to suppose that I must go check that the signature (meaning key, I suppose?) in the dialog matches the signature for the software source that I wanted. But nothing really gives me an address for that source that I can check up, or an idea of which of the many kinds of signature I'm looking for and where. The documentation page that I linked above says it's usually a GPG key. What little I know about GPG is that it's primarily used for email and that its method of providing security guarantees seems to require some subtle considerations.   * I'm not actually given a "signature". I'm given:      * a "signature URL" that is (I think) not actually a site where I can learn more;     * a "signature user identifier" that looks like an email address but does not (I think) give me a good way to check whether I want to trust communications from whoever controls that address;     * a "signature identifier" of eight hexadecimal digits which is (I think) not a cryptographic guarantee of anything.


How can I have a separate umask for directory or user?

I want a separate umask for a directory or a user. How can I do this? Edit: I am using Debian 6. The reason why I want to do this is, I want all my SFTP users to create files with write on group. I am using a SFTP client to test to see if the umask is setting properly.


How can I disable UFW logging for a specific event?

My router sends out multicast packets in regular intervals that are blocked by UFW's standard policies. These events are harmless but spam my `syslogs` and `ufwlogs`. I can't change the router's behaviour as that would require installing a modified firmware and thus void the warranty. So my question is: Is there any way I can prevent UFW from logging this particular event without changing the blocking policies? And, as a possible follow-up: If I can't define a custom logging policy, would allowing this incoming traffic pose a possible security risk?


Debian - Apache 2.2 & mod_php - memory usage

I have a memory problem with my servers (Debian 6.0) where is installed Apache httpd 2.2, mod_php and APC. Actually it seems that httpd allocate all available memory (4GB) when is waiting too much for an answer from Mongodb (30 seconds timeout). Ok, I know, 30 seconds timeout is too high. This long wait lead the frontend server to start to swap memory, the load average reach very high values (around 200) until the hw is completely stuck. I suppose the problem is in the current httpd configuration, because `MaxClients` is set to 200 and PHP memory limit to 128MB. In worst case we need only for each PHP engine at least 25GB of RAM, but we have 4GB.   * 128 megabytes * 200 = 25 gigabytes My humble opinion is that: having 4GB, if we shrinking php memory_limit to 96MB, we should support about 48 fork (i.e. `MaxClients` 48). Even because an Apache httpd forks a new child, most of the memory is shared with the parent process.   * Total Memory 4GB = Apache child 96MB * 48 `MaxClients` But how to know exactly how much memory is shared by all httpd children and how much is allocated by each apache httpd process?   And talking about PHP and APC, even in this case, how to know how much memory is shared and how much is allocated by each engine?


glade gtk+2 and gtk+3

I have Gtk+3 already installed as it was with the distro. I need to use gtk+2 and glade. How do I use glade with gtk+2 and still have both gtk2 and gtk3 installed on my linux box? I have Glade 3.12.2 installed and when I save a project then open it in a text file it shows gtk 3 and need for it to say gtk 2 not gtk 3.


How do I set the user of php-fpm to be php-user instead of www-data?

I am using php-fpm on debian with nginx for php5 support. I would like to have php-fpm to be under the user&group php-user instead of www-data. I thought the init.d script would have the user mentioned or uses a file which has www-data written in it. Yet I don't see it. How do I spawn this process to be under user php-user:php-user? Here is the php5-fpm init.d script on my server. I tried looking at start-stop-daemon man pages but didn't see it. I'm sure this is simple but I don't know how to do it.               #!/bin/sh     ### BEGIN INIT INFO     # Provides:          php-fpm php5-fpm     # Required-Start:    $remote_fs $network     # Required-Stop:     $remote_fs $network     # Default-Start:     2 3 4 5     # Default-Stop:      0 1 6     # Short-Description: starts php5-fpm     # Description:       Starts PHP5 FastCGI Process Manager Daemon     ### END INIT INFO          # Author: Ondrej Sury <ondrej@debian.org>          PATH=/sbin:/usr/sbin:/bin:/usr/bin     DESC="PHP5 FastCGI Process Manager"     NAME=php5-fpm     DAEMON=/usr/sbin/$NAME     DAEMON_ARGS="--fpm-config /etc/php5/fpm/php-fpm.conf"     PIDFILE=/var/run/php5-fpm.pid     TIMEOUT=30     SCRIPTNAME=/etc/init.d/$NAME          # Exit if the package is not installed     [ -x "$DAEMON" ] || exit 0          # Read configuration variable file if it is present     [ -r /etc/default/$NAME ] && . /etc/default/$NAME          # Load the VERBOSE setting and other rcS variables     . /lib/init/vars.sh          # Define LSB log_* functions.     # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.     . /lib/lsb/init-functions          #     # Function to check the correctness of the config file     #     do_check()     {         [ "$1" != "no" ] && $DAEMON $DAEMON_ARGS -t 2>&1 | grep -v "\[ERROR\]"         FPM_ERROR=$($DAEMON $DAEMON_ARGS -t 2>&1 | grep "\[ERROR\]")              if [ -n "${FPM_ERROR}" ]; then         echo "Please fix your configuration file..."         $DAEMON $DAEMON_ARGS -t 2>&1 | grep "\[ERROR\]"         return 1         fi         return 0     }          #     # Function that starts the daemon/service     #     do_start()     {         # Return         #   0 if daemon has been started         #   1 if daemon was already running         #   2 if daemon could not be started         start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \             || return 1         start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \             $DAEMON_ARGS 2>/dev/null \             || return 2         # Add code here, if necessary, that waits for the process to be ready         # to handle requests from services started subsequently which depend         # on this one.  As a last resort, sleep for some time.     }          #     # Function that stops the daemon/service     #     do_stop()     {         # Return         #   0 if daemon has been stopped         #   1 if daemon was already stopped         #   2 if daemon could not be stopped         #   other if a failure occurred         start-stop-daemon --stop --quiet --retry=TERM/$TIMEOUT/KILL/5 --pidfile $PIDFILE --name $NAME         RETVAL="$?"         [ "$RETVAL" = 2 ] && return 2         # Wait for children to finish too if this is a daemon that forks         # and if the daemon is only ever run from this initscript.         # If the above conditions are not satisfied then add some other code         # that waits for the process to drop all resources that could be         # needed by services started subsequently.  A last resort is to         # sleep for some time.         start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON         [ "$?" = 2 ] && return 2         # Many daemons don't delete their pidfiles when they exit.         rm -f $PIDFILE         return "$RETVAL"     }          #     # Function that sends a SIGHUP to the daemon/service     #     do_reload() {         #         # If the daemon can reload its configuration without         # restarting (for example, when it is sent a SIGHUP),         # then implement that here.         #         start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME         return 0     }          case "$1" in         start)         [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"         do_check $VERBOSE         case "$?" in             0)             do_start             case "$?" in                 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;                 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;             esac             ;;             1) [ "$VERBOSE" != no ] && log_end_msg 1 ;;         esac         ;;         stop)         [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"         do_stop         case "$?" in             0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;             2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;         esac         ;;         status)             status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?             ;;         check)             do_check yes         ;;         reload|force-reload)         log_daemon_msg "Reloading $DESC" "$NAME"         do_reload         log_end_msg $?         ;;         restart)         log_daemon_msg "Restarting $DESC" "$NAME"         do_stop         case "$?" in           0|1)             do_start             case "$?" in                 0) log_end_msg 0 ;;                 1) log_end_msg 1 ;; # Old process is still running                 *) log_end_msg 1 ;; # Failed to start             esac             ;;           *)             # Failed to stop             log_end_msg 1             ;;         esac         ;;         *)         echo "Usage: $SCRIPTNAME {start|stop|status|restart|reload|force-reload}" >&2         exit 1         ;;     esac          :


Start the GUI automatically in OpenBSD

I can't find the GUI to start up automatically in OpenBSD hppa 5.3. What commands must I use to get this working? I want to use Gnome like in OpenSuse which I am more comfortable with.


Why do we use su - and not just su?

I don't understand why `su -` is preferred over `su` to login as root.


Why would we su without -?

When we do `su John` I switch as user John.   When we do `su - John` I switch as user John having user John's environment.   As far as I can see the first option is useless. What is the use of switching to another user and not have that user's environment?   Am I wrong? What is the difference in use cases between these 2 options?


Help Parsing `su` Command ... What Does the Hyphen Do?

In the command `su - username`, what is the function of the hyphen? It seems to work all the same without the hyphen.


Should the mysql user have access to /var/lib/mysql?

First, let me say that mysql seems to be working perfectly on the machine. Still, when I `su mysql` and `ls /var/lib/mysql`, I get access denided. When I `sudo ls /var/lib/mysql` I see the data files corresponding to my database tables, so this is definitely the data folder of mysql. Shouldn't the mysql user have access to its own data folder? Is the machine misconfigured somehow? **Some more details:**               $ sudo ls -la /var/lib/ | grep mysql     drwx------  5 mysql     mysql   4096 2011-06-25 08:05 mysql     $ sudo su mysql     $ ls /var/lib/mysql     ls: cannot open directory /var/lib/mysql: Permission denied     $ sudo ls -la /var | grep lib     drwxr-xr-x 42 root root  4096 2011-03-17 12:03 lib     $ sudo ls -la / | grep var     drwxr-xr-x 14 root root  4096 2010-12-02 19:14 var     $


pure-ftpd permission denied on external usb drive

I have a sheevaplug PC (Debian installed) that I'm trying to setup my personal FTP server with. So far I was able to set up auto mounting and installed pure- ftpd. I currently have autofs setup to mount the external USB drive to the home dir of a user called "xt" (/home/xt/usb1) Here's the mounting options I used:               usb1 -fstype=auto,umask=000,uid=1000,gid=1000,rw,nosuid,nodev,user :/dev/sda1      And the `pure-ftpd` cmd:               pure-ftpd -S 400 -c 30 -B -j -E      With the way it is now, I'm able to browse all dirs fine, I can even upload, rename and delete files outside of the usb drive. However inside the usb drive, I can browse files only (denied access to downloads, uploads, delete, etc...). I did an `ls -l /home/xt/usb1` and all dirs are listed as: `drwxrwxrwx` on the permissions colum so on paper, I should be able to do anything to the drive.


Postgresql 9.1 - Kali Linux

I start to read this book : http://www.amazon.fr/Metasploit-The-Penetration- Testers-Guide/dp/159327288X And i have some trouble in using `postgresql 9.1` (in Kali Linux). When i start `msfconsole`, i first have this message : > Failed to connect to the database: could not connect to server: Connection > refused Is the server running on host "localhost" (::1) and accepting TCP/IP > connections on port 5432? could not connect to server: Connection refused Is > the server running on host "localhost" (127.0.0.1) and accepting TCP/IP > connections on port 5432? And then `msfconsole` starts normally. After that, I try to connect to `postgresql`, using the credentials I've found in : **/opt/metasploit/apps/pro/ui/config/database.yml** But it doesn't work, because **authentification failed**.


[Solved]man crashes on OS X after upgrading bash and its manpages

Bash on OS X is always so old that I finally decided to compile a never(4.3.18) one and simply override and replace the old one. Here are the configure flags I used:               ./configure --prefix=/ --datarootdir=/usr/share      After installing this, I made a symlink:               /bin/sh -> bash      Everything worked well, except for man. Other manpages also has such problem.               apple [ ~ ] $ man bash     Error executing formatting or display command.     System command (cd '/usr/share/man' && (echo ".ll 14.0i"; echo ".nr LL 14.0i"; /bin/cat '/usr/share/man/man1/bash.1') | /usr/bin/tbl | /usr/bin/groff -Wall -mtty-char -Tascii -mandoc -c | (/usr/bin/less -is || true)) exited with status 32512.     No manual entry for bash      However everything is fine if I simply execute the command mentioned above:               apple [ ~ ] $ (cd '/usr/share/man' && (echo ".ll 14.0i"; echo ".nr LL 14.0i"; /bin/cat '/usr/share/man/man1/bash.1') | /usr/bin/tbl | /usr/bin/groff -Wall -mtty-char -Tascii -mandoc -c | (/usr/bin/less -is || true)      And I got the regular and correct output, which is the new manpage. * * * Well, All this was caused by the symlink... I don't know why it disappeared. Anyway, Everything went well after I relinked it.


Windows 8.1 and Ubuntu 14.04 LTS problem

I have one drive which can be accessed from `Ubuntu 14.04 LTS` and `Windows 8.1`. Lets call it Drive D. When I shutdown `Windows 8.1` and start `Ubuntu 14.04 LTS`, I'll not be able to mount Drive D. But when I restart `Windows 8.1` and select `Ubuntu 14.04 LTS` to boot, then after booting, Drive D mounts. Is there any bug in Windows/Ubuntu, or am I missing something?


How do I install a device driver provided as a .bin file?

I am a new Linux user and am struggling installing a driver for a usb WiFi device I want to use on an embedded system (BeagleBone). When I download the driver for the chipset (Ralink 2070), it is provided as a bin file. I have tried making it executable (`chmod +x`), but using `file` says it is a data file and I cannot execute. How do I use this bin file to install the chipset driver? Do I only need to place this in a folder, and if so, where should it be placed?


e2fsck -y /dev/sda changed my 6TB disk into 1.8TB

After problems with mount I run `e2fsck -y -b BLOCK /dev/sda` and it was running for 3 days on 6TB raid 0, when it completed this was the output:               /dev/sda: ***** FILE SYSTEM WAS MODIFIED *****          /dev/sda: ********** WARNING: Filesystem still has errors **********          /dev/sda: 1529942/122060800 files (7.5% non-contiguous), 9080905/488243200 blocks      So I mounted this virtual drive and it shows now: Total 1.8TiB, Free 1.8TiB, looks like it shows the space that left on my virtual disk before filesystem ext4 crashed. None of harddisks crashed, only filesystem was corrupted. I did not have disk partitioned, only one single virtual disk. Any way that I could restore files somehow?


CentOS 6.5 applications won't minimize on lower panel

I believe this question is related to something that happened earlier today. Right now, when I press minimize on any Gnome application, it dissappears, is still running, but I cannot get to it to restore it. Should I reset my Gnome desktop, and how do I do that?


Customizing less colors

When using less in OS X, how can I customize the colors with with things are displayed? When I run less within an ansi-term in Emacs the colors don't come out nicely.               $ less --version     less 418     Copyright (C) 1984-2007 Mark Nudelman


How to interpret the output of safecopy

Just as an example, this is one typical output line. > ...........................[12767109](+112394240){X [12792709] > X}[12818309](+209715200) I have gone through the DESCRIPTION OF OUTPUT in safecopy's manpage but I still am not quite sure what exactly it means. For example, if `(+112394240)` is "the number of blocks (or bytes) [which is it?] continuously read successfully up to this point." and if `(+209715200)` is the "number of blocks (or bytes) of recent continuous unreadable data.", then how can the latter be larger than the former? Additionally, what is the meaning of `{X [12792709] X}`, does it mean that only one block (block 12792709) was unreadable? Any clarification would be greatly appreciated.


ufw firewall rules for security.debian.org

What is a practical way to manage a whitelist of firewall outgoing connection rules for http://security.debian.org (on a server that blocks all outgoing connections by default)? My understanding is that security.debian.org is a CNAME to several mirror IPs, and it is advisable to use only IP addresses (not hostnames) in firewall rules. At the moment I simply add newly resolved IPs to security.debian.org to my firewall (ufw) outbound rules as I discover them. However this is cumbersome and doesn't allow for automated apt-get updates. Can anyone suggest a better way? PS: I found the following page somewhat relevant but it did not provide a solution: http://www.debian.org/doc/manuals/securing-debian-howto/ap-fw- security-update.en.html


How to identify error in a particular file while checksum verification (which file having problem while verification) in shell script

I have two files on ftp location in csv.gz format and their checksum is in .csv.gz.md5 format. I am copying this file in my local system. I am generating check sum for it through **md5sum**. Now I am comparing it against the copied file. Now I want to identify any **error** in a file if there is one and also which file is having an **error**. Please help me.


Redirect home to shared NTFS partition

I've installed windows 7 and linux dualboot. My partitions are:               /dev/sda2: UUID="EC328C61328C329E" TYPE="ntfs"      /dev/sda3: UUID="800E88610E8851D8" TYPE="ntfs"      /dev/sda4: UUID="20e7c430-bab0-4aa1-8afe-caa9d97e1de3" TYPE="ext4"      where `sda2` is windows `sda3` is shared partition and `sda4` is linux sd3 has mounting point `/windows` Because `sda2` and `sda4` are small partitions I created directories Music, Documents, etc. and redirected windows libraries in here. I want do the same in linux but editing `~/.config/user- dirs.dirs` to               XDG_DESKTOP_DIR="$HOME/Plocha"     XDG_DOWNLOAD_DIR="$HOME/"     XDG_TEMPLATES_DIR="$HOME/Šablony"     XDG_PUBLICSHARE_DIR="$HOME/Veřejné"     XDG_DOCUMENTS_DIR="/windows/home/Documents"     XDG_MUSIC_DIR="/windows/home/Music"     XDG_PICTURES_DIR="/windows/home/Pictures"     XDG_VIDEOS_DIR="/windows/home/Videos"      has no effect. Folders has icons as it if works but when I click on Music in the file browser it goes to `/home/myUser/Music` not into`/windows/home/Music`. It would be great if it would work for `cd ~/Music` command too :)


python3.3 build from source

When running make test while doing a build from source for python3.3 I had 25 tests skipped and 14 skips unexpected on linux. OS Debian 7.0 64 bit server. How can I figure out what packages are needed to resolve these skipped tests?


How do I get Parallels Plesk to only respond to a specific host, not ANY host?

I'm trying to get my Parallels Plesk Admin Panel to _only_ respond to _one_ host, not every host that points to the machine. Can this be done in Parallels Plesk 11.x? I assumed that I'd be able to configure this through the ~~Apache~~ Nginx config files, but I haven't been able to locate where that might be. So to be clear, I want the admin panel accessible on i.e. `admin.domain.com`, whilst unavailable on `www.clientdomain.com`, even though they're both on the same server and the same IP.


ssh local tunnel to VM

So, can anyone explain why this doesn't work? Everything from remote host (`192.168.1.3`):               ssh -L 9000:192.168.1.2:80 login@192.168.1.2     elinks http:127.0.0.1:9000      and I can see a web page. other host with www (`192.168.1.1`):               ssh -L 9000:192.168.1.3:80 login@192.168.1.2     elinks 127.0.0.1:9000      and I see another web page. BUT when I try to access a Virtual Machine on `192.168.1.2`, then nothing:               ssh -L 9000:172.31.255.29:80 login@192.168.1.2      I was trying to log rejected packages (nothing found), `tcpdump` shows answer from vm to `virbr0` What could be the problem? I have got only one clue, that it might be unix socket related but need advice from somebody who understands that better than me.


How can I use "emulate sh" in zsh to work with ". myscript.sh"?

I've been using `emulate sh -c ". $HOME/myscript.sh"` and it's working so far. However, if I'm at `~` and try to do `emulate sh -c ". myscript.sh"`, I get `.: no such file or directory: myscript.sh.`. Why?


How to really easily save all tagged attachments in mutt?

You can save all attachments via   1. tag all attachments via hitting `t`   2. `;`   3. `s`   4. choose destination directory and hit `a` (all) This works but has following severe side effect: you have to hit n-times `enter` for n attachments. That means even if there are no file name collisions in the destination directory. This is also documented in the Mutt FAQ. Very inconvenient. Some mutt users seem to recommend piping messages to munpack (example message linked). Good idea - but how to make Mutt prompt for a destination directory (as part of a `munpack` invoking macro)? How do I construct such a macro? Or are there better solutions to this issue?


"This is a 32 bit computer, you can't use 64 bit software on it"

anisha@linux-uitj:~> cat /etc/issue && uname -a     Welcome to openSUSE 11.2 "Emerald" - Kernel \r (\l).          Linux linux-uitj 2.6.31.5-0.1-desktop #1 SMP PREEMPT 2009-10-26 15:49:03 +0100 x86_64 x86_64 x86_64 GNU/Linux          anisha@linux-uitj:~>      Doesn't this output show that this is a 64 bit machine? Now when I try to load a `64 bit OpenSUSE 11.3 ISO` on the `VirtualBox`, I get a message as shown in the thread title!               anisha@linux-uitj:~/tarBalls> file opensuse-dvd-x86_64.0702..001.iso     opensuse-dvd-x86_64.0702..001.iso: ISO 9660 CD-ROM filesystem data 'openSUSE-DVD-x86_64.0702..001  ' (bootable)          anisha@linux-uitj:~/tarBalls>


How to install emerald package on Mint?

How can I install the **Emerald** package on **Mint**? I cannot seem to find and install it in the _Synaptic Package Manager_. I think the repository of this package is missing. But I don't know where it is and how to add it to the current list of repositories.


Compiling C/C++ code by way of including preprocessor build instructions in an actual C/C++ source file

So here's the thing, and it's really just conceptual so don't let it bug you: I've got reasons for not wanting to rely on a specific build system. I don't mean to dis anybody's favorite, but I really just want to stick to what comes with the compiler. In this case, GCC. Automake has certain compatibility issues, especially with Windows. <3 GNU make is so limited that it often needs to be supplemented with shell scripts. Shell scripts can take many forms, and to make a long story short and probably piss a lot of people off, here is what I want to do -- The main entry point is God. Be it a C or C++ source file, it is the center of the application. Not only do I want the main entry point to be the first thing that is executed, I also want it to be the first thing that is compiled. Let me explain -- There was a time when proprietary and closed-source libraries were common. Thanks to Apple switching to Unix and Microsoft shooting themselves in the foot, that time is over. Any library that needs to be dynamically linked can be included as a supporting file of the application. For that reason, separate build instructions for .SOs (and maybe .DLLs ;]) is all fine and dandy, because they are separate executable files. Any other library should be statically linked. Now, let's talk about static linking -- Static linking is a real bitch. That's what makefiles are for. If the whole project was written in one language (for instance C OR C++), you can #include the libraries as headers. That's just fine. But now, let's consider another scenario -- Let's say you're like me and can't be arsed to figure out C's difficult excuse for strings, so you decide to use C++. But you want to use a C library, like for instance MiniBasic. God help us. If the C library wasn't designed to conform to C++'s syntax, you're screwed. That's when makefiles come in, since you need to compile the C source file with a C compiler and the C++ source file with a C++ compiler. I don't want to use makefiles. Bear with me -- I would hope that there is a way to exploit GCC's preprocessor macros to tell it something like this: ```` Hi, GCC. How are you doing? In case you forgot, this source file you're looking at right now is written in C++. You should of course compile it with G++. There's another file that this file needs, but it's written in C. It's called "lolcats.c". I want you to compile that one with GCC into an object file and I want you to compile this one with G++ into the main object file, then I want you to link them together into an executable file. ```` How might I write such a thing in preprocessor lingo? Does GCC even do that?


Need help converting a string from a file into a date

I'm trying to read a string from a file and then convert it into a date but for some reason it's failing. I'm actually modifying a GeekTool Geeklet that's not working at the moment. It reads a file locally and pulls out a target date that is then used in a countdown clock. The line of code that is failing is:               TARGET=$(date -j -f %D_%T $1 +%s)      I know that I can hardcode the value in the script using -v but I want to work out why this line isn't working. I can't seem to find any refs to converting a string from a file into a date object. I also can't find refs to -j or -f flags... [edit] Here's the full script:               #!/bin/bash     # Homework countdown     # BETA - I will update this when I get more time     function countdown     {     CURRENT=$(date +%s)     TARGET=$(date -j -f %D_%T $1 +%s)     LEFT=$((TARGET-CURRENT))     WEEKS=$((LEFT/604800))     DAYS=$(( (LEFT%604800)/86400))     HOURS=$(( (LEFT%86400)/3600))     MINS=$(( (LEFT%3600)/60))     SECS=$((LEFT%60))          lblWEEKS="Weeks"     lblDAYS="Days"          if [ $DAYS == 1 ]     then     lblDAYS="Day"     fi          if [ $WEEKS == 1 ]     then     lblWEEKS="Week"     fi          if [ $HOURS -lt 10 ]     then         HOURS=0$HOURS     fi            if [ $MINS -lt 10 ]     then         MINS=0$MINS     fi               if [ $SECS -lt 10 ]     then         SECS=0$SECS     fi          echo $1     echo $TARGET     echo $2 $WEEKS Weeks, $DAYS $lblDAYS $HOURS:$MINS:$SECS     # Optional extra line between timers     echo     }     DATES=( $( cat /Users/Shared/Deadlines.txt ) )     # Even numbered indices are names, odd numbered indices are dates               if [ ${#DATES[@]} == 0 ]     then     echo "No Deadlines!"     return     fi          for (( i = 0 ; i < ${#DATES[@]} ; i+=2 ))     do     countdown ${DATES[i+1]} ${DATES[i]}     done      And the file simply contains: test: 17/05/2011_12:00


KDE and LightDM on ArchLiux

Is it possible to use LightDM with KDE on Archlinux? Wiki says > Basically there are two ways of starting KDE. Using KDM or xinitrc. I use also awesome WM and XFCE, so I'd like to use LightDM instead.


GNOME 2.91 in Ubuntu 10.04 (or 11.04 as it doesn't matter)

I found GNOME Panel v2.91 and I would like to try it for testing purposes only. It looks like in this version it was still using the GNOME 2 Layout with the GNOME 3 engine. I would like detailed instructions to deal with the dependencies issues. I would like to try this out to see how it looks and whether it's stable or not. You can find the version here: http://ftp.gnome.org/pub/gnome/sources/gnome-panel/2.91/


How to install Debian on Acer Chromebook C720?

I did manage to find a set of scripts to install Ubuntu 13.10 onto a Chromebook (see link). However, every hour or so, I get a "System program problem detected" error. This is obviously not very reassuring. How do I install Debian onto a Chromebook? I have heard that it is more stable than Ubuntu.


Optimization for an SSD?

I am running Fedora 20 on a Laptop ( Lenovo Ideapad Yoga 2 Pro ) with an SSD. My filesystem is LVM with ext4 as the format option. I am now running Fedora as the only OS on the system with Legacy BIOS turned on (the system came configured with Secure Boot) and with the entire hard drive reformatted for Fedora. What optimizations should I institute to ensure long, and trouble free, SSD life?


Valley View "Black Screen of Death"

I just got an HP 15-d030nr and installed Mint 16 alongside Win 8.1. My problem is that, without using `nomodeset`, immediately after choosing an option in GRUB, random pixels flash along the top quarter or third of the screen, which then goes blank, and the backlight shuts off. I can enter my password and hear the login sound, so it's still booting, just with no display. I've tried a lot of the solutions to this problem listed for older Intel hardware to no avail. Running `lspci | grep -i vga` gives me `00:02.0 VGA compatible controller: Intel Corporation ValleyView Gen7 (rev 0a)` From what I can tell, Valley View ought to be supported by the kernel (3.11), so I'm pretty lost here. One of my dmesg logs is here. Also, I ran into the same issue trying out Fedora, so it's not Just Ubuntu/Mint.


A window asking me to enter my ssh passphrase is popping up randomly. Why?

I'm on Ubuntu 14.04. For a few weeks now a small window keeps popping up randomly, grabbing my keyboard and asking me to enter the passphrase for my ssh key. The Window's title says "OpenSSH", and it states the path of the private key file it wants to unlock. Of course, I don't do it, because I don't know where this request is coming from. Sometimes, after I hit cancel, a warning window pops up, saying that something might be eavesdropping on my session, because the keyboard could not be grabbed. This sounds very suspicious to me. I can't remember doing anything with ssh that might cause this behavior. How would I go about finding out where these ssh key requests are coming from and how to stop them?


Using in/out named pipes for a TCP connection

I've been fiddling with getting this to work for a while now, so I suspect some sort of fundamental misunderstanding about how pipes work is the root cause of my troubles. My goal is to initiate a TCP connection to some remote host via `netcat` and have two named pipes on the filesystem: one that processes can read from to get incoming data, and other that processes can write to that serve as outgoing data. I am presently using the following construction:               mkfifo in     mkfifo out     cat out | netcat foo.bar.org 4000 > in &      From here, I would like to permit other processes to read and write to/from this open TCP connection. Should this "just work", or is there a reason why a construct like this can't work? What _seems_ to happen at present is that I can read from `out` without issue, but when I write to `in` I get output mentioning a broken pipe and all subsequent communication appears to be dead. Thoughts? (Related: I originally used:               netcat foo.bar.org 4000 < out > in &      but found it to block waiting for input. I'm curious about this as well, but it's probably better addressed in a separate question.)


Collapsing a stream of multiple lines into one line

I have a file containing a a large number of lines, each of which contains a bunch of numbers which are separated by spaces. I process this data in a pipe in some way, and then I want to collapse the multiple lines into a single line of all the numbers separated by spaces. Is there a standard command-line utility I can use to do this? It seems like most line-by-line utilities won't mess with the newlines...


Grub does not recognize password

I'm running Grub .97 with an OpenSuSE 11.2 and Windows XP installation. I configure the grub password in OpenSuSE 11.2 via the `Boot Loader` module. However, when I type in the password in grub, during bootup, I simply get a `Failed` message. I have tried about three or four different passwords. I can boot up, I just can't use the password to edit anything about grub. I have also tried setting the grub password via the command line by typing `grub` to go to the interactive menu, typing `md5crypt`, typing my password, and copying the hashed password to the menu.lst file. Still no luck when I enter the password.


Connect to a remote mysql server with bash php or perl

What is the best and lowest resource way to connect to a remote mysql server (`server1.example.com`) and execute queries like               INSERT into SERVICES (user, id) ($user, $id)      from `server2.example.com`? Is it better/easier to use PHP or Perl rather than Bash? (I want to be able to easily run it from the terminal.) Anyone know a good template script for it?


Cisco router interface connected to PC is up while PC interface is down

I have a following topology:               C2801[Fa0/0] <-> [eth0]PC      According to _Cisco 2801_ router, the interface facing the PC is up:               C2801-A#sh int description     Interface                      Status         Protocol Description     Fa0/0                          up             up       -> PC eth0     Fa0/1                          up             up       -> ME-C3750-24TE-MA Fa1/0/1     C2801-A#      I can verify this with `sh int Fa0/0` command in Cisco router. However, in PC, the eth0 interface is down according to `ip link show` and `ethtool` while the NIC "UP" LED is lit. NIC is using _e1000e_ module. I'm running Debian 7(3.2.0-4-686-pae). Am I correct that with certain kernel modules, Linux is not able to physically shutdown NIC port? Has anybody else seen such behavior?


A command showing if I have the right to perform writing?

I'm searching for a command which only says if the current user has r-rights (read) on the file passed as a parameter. This command could be something like `haveIRights -x <file>` and it has to only return explicitly yes or not. Is there a command like this?


Once the system has been started, is there any advantage in using systemd?

I'm running Gentoo with the default SysV-style OpenRC init system. The boot time is short enough to not bother me. Is there any reason to try systemd?


What does size of a directory mean in output of 'ls -l' command?

What does size of a directory mean in output of `ls -l` command?


What's the size of a folder entry?

> **Possible Duplicate:**   >  What does size of a directory mean in output of 'ls -l' command?               user@~ > ll /tmp/foo     drwxr-xr-x 2 user user 4,0K  1 oct.  15:15 bar      What are those 4,0K ? Is there somewhere an article about them ?


ls -ld /dir, Solaris

Always when I run `ls -ld /dir` the output give me the size = 512 even if there are files in it or not. but when I run `du -sh` the output give me the actual size of the directory including its content.


Can't use my old my.cnf from MySQL 5.5.38 in newer 5.6.19

Ok so I have been trying to upgrade MySQL 5.5 to 5.6. I have been given this set my.cnf file (see below). I was able to uninstall the MySQL 5.5 rpms and install the 5.6. When I reload the back up my.cnf file the mysql server does not want to start. Is there something wrong with this file? I have ran `mysql_install_db`. However, I cannot get the server to start up with my `my.cnf` file. I have looked in the error log, but it hasn't been copying anything recent to it. The `my.cnf` works when it is blank. This is what my `my.cnf` file from MySQL 5.5 looks like (see below). I need this my.cnf file to work on the 5.6 version. Anyone have any incite?               # You can copy this to one of:     # - "/etc/mysql/my.cnf" to set global options,     # - "~/.my.cnf" to set user-specific options.     #     # One can use all long options that the program supports.     # Run program with --help to get a list of available options and with     # --print-defaults to see which it would actually understand and use.     #     # For explanations see     # http://dev.mysql.com/doc/mysql/en/server-system-variables.html     # This will be passed to all mysql clients     # It has been reported that passwords should be enclosed with ticks/quotes     # escpecially if they contain "#" chars...     # Remember to edit /etc/mysql/debian.cnf when changing the socket location.     [client]     port            = 3306     socket          = /u02/mysqldata1/mysqld_3306.sock     #     #     [mysqld_safe]     socket          = /u02/mysqldata1/mysqld_3306.sock     nice            = 0     #     #     [mysqld]     #performance_schema=1     user            = mysql     socket          = /u02/mysqldata1/mysqld_3306.sock     port            = 3306     basedir         = /usr     datadir         = /u02/mysqldata1/data/3306     tmpdir          = /u02/mysqldata/tmp     skip-external-locking     character_set_server    = utf8     lower_case_table_names  = 1     #     # Instead of skip-networking the default is now to listen only on     # localhost which is more compatible and is not less secure.     # bind-address            = 0.0.0.0     max_allowed_packet              = 64M     max_connections                 = 500     max_connect_errors              = 100     max_heap_table_size             = 256M     tmp_table_size                  = 256M     net_buffer_length               = 8K     sort_buffer_size                = 4M     read_buffer_size                = 1M     read-rnd-buffer-size    = 2M     table_cache                     = 1024     table-definition-cache  = 512     thread_stack                    = 256K     thread_cache_size               = 256     sql-mode                        = NO_AUTO_CREATE_USER     query_cache_size                = 64M     query_cache_limit               = 4M     #     # MyISAM Configuration     #     key_buffer_size                 = 512M     myisam_sort_buffer_size         = 128M     ft_min_word_len                 = 3     myisam_recover_options          = BACKUP,FORCE     myisam_repair_threads           = 6     myisam_use_mmap                 = 1     #     # General Logging     #     log_error                       = /u02/mysqldata/mysqllog/3306/err/error.log     long_query_time                 = 1     slow_query_log                  = 1     slow_query_log_file             = /u02/mysqldata/mysqllog/3306/slow/mysql_slow.log     general_log                     = 0     general_log_file                = /u02/mysqldata/mysqllog/3306/general/mysql_general.log     #     # Binary Log and Replication Configuration     #     log_bin                        = /u02/mysqldata/mysqllog/3306/bin/mysql-bin.log     log-bin-index         = /u02/mysqldata/mysqllog/3306/bin/mysql_bin.index     binlog-cache-size     = 256K     binlog_format         = ROW     #binlog_do_db           = include_database_name     #binlog_ignore_db       = include_database_name     relay-log               = /u02/mysqldata/mysqllog/3306/relay/mysql_bin.log     relay-log-index         = /u02/mysqldata/mysqllog/3306/relay/mysql_bin.index     expire-logs-days        = 7     max_binlog_size         = 100M     sync_binlog             = 0     #     # Replication     #     server-id=129206     #log-slave-updates     #replicate-ignore-db = mysql     #replicate-ignore-table=     slave_transaction_retries = 20     #slave-skip-errors = 1062     #auto_increment_increment = 3     #auto_increment_offset = 3               #     # InnoDB Configuration     #          innodb_file_format                      = Barracuda     innodb_file_format_max                  = Barracuda          innodb_data_home_dir                    = /u02/mysqldata1/innodb/3306/data     innodb_log_group_home_dir               = /u02/mysqldata1/innodb/3306/log     innodb_file_per_table     innodb_data_file_path                   = ibdata1:10M:autoextend          transaction-isolation                   = READ-COMMITTED          innodb_flush_log_at_trx_commit          = 0     innodb_log_buffer_size                  = 8M     innodb_log_file_size                    = 512M          innodb_buffer_pool_size                 = 500M     innodb_additional_mem_pool_size         = 128M          innodb_flush_method                     = O_DSYNC     innodb_thread_concurrency               = 0     innodb_lock_wait_timeout                = 60     innodb-open-files                       = 500     innodb-support-xa                       = 0               #     #     # For generating SSL certificates I recommend the OpenSSL GUI "tinyca".     #     # ssl-ca=/etc/mysql/cacert.pem     # ssl-cert=/etc/mysql/server-cert.pem     # ssl-key=/etc/mysql/server-key.pem          [mysqldump]     quick     quote-names     max_allowed_packet      = 128M          [mysql]     #no-auto-rehash # faster start of mysql but no tab completition          [isamchk]     key_buffer              = 1G


Fedora 18 : install input method

I'm using Fedora 18. I choose ibus in input method selector. In ibus, I choose preference to change input method. But I just see english-english method. I cannot choose input method for another language.(there is a dropbox, but all language is blur, but english). So, I don't know how to choose another language. (in my case is japanese and vietnamese). I have tried a command when I google:               yum install scim-lang-japanese      but my terminal notice that this package does not exist. Please teach me, how to add another input method for my language in ibus. thanks :)


How to append multiple lines to a file with bash, with "--" in front of string

Question very similar to How to append multiple lines to a file with bash but I want to start the file with `\--`, and also append to the file, if possible.               printf "--no-color\n--format-doc\n--no-profile\n" >> ~/.rspec-test      The issue is starting the file with "--" gives me a:               -bash: printf: --: invalid option     printf: usage: printf [-v var] format [arguments]      Is there a way to escape the `\--`? Are there any alternatives? I'm not sure how to do multiple lines using `echo`, and `cat` isn't a good option, I'd like to have it in an automated script.


Why are man pages blank for non-root users?

. . . And how can I fix that? :-) I'm running RHEL 5 and when I try to view man pages as a regular user, they are blank. I've tried `man man > manman.txt; cat manman.txt` and there is no output, i.e., the file has no length. I try `sudo man man` and I see beautiful man page output. I've looked at the permissions under /usr/share/man and they look okay. The directories are all o+rwx and the files are o+r. I've tried . . .               [me@host01 ~]$ sudo man -w man     /usr/share/man/en/man1/man.1.gz     [me@host01 ~]$ man /usr/share/man/en/man1/man.1.gz      . . . and that's blank also.


SSH not landing in the home directory

I have recently installed Raspbian into a Raspberry Pi. As part of the installation process I changed the user name and group from the default (`pi`) to my own (let's call it `user`) using `usermod` and `groupmod`. I also moved the home directory (`/home/pi`) to the new user name (`/home/user`) using `usermod`. Everything works fine except that when I login using SSH instead of landing the new user directory (`/home/user`) I end up at the home directory (`/home`). Any idea why this may be happening? Any solution? It's not a big deal but it is confusing me. The directory `/home/user` exists with permissions 755. In addition to that the `/etc/passwd` file contains an entry that looks like the following:               user:x:1000:1000:User:/home/user:/bin/bash      To me everything looks fine, but still when I login from ssh I get a prompt that looks like `user@raspberrypi /home $`.


backup list of installed packages

I want to reinstall my linux system (specifically linux mint). I have kept important data elsewhere, so I can safely remove everything. However, I want to do the following:   1. save the list of packages I have installed so far    2. after reinstall take the backup list and use it to install packages Are there tools that can assist in doing this. I know I can use `dpkg -l` to get list but perhaps I only want the leafs - packages that no other depend on.


Do programs access tools like grep, sed, tr, or sort due to their efficiency?

Or it's meaningful only when you are in the command line and want something simple done right away. Are these tools more efficient than a program library?


Interactive backup tool

I am looking for a backup (or diff) tool where I can select _interactively_ which file I want to copy towards my external hard-disk. Let me explain with further details: I have two computers and an external hard disk. All the disks have (somewhere) the same directory structure and, at some point, the same content. I can modify files/directory structures in any of the two computers. Modify means: - create/delete (on purpose or not)/move new files and dir, - improve or _alter_ some files. So I'm looking for a tool working like `diff`, which shows the differences between two directory trees and _ask_ me what to do (ie, in which direction to copy/remove). `meld` appeared to do it, but its not really efficient with my configuration (~30GB over data), do you have any suggestion?


Grub loading slowly with SSD

Since yesterday, I added a brand new SSD in my PC, and I am experiencing a very fast boot from grub menu. The problem is before arriving to this menu, I must wait for a long time (~30s in most cases). I installed grub on the SSD. After the BIOS, I sometimes see "Grub loading" immediately, sometimes just a blinking cursor, but the time to reach the menu seems to be the same. I tried adding debug=disk (and even debug=all to my grub.cfg), but logs appear only after the unexplained period of time waiting ends. I have 3 disks: - sda, marked as bootable with a windows boot loader on it - sdb, which is the SSD - sdc, which holds the swap partition and a data partition. It had my previous installation of Fedora 18 until yesterday parted description:               Model: ATA ST3250410AS (scsi)     Disk /dev/sda: 250GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos     Disk Flags:           Number  Start   End    Size   Type     File system  Flags      1      32.3kB  250GB  250GB  primary  ntfs         boot               Model: ATA M4-CT128M4SSD2 (scsi)     Disk /dev/sdb: 128GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos     Disk Flags:           Number  Start   End     Size    Type     File system  Flags      1      1049kB  1075MB  1074MB  primary  ext4         boot      2      1075MB  11.8GB  10.7GB  primary  ext4      3      11.8GB  33.7GB  21.9GB  primary  ext4               Model: ATA ST3160827AS (scsi)     Disk /dev/sdc: 160GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos     Disk Flags:           Number  Start   End     Size    Type     File system     Flags      1      1049kB  2149MB  2147MB  primary  linux-swap(v1)      2      52.4GB  160GB   107GB   primary  fat32           lba      When going under Windows (on sda1), I also have unexplained hanging times when shutting down, but this has occurred first one year ago. **EDIT** Unplugging the 250GB drive makes the latency go away. The HDD LED does not blink during the waiting time. What is going on?


Why does the command shuf file > file leave an empty file?

I know this is sort of a duplicate of another question (Why this sort command gives me an empty file?) but I wanted to expand on the question in response to the answers given. The command `shuf example.txt > example.txt` Returns a blank file, because the shell truncates the file before shuffling it, leaving only a blank file to shuffle. However, `cat example.txt | shuf > example.txt` will produce a shuffled file as expected. Why does the pipeline method work when the simple redirection doesn't? If the file is truncated before the commands are run, shouldn't the second method also leave an empty file?


Is it too early to try LibreSSL?

I've been somewhat following the development and recent release of LibreSSL and coincidentally I have a new FreeBSD web server that I've been configuring for my personal/hobbyist projects recently. I'm still fairly n00bish about sysadmin and heavy Unix stuff, though. I see that there's a `security/libressl` port now. If I, a mere sysadmin mortal, were to install it, would I be able to configure Nginx to use it without much more stress than it takes to use OpenSSL (as I've successfully set up a couple of times in the past)? What about other ports which have come to expect OpenSSL? For example, when I go to configure `databases/mariadb55-server`, I get an option to have it use OpenSSL, but not LibreSSL. If I install LibreSSL, will its libraries be seen and used as OpenSSL, or do I have to wait for the MariaDB port to be updated to explicitly support LibreSSL? I guess the broader question is, how interchangeable is LibreSSL with OpenSSL from the perspective of an amateur sysadmin at this point? Should I hold off until LibreSSL is more widely used and expected?


gtk-window-decorator takes up too much memory, and is it safe to restart it?

I would like to restart the `gtk-window-decorator` process, because it takes up 600MB memory. Will that affect other processes? From my experiences, after killing it, all other programs will lose their window frames, but after I run it again, the other programs will have their window frames back, and the `gtk- window-decorator` process will take much less memory. If I rerun it in a shell session in background, I will kill it if I forget about it and accidentally close the shell session. How can I run it like the OS does? I am running Ubuntu 12.04. Thanks.


Software firewall with "zone files"

I am using an automatic deployment system for my new Unix deployments. I have a fairly complicated network topology to implement, and I'm looking for firewall software that makes this easy. In particular, I have noticed that software like nginx follows a pattern in which the main configuration file loads a wildcard, which effectively loads all of the files in some directory. So, for example, nginx loads all of the files in /etc/nginx/conf/ and treats them as configuration files. They can be loaded and unloaded independently by adding or removing them (and issuing an nginx command). Are there any trusted software firewall products that let me do something similar?


Too big delay with xscreensaver on wrong password in OpenSUSE 12.2

There is too big delay when logging in with xscreensaver in OpenSUSE 12.2 --- Actual delay is 10 seconds, but not found anywhere in configs Already done:   * checked pam timeout in _login.defs_ (3 seconds)   * no pam_faildelay.so options in any of `/etc/pam.d/` files   * checked login settings via YaST (uses _login.defs_ so useless)   * played with pam_faildelay.so delay parameter in `/etc/pam.d/login`, `/etc/pam.d/commom-auth-pc` files   * `.xscreensaver` config in `/home/`                   timeout:    0:10:00         cycle:      0:10:00         lock:       True         lockTimeout:    0:00:00         passwdTimeout:  0:00:05         visualID:   default         installColormap:    True         verbose:    False         timestamp:  True         splash:     False         splashDuration: 0:00:05


How to mount an encrypted TrueCrypt partition always in the same point?

I just formatted my external HD and divided it in two partitions: an ext4 where important information will be, and a ntfs for "compatibility" things (i.e. movies, music, etc). I encrypted the ext4 partition with TrueCrypt but now I'm facing a problem I hadn't before: instead of mounting in `/media/DATA/` it is mounting in `/media/truecryptX`, where X is the number of virtual device selected in TrueCrypt. I know that if I always mount the partition as device 1, the mount point will be always `/media/truecrypt1/`, but I would like to have some other point more "meaningful" like `/media/DATA/`. For example the ntfs partition is always mounted as `/media/DATANTFS/` because it isn't encrypted.


DVR software for Linux

I think the DVR/CCTV follow some convention, but most of them use activeX for online access. I'm curious if some documentation/specification exist so I could make my own client (Linux), standalone (C, C++, Py, Java) or in-browser (Java). The ports are known - the DVR settings show them - but the format, PTZ channel, and so on are in deep dark. Could someone point to a (open/free) documentation, or an opensource app to use it as a start?


Installing linux-3.14.8 un Arch Linux while 3.15 is already in testing

I'm currently running kernel 3.14.6 on Arch Linux from Core repo. I would like to install 3.14.8 (which is the latest of 3.14 series) because it contains a fix that is suitable for me. However linux package in Arch Linux core repo is still at 3.14.6 and it has been marked as out-of-date as in testing we already have 3.15. So this tells me that 3.14.8 will never land in arch linux repo... is there a way to get pre compiled 3.14.8 (64 bit) to install in Arch Linux without having to build it from source? Thanks


Docker - Force to Use AUFS Instead of BTRFS

I am having significant problems using Docker on my BTRFS filesystem, and I suspect that is due to a lack of stability with the BTRFS driver. I would rather figure out how to switch the fs driver than ask multiple questions about the problems I have been having. Originally it would fill my hard drive with about 4 builds of any Dockerfile and deleting images and containers would not help (and this is with ~80GB of space left); I also had to delete BTRFS subvolumes from `/var/lib/docker/btrfs/subvolumes`. Now I have a still-more- annoying problem where no images can be pulled because a file or directory exists (in a location which is completely removed first). So because these problems have been so cryptic and un-Googleable, I'd like to just force the driver to be AUFS. How do I go about doing this? I am using 64-bit Arch Linux. Any guidance or pointers in the right direction would be greatly appreciated.


how to set and use multiple parameters in single environmental variable in fish shell

I want to use following in `fish` shell:               $ export arm='ARCH=arm CROSS_COMPILE=arm-eabi-'     $ make $arm       This works fine in `bash/zsh` but _not_ on `fish` shell. But if I execute the following in `fish` shell:               $env tmp=arm make      this works fine. Can someone please help me with this?


How do I pg_upgrade my database on Arch Linux?

I was running postgres 8.4 on arch but now have 9 installed I want to use `pg_upgrade` to upgrade but I don't know what all the options I have to use are, and all the directories that I have to point it to. I think it asks for a previous pg binary directory... but that's gone. Will it still work? I've no important data, just play db's I just want to know how to do it. I also realize this is borderline serverfault, but I feel it has as much to do with arch's install process and paths, so I thought I'd ask here.


Is there a way to dynamically refresh the less command?

I like the `watch` command, but it has its limitations. I'm curious to know whether I could mimic the functionality of `watch` with `less`. I'm mainly looking for the ability to scroll through my directory as it dynamically gets modified via a running script.


git archive fatal: Operation not supported by protocol

I can do `git clone` like so ...                git clone https://github.com/stackforge/puppet-heat.git      ... with no problems. But I want to exclude all the git meta stuff that comes with the cloning, so I figured I would use `git clone` but I get this error:               $ git archive --remote=https://github.com/stackforge/puppet-heat.git      fatal: Operation not supported by protocol.      Anyone know why or what I am doing wrong?


Yum update crashing my OpenVPN tunnels

I have 100's of CentOS 5.10 clients that I access through a OpenVPN connection. I have internal repo that they use for updates. However some of my clients have some serious issues pulling packages from the internal repo. I have time out issues on some clients while running "yum repolist", also I have tried to run "yum -y update" on a few of these clients and watched the OpenVPN tunnels just fall apart, only to re-establish a connection later. What could be going on here? Is yum being greedy with bandwidth?


Yum not working

When I try to execute yum I get this: ![enter image description here](http://i.stack.imgur.com/q8VIm.png) My guess is I need to start the Ethernet connection because I cant ping and this is what what we do with SL6. I'm new to CentOS that is why I ask. I've already run `service start network` but it still does not work. ### UPDATE #1 Here's the output from `ifconfig`.           ![ss of ifconfig output](http://i.stack.imgur.com/bUXj2.png)


What's the difference between "realpath" and "readlink -f"

I've read a lot about `realpath` command and how it has been deprecated with the `readlink -f` being now recommended. I have also seen in some places that the reason why realpath was introduced was for the lack of such functionality in readlink and that once it has been introduced, realpath was no longer needed and its support discontinued by most OS vendors. The reason for my question is that I've also seen many people recommending `readlink -f` as a command "pretty much similar" to `realpath`, and that is what is bothering me, because no one elaborates on that "pretty much similar" part. What are the actual differences?


Why do I need 3 git repositories for ikiwiki if I want to commit locally

If I have a local ikiwiki on my laptop I need a "repository" directory (`mywiki.git` - a bare repository), a "scrdir" (`myiki` a git repository) and a place where the produced html files go ("destdir") to run it properly from a web browser locally. However if I also want to work with a text editor and git on the command line I need to setup a third git repository say `mywiki.local` ("working clone"). Which puhes to `mywiki.git` which in turn triggers a `post-update` hook to push to the scrdir and rebuild the html pages, as illustrated in the following picture: ![Workflow](http://i.stack.imgur.com/NGdVR.png) With this approach, I need **three** almost identical directories on my laptop just to run one wiki, i.e. it occupies three times the disk space instead of just once. What is the reason behind this? Is there a safe way to circumvent this if you are just working on one machine, to reduce it to just two or even better one directory?


Creating yum .repo file from a remote repo using rpm

This command (from the install page for Varnish 3.x):               rpm --nosignature -i http://repo.varnish-cache.org/redhat/varnish-3.0/el6/noarch/varnish-release/varnish-release-3.0-1.el6.noarch.rpm      appears to generates `varnish.repo` in `/etc/yum.repos.d/` containing               [varnish-3.0]     name=Varnish 3.0 for Enterprise Linux el6 - $basearch     baseurl=http://repo.varnish-cache.org/redhat/varnish-3.0/el6/$basearch     enabled=1     gpgcheck=0     #gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-VARNISH      I'm looking at configuring a local rpm package server, and wondering how this can be setup? The `.rpm` file above is binary, `-i` implies " _Display package information ..._ " and `\--nosignature` implies " _Don’t verify package or header signatures when reading_ ", and I'm unclear how or what generates the `varnish.repo` file. The man page for `rpm` does not have a reference to `.repo` and I'm not sure what this function/parameter is called.


simple question: "need a way to proxify a port" I have a linux server and have a proxy server on another machine. My linux server needs connect to port 'x' on ip 'y' Is it possible to create iptables rule or another way to: when my linux server tries to connect to port 'x' on ip 'y' uses my proxy server on another machine? In other words, I need to my server's ip changes when it needs to connect port 'x' on ip 'y' by using another proxy server machine.


How to install latest catfish in ubuntu 10.04

I was trying to install the **latest** catfish from https://launchpad.net/catfish-search/+download on my Ubuntu 10.04 (need this version at the moment, nothing more recent) The version in apt-get for Ubuntu 10.04 is not sufficient for me at the moment. Unzipping the archive and doing what is described in the INSTALL file. but when trying to launch catfish, the following appears:               :~$ catfish     Traceback (most recent call last):       File "bin/catfish.py", line 24, in <module>         from gi.repository import GObject     ImportError: No module named gi.repository      So I tried to install http://packages.ubuntu.com/precise/python3-gi but I can't find this via `aptitude` or `synaptic`. What to do?


How to change encoding from Non-ISO extended-ASCII text, with CRLF line terminators to UTF-8?

I have a txt file :               $ file -i x.txt     x.txt: text/plain; charset=unknown-8bit     $ file x.txt      x.txt: Non-ISO extended-ASCII text, with CRLF line terminators      And there are some characters that are incorrectly encoded :               trwa³y, sta³y, usuwaæ      How can I change this file's encoding to UTF-8 ? I have tried the following way so far :               $ iconv -f ASCII -t UTF-8 x.txt                     puiconv: illegal input sequence at position 4      Maybe I should somehow use `extended ASCII` ( `high ASCII` ) but cannot find it in `iconv`'s encoding list.


How do I interpret an entry about cron in Gnome System Log Viewer

Apologies if this turns out to be a trivial question. I am trying to set up a regular backup of my files prior to installing Fedora 19 instead of my current Fedora 12. In November 2013 I started a trial, backing up some small files into my home directory as a first test that I had got it right. This has happily done this backup every three days ever since (I didn't want to wait too long to see if it worked). I have now bought an exterior drive for the backups, and want to test the scheme again in the same way on to the new drive, before I commit all my files to it. The problem is that I cannot remember how I set up the schedule -- it must have seemed so obvious then that I did not make any notes. This is the relevant entry in my Gnome System Log Viewer for cron for the latest backup: Jan 7 16:56:01 SN031568820668 CROND[7361]: (Harry) CMD (/home/Harry/fredx.sh #JOB_ID_2) So my question is: please how do I interpret this and does this give any clue as to how to set it up? If not, how should I go about it? This is the content of fred.x:               #!/bin/sh     DISPLAY=:0.0     testrsync/trial_bak.sh      And this is what is in trial_bak.sh, edited to suit the external drive, I hope:               #!/bin/bash     # Adated from: http://webgnuru.com/linux/rsync_incremental.php     #  Website Backup Script     #======================================================================     # Define Variables     # Todays date in ISO-8601 format e.g. 2013-10-19:     DAY0=`date -I`      # Yesterdays date in ISO-8601 format:     DAY1=`date -I -d "1 day ago"`     # The source directory:     SRC="/home/Harry/testrsync/bravo/"     # The target directory:     #TRG="/home/Harry/testrsync/backups/$DAY0"     TRG="/media/CA6C321E6C32062B/$DAY0"     # The link destination directory:     #LNK="/home/Harry/testrsync/backups/$DAY1"     LNK="/media/CA6C321E6C32062B/$DAY1"     #The rsync options:     OPT="-avh --delete --link-dest=$LNK"     #======================================================================     #Execute the backup     rsync $OPT $SRC $TRG     #Delete old backups cyclically     # for my tests I am going to use a three day cycle     DAY4=`date -I -d "4 days ago"`     #Delete the backup from 4 days ago, if it exists     if [ -d /home/Harry/testrsync/backups/$DAY4 ]     then     rm -r /home/Harry/testrsync/backups/$DAY4     fi     zenity --info --text='Backup complete' --title="Backup Test"      I think the zenity line does not do anything. Here is a listing of the /home/Harry/testrsync/backups directory: 2013-11-02 2013-11-13 2013-11-26 2013-12-11 2013-12-27 2014-01-05 2013-11-03 2013-11-19 2013-12-02 2013-12-18 2013-12-29 2014-01-06 2013-11-05 2013-11-20 2013-12-10 2013-12-21 2014-01-04 2014-01-07


Log files corrupted with NUL characters and text from other processes

I am running Wind River Linux 4.3 on an embedded Freescale single board computer (SBC). Output from `uname -a`:               Linux ge101 2.6.34.10-myname-grsec-WR4.3.0.0_cgl #1 SMP PREEMPT Mon Aug 26 01:35:35 PDT 2013 ppc ppc ppc GNU/Linux      There are several modules / processes running and creating log files that I am interested in collecting:   1. A kernel module logging to /var/log/messages   2. A userspace application which is having its stdout redirected to a log file. This application is automatically started upon bootup by an init.d script. The script does this by the following: `nohup ${executable_name} -C ${configfile_name} >> ${logfile} 2>&1 &`   3. This same userspace application writes other data to a separate file on the SBC's filesystem.   4. A Python script using the `logging` module to write to a log file. I am seeing a bizarre problem where these 4 log files occasionally are "corrupted" in the following way:   * Anywhere between 78-309 NUL characters are inserted into the log file   * Text from another log file (40 or so lines) gets inserted into it   * When this happens, there is a chunk of data missing from the log file Additionally, there are some instances where only the NUL characters are inserted, and no text from other logs gets intermingled in. In a log file on the order of 100k lines, this behavior occurs 7-9 times. The NUL characters by themselves would be fairly easy to remove during post- processing. However, the unexpected data showing up from other files is breaking parsing scripts. And of course, the missing chunk of data is the most troublesome. Does anyone know what might cause this bizarre behavior to occur?


search fitting ipv6 address for MAC-Address in neighbours

I have a list of possible to ip6 addresses converted MAC-addresses, that could be found in the output of               ping6 ff02::1%wlan0      possible mac addresses are for example:               66:70:02:75:80:fe, 64:70:02:74:80:fe, 66:70:02:74:80:ff      each of them would lead to a Link-local ip6 address beginning with `fe80::` and inserted `FF:FE` in the middle so `66:70:02:75:80:fe` would lead to `fe80::6670:2ff:fe75:80fe` I would like to create a script that gives out the matching LinkLocal address for a list of MAC adddresses like:               $ find-in-macs 66:70:02:75:80:fe 64:70:02:74:80:fe 66:70:02:74:80:ff      and the output:               matching IP6: fe80::6670:2ff:fe75:80fe      that script `find-in-macs` could look like this:               #!/bin/bash     mac_to_ipv6 () {       IFS=':'; set $1; unset IFS       ipv6_address="fe80::$(printf %02x $((0x$1 ^ 2)))$2:${3}ff:fe$4:$5$6"       echo $ipv6_address     }               for i do         echo checking $i         ping6 ff02::1%wlan0|grep mac_to_ipv6 $i     done


Vim powerline with broken encoding

I trying to learn using vim, I am enjoining a lot, but I copied the vimrc from github and I would like to understand what is causing the break of powerline encoding. .![Snapshot of my vim](http://i.stack.imgur.com/jmnKa.png)   1. In the vimrc file I have: `set encoding=utf-8`   2. I cleared the PowerLine cache   3. My vim version doesn't show the `\--with-features=big` flag. Could this be the problem and if yes, how can I fix it?


how to loop through arguments in a bash script

I would like to write a bash script with unknown amount of arguments. How can I walk through these arguments and do something with them? A wrong attempt would look like this:               #!/bin/bash     for i in $args; do          echo $i     done


Convert MAC address to Link-local address with bash

How can I convert a Mac address into an ipv6 Link-Local address? you have to add `fe80::` at the start and insert `ff:fe` in the middle furthermore all leading zeros must be stripped


How similar are Android and QNX?

The root of the question is really: "Can you run the Android OS on a BlackBerry PlayBook?" Since one is a Linux derivative and the other is a Unix derivative, it seems a natural fit for here.


rm -rf all files and all hidden files w/o . & .. error?

`rm -rf /some/path/*` deletes all non-hidden files in that dir (and subdirs). `rm -rf /some/path/.*` deletes all hidden files in that dir (but not subdirs) and also gives the following error/warning:               rm: cannot remove directory: `/some/dir/.'     rm: cannot remove directory: `/some/dir/..'      What is the proper way to remove all hidden and non-hidden files and folders recursively in a target directory and also not receive the warning/error about `.` and `..`?