Mouse pointer stuck as I login

I am facing this problem,and I don't know I dig into it. As I log into Ubuntu my mouse pointer get stuck. I have tried the following methods:               sudo apt-get update     sudo apt-get upgrade      I have also tried this:               sudo apt-get install -f     sudo dpkg --configure -a     sudo apt-get install -f      Also, lots of other methods. But none works for me. Please guide me how I can restore my pointer. I don't face this problem when I log in as a Guest user in Ubuntu, also my mouse starts moving when I attach an external USB mouse.   This is output of my lsmod command                   haider@ubuntu:~$ lsmod | sort          arc4                   12473  2          bcma                   25651  0          binfmt_misc            17292  1          bluetooth             158447  10 rfcomm,bnep         bnep                   17830  2          brcmsmac              540923  0          brcmutil               14675  1 brcmsmac         cfg80211              178877  2 brcmsmac,mac80211         cordic                 12518  1 brcmsmac         crc8                   12781  1 brcmsmac         dcdbas                 14098  1 dell_laptop         dell_laptop            17767  0          dell_wmi               12601  0          drm                   197641  4 i915,drm_kms_helper         drm_kms_helper         45466  1 i915         hid                    77428  1 usbhid         i2c_algo_bit           13199  1 i915         i915                  428056  8          intel_ips              17822  0          joydev                 17393  0          lp                     17455  0          mac80211              436493  1 brcmsmac         mac_hid                13077  0          mei                    36570  0          Module                  Size  Used by         parport                40930  3 parport_pc,ppdev,lp         parport_pc             32114  0          ppdev                  12849  0          psmouse                86520  0          r8169                  56396  0          rfcomm                 38139  0          serio_raw              13027  0          snd                    62218  16 snd_hda_codec_hdmi,snd_hda_codec_idt,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device         snd_hda_codec         109562  3 snd_hda_codec_hdmi,snd_hda_codec_idt,snd_hda_intel         snd_hda_codec_hdmi     31775  1          snd_hda_codec_idt      60251  1          snd_hda_intel          32719  3          snd_hwdep              13276  1 snd_hda_codec         snd_page_alloc         14108  2 snd_hda_intel,snd_pcm         snd_pcm                80916  3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec         snd_rawmidi            25424  1 snd_seq_midi         snd_seq                51592  2 snd_seq_midi,snd_seq_midi_event         snd_seq_device         14172  3 snd_seq_midi,snd_rawmidi,snd_seq         snd_seq_midi           13132  0          snd_seq_midi_event     14475  1 snd_seq_midi         snd_timer              28931  2 snd_pcm,snd_seq         soundcore              14635  1 snd         sparse_keymap          13658  1 dell_wmi         usbhid                 41937  0          uvcvideo               67203  0          video                  19115  1 i915         videodev               86588  1 uvcvideo         wmi                    18744  1 dell_wmi


Get row data for non-matching column values

I want to read the file (1600 rows) and get rows only the columns have different values (sno1, sno2, sno3 & sno4-should be not be equal value) and it should be above 50%.The example of output given below **input.txt (tab-delimited)**               id sno1 sno2 sno3 sno4     R1 98.4 88.8 98.4 67.6     R2 100  100  100  100     R3 33.4 23.5 98.8 45.5     R4 53.5 78.7 88.8 67.5     R5 0    0    0    0     R6 88.8 98.8 67.6 100      **ouput.txt**               R4 53.5 78.7 88.8 67.5     R6 88.8 98.8 67.6 100      Here in R4 & R6 rows- all column values have not equal to each other and all are above 50%. Any help in awk/sed/perl is appreciated.


How to recover most recently deleted directories on NTFS partition

In Nautilus under Ubuntu 12.04, I accidentally selected several directories on a partition and deleted them at once (unfortunately, I deleted them by Shift+Delete such that they don't remain in Trash). I haven't written any new data to that partition yet since the deletion. I wonder what ways I can try to recover them? Note that the partition is NTFS, shared between Windows 7 and Ubuntu 12.04. Following is different software that I have tried so far.   1. I have also tried to use Sleuthkit, but I cannot figure out how to use it. I have been running `sudo fls -f ntfs -d -r -p /dev/sda3 > ~/deleted_files.txt` for almost a week on my 110GB 96%-used ntfs partition. It hasn't finished running yet (don't know when it will), and the file `~/deleted_files.txt` is still empty. All my work has been stalled since I don't dare to write any data to the partition. Now I wonder if my usage of sleuthkit is the quickest way to identify most recently deleted directories and files in my case?   2. I installed TestDisk 6.13 via apt-get install, and followed http://www.cgsecurity.org/wiki/Undelete_files_from_NTFS_with_TestDisk to recover the deleted directories and the files in them. But what is shown by TestDisk is not the deleted file/directory names as shown in the picture in the link, but files named by inode numbers:              TestDisk 6.13, Data Recovery Utility, November 2011     Christophe GRENIER <grenier@cgsecurity.org>     http://www.cgsecurity.org      3 P HPFS - NTFS           9291  38 28 23650 187 25  230686720 [Data]     Deleted files          >inode_13285                           30-Jan-2011 20:55     29427      inode_13285:Zone.Identifier           30-Jan-2011 20:55        26      inode_164258                          11-Aug-2011 13:16      2993      inode_307016                          12-Feb-2011 09:34      1808      inode_307017                          12-Feb-2011 09:34     10254      inode_307018                          12-Feb-2011 09:34     13155      inode_307019                          12-Feb-2011 09:34      7586      inode_307020                          12-Feb-2011 09:34      7344      inode_307021                          12-Feb-2011 09:34      6943      inode_307022                          12-Feb-2011 09:34      6081      inode_307023                          12-Feb-2011 09:34     24043      inode_314965                          12-Feb-2011 09:36    112947      inode_314983                          12-Feb-2011 09:36     23581      inode_314984                          12-Feb-2011 09:36      8486      inode_314985                          12-Feb-2011 09:36       158      inode_314986                          12-Feb-2011 09:36        45                                                        Next     Use : to select the current file, a to select/deselect all files,         C to copy the selected files, c to copy the current file, q to quit      When I hit `a` and then `C` to select and copy all the selected files, files named `inode_xxxxxx` will be copied to a directory that I specify. Also, I don't know the meaning of the date and time for each file shown by TestDisk. Does it mean the deletion date and time or last update date and time before deletion? (Note the most recent date and time shown by TestDisk is 30-Jul-2012 20:53, which is not today when the accidental deletion happened.) How can I figure out which files are my most recently deleted ones, and how can I recover them? Can I find out and recover my most recently deleted directories instead of just files?   3. I am also curious to know if these two links to How-to really work? In http://www.ehow.com/how_5202235_retrieve-deleted-files-linux.html, `grep -b 'search-text' /dev/partition > file.txt` is used to search for the deleted files. In http://www.ehow.com/how_7517984_restore-overwritten-file-linux.html, the "Isdel" command is used. What other software can I try besides TestDisk and Sleuthkit?


Git do not overwrite symlinked directory on branch checkout

How can I make directory read-only with git? The situation is - in project, I have a symlink to shared framework. I don't want it to be overwritten/changed in any way (not even mtime or atime). How can I do that - or am I viewing the thing from wrong perspective?


Encrypt a password the same way mysql does

I've created a user ... but forgotten the password               mysql> create user 'blayo'@'%' identified by 'right';      Which Linux command line tool can **encrypt the password the same way mysql 5.5 does ?**               mysql> select Password,User from mysql.user     ------------------------------------------+-------+     *920018161824B14A1067A69626595E68CB8284CB | blayo |      ...to be sure I use the right one               $ tool right     *920018161824B14A1067A69626595E68CB8284CB


GNU Screen does not work when su'ing from root to a normal user

Is it normal, that when I am logged in as root, and the used `su user`, I can't access that users screen sessions? In this case, screen complains about it not having permissions on `/dev/pts/x`. I assume that it can't control the terminal which was opened as root in the way it needs: am I right?


Why is Linux commonly used as operating system for supercomputers?

As of november 2010, Linux is used on 459 out of the 500 supercomputers of the TOP500. What are the reasons behind this massive use of Linux in the supercomputer space?


GRUB File Not Read Correctly

I was installing Gentoo when I ran into problems with the bootloader. Whether I used the automatic or manual installation method, GRUB always threw the following error: `The file /boot/grub/stage1 not read correctly.` I checked out the file with `nano`, but it was mostly unreadable and garbled as if it were using the wrong character encoding. All the other files in that directory suffered the same fate. Are these files supposed to be human-readable? Will the problem fix itself if I try installing again? If not, what can be done to correct it?


What is Dom0 and how can one use it?

I have heard that Xen is now fully included into mainline Linux, and is usable via Dom0. Bare with me: I'm no expert on virtualization, let alone virtualization _on Linux_. What is Dom0, what is its purpose? How can one use it?


Choosing virtual machine software on Linux

There are many virtual machine software out there. Even some are included into mainline Linux. What differentiates them, and what criteria should one ponder while choosing one?


Fail to install perf on slackware 13.1

I was trying to install perf on slackware 13.1 When I first ran make at /usr/src/linux/tools/perf I got some errors. And I found this patch http://www.valimar.it/repo/linux/perf_fix-2.6.33.patch And when I ran make again, it issued some different errors as below. But I've already installed perl package perl-5.10.1-i486-1               libperf.a(trace-event-perl.o): In function `define_flag_value':     /usr/src/linux-2.6.33.4/tools/perf/util/trace-event-perl.c:125: undefined reference to `Perl_push_scope'     /usr/src/linux-2.6.33.4/tools/perf/util/trace-event-perl.c:126: undefined reference to `Perl_save_int'     /usr/src/linux-2.6.33.4/tools/perf/util/trace-event-perl.c:129: undefined reference to `Perl_newSVpv'     /usr/src/linux-2.6.33.4/tools/perf/util/trace-event-perl.c:129: undefined reference to `Perl_sv_2mortal'     /usr/src/linux-2.6.33.4/tools/perf/util/trace-event-perl.c:130: undefined reference to `Perl_newSVpv'     /usr/src/linux-2.6.33.4/tools/perf/util/trace-event-perl.c:130: undefined reference to `Perl_sv_2mortal'     /usr/src/linux-2.6.33.4/tools/perf/util/trace-event-perl.c:131: undefined reference to `Perl_newSVuv'     /usr/src/linux-2.6.33.4/tools/perf/util/trace-event-perl.c:131: undefined reference to `Perl_sv_2mortal'     /usr/src/linux-2.6.33.4/tools/perf/util/trace-event-perl.c:132: undefined reference to `Perl_newSVpv'     /usr/src/linux-2.6.33.4/tools/perf/util/trace-event-perl.c:132: undefined reference to `Perl_sv_2mortal'     /usr/src/linux-2.6.33.4/tools/perf/util/trace-event-perl.c:135: undefined reference to `Perl_get_cv'     /usr/src/linux-2.6.33.4/tools/perf/util/trace-event-perl.c:136: undefined reference to `Perl_call_pv'     /usr/src/linux-2.6.33.4/tools/perf/util/trace-event-perl.c:139: undefined reference to `Perl_free_tmps'     /usr/src/linux-2.6.33.4/tools/perf/util/trace-event-perl.c:132: undefined reference to `Perl_stack_grow'     /usr/src/linux-2.6.33.4/tools/perf/util/trace-event-perl.c:131: undefined reference to `Perl_stack_grow'     /usr/src/linux-2.6.33.4/tools/perf/util/trace-event-perl.c:130: undefined reference to `Perl_stack_grow'     /usr/src/linux-2.6.33.4/tools/perf/util/trace-event-perl.c:129: undefined reference to `Perl_stack_grow'     /usr/src/linux-2.6.33.4/tools/perf/util/trace-event-perl.c:127: undefined reference to `Perl_markstack_grow'


Remove files older than 5 days in UNIX (date in file name, not timestamp)

I want to delete log files which are older than 5 days from a directory. But deletion should not be based on the timestamp of file. It should be based on the name of file. For Example todays date is 07/05/2012 and the directory contains 10 files of names like `ABC_20120430.log`, `ABC_20120429.log`, `ABC_20120502.log`, `ABC_20120320.log` etc. I want to be able to remove the files by extracting the date from the name of the file.


Changing CIFS permissions on FreeNAS?

I'm trying to change some permissions on a folder. I'm running FreeNAS and using the windows permissions settings (not Unix). If I right click the file and go to properties and then security, it shows that the only person who can make changes is the: root(Unix user\root). **NOTE:** For obvious reasons I can't login to the windows share using the root user. So how would I go about changing the settings to allow my account to change the permissions?


Prevent active file removal on an NFS filesystem

I clear my logs using following script -               find "." -mtime 1 -type f -print0 | xargs -0 rm -rf      But it deletes the active files also and creates `.nfs…` files instead. Is there any way to prevent deletion of active files?


SMART extended offline test validity

Is it possible for the `smartctl -t long /dev/sda` to complete without error and still the drive fail? How detrimental to the disk's life expectancy is running the test daily/weekly? Thanks!


What is "system time" when using "time" in command line

Im using `time` to time a `Perl` script on standard terminal in Ubuntu 14.04. I have read that `real time` is stopwatch time; the time I, as a user, is spending looking at the program running from I start the program until it terminates. But I don't get what `user` or `sys` times are. The man page on `time` is vague, to say the least. While it is somewhat clear that the `real` time is split between `user` and `sys` it is not clear what they represent. In my script I'm benchmarking[1] C++ and Perl against each other to see the difference, and I would like to know what data I'm actually getting. An example output is:               real    0m24.198s     user    0m23.120s     sys     0m1.030s      Could someone please elaborate what the default format of time is telling the user? I'm a novice into Linux, so please don't assume too much. [1] Interestingly, while C++ is way, way faster than Perl in my benchmark with regards to `real` time, the `sys` times doesn't differ that much, with C++ actually using more `sys` time than Perl. This is why I want to know what they mean


Why is Aircrack-ng able to read and use a .lst file that Leafpad couldn't in a reasonable time?

To make myself a little more clear: I tried opening a .lst file (password list) in Kali Linux. The system was struggling to handle it and Leafpad didn't even start, but I noticed a significant performance difference. I ended up just hard rebooting. When I open the password list with Aircrack-ng to crack a password, Aircrack- ng is able to use the password list just fine. What makes Aircrack-ng more suitable to handle this large lst file without significantly impacting my laptop's performance? Is it the way Aircrack-ng reads the lst file?


Can I make text in xterm looks and feels like gnome-terminal?

![enter image description here](http://i.stack.imgur.com/Gmq1o.png) The picture on top you can see my xterm, the picture under is the gnome- terminal. Ok This is what I want to get: I use the same font in both but looks different:               Xterm*faceName: DejaVu Sans Mono Bold:size=11:antialias=true      how can I fix this?


Keeping multiple root directories in a single partition

I'm working out a partition scheme for a new install. I'd like to keep the root filesystem fairly small and static, so that I can use LVM snapshots to do backups without having to allocate a ton of space for the snapshot. However, I'd also like to keep the number of total partitions small. Even with LVM, there's inevitably some wasted space and it's still annoying and vaguely dangerous to allocate more. So there seem to be a couple of different options:   * Have the partition that will contain bulky, variable files, like `/srv`, `/var`, and `/home`, be the root partition, and arrange for the core system state — `/etc`, `/usr`, `/lib`, etc. — to live in a second partition. These files can (I think) be backed up using a different backup scheme, and I don't think LVM snapshots will be necessary for them.   * The opposite: putting the big variable directories on the second partition, and having the essential system directories live on the root FS. Either of these options require that certain directories be pointers of some variety to subdirectories of a second partition. I'm aware of two different ways to do this: symlinks and bind-mounts. Is one better than the other for this purpose? Is there another option? Do some linux distros support installation using this style of partition layout?


How do I delete a file named "°" in bash

I've accidentally created a file named `°`. Now I'm having trouble deleting it with bash.               [/opt/etc/sudoers.d] # ls -l     -r--r-----    1 admin    administ       21 Feb  3 23:54 010-root     -rw-r--r--    1 admin    administ       20 Feb  3 23:50 °      Typing `rm °` seems to only move the caret to the beginning of the line, i.e. no character is entered. (For what it's worth I'm running bash 3.2.0 on a remote machine conntected with SSH using Mac OSX Terminal) Any ideas?


Need for thread_info structure in Linux 2.6 Kernel

Prior to the Linux 2.6 kernel, `struct task_struct` was present at the end of the kernel stack of each process. There was no `thread_info struct` concept. But in Linux 2.6 kernel, instead of `task_struct` being placed at the end of the kernel stack for the process, the `thread_info struct` is placed at the end. This thread_info struct contains a pointer to the `task_struct` structure. What was the need for `thread_info` structure to be introduced ?. We could have accessed the `task_struct` structure using the `stack pointer` directly if `task_struct` was placed at the end of the kernel stack of the process. In 2.6 Kernel, `task_struct` is dynamically allocated using `slab_allocator`. Prior to 2.6 Kernel, was it statically allocated?


feeding input values to dpkg-reconfigure in non-interactive way

I would like to configure ubuntu package via dpkg-reconfigure with all the values supplied via non-interactive mode (in the script). In fact my case is firebird confiiguration (http://www.firebirdsql.org/manual/ubusetup.html), that when using command:               sudo dpkg-reconfigure firebird2.5-superclassic -freadline      asks me for the 2 values, where answers would be 'Y' and 'newpwd' . Sample output looks like this:               sudo dpkg-reconfigure firebird2.5-superclassic -freadline      * Firebird 2.5 superclassic server not running     Configuring firebird2.5-superclassic     ------------------------------------          Accept if you want Firebird server to start automatically.          If you only need the Firebird client and there are no databases that will be served by this host, decline.          Enable Firebird server? Y               Password for firebird 2.5     -------------------------          Firebird has a special user named SYSDBA, which is the user that has access to all databases. SYSDBA can also create new databases and users. Because of this, it      is necessary to secure SYSDBA with a password.          The password is stored in /etc/firebird/2.5/SYSDBA.password (readable only by root). You may modify it there (don't forget to update the security database too,      using the gsec utility), or you may use dpkg-reconfigure to update both.          To keep your existing password, leave this blank.          Password for SYSDBA:                 * Starting Firebird 2.5 superclassic server...        ...done.      * Firebird 2.5 superclassic server already running      I've tried `here strings` via bash script like this:               sudo dpkg-reconfigure firebird2.5-superclassic -f readline << EOF     Y     newpwd     EOF      However this didn't work for some reason and it asked for the values to be supplied. Any ideas how to feed the required values to script? Thanks.


Install specific version of X11 for xmonad?

I wanted to compile `xmonad` from source, so I checked out the code and ran the first command from the `README`.               $ runhaskell Setup.lhs configure --user --prefix=$HOME     Configuring xmonad-0.12...     Setup.lhs: At least the following dependencies are missing:     X11 >=1.5 && <1.7      Apparently haskell wants a specific version of `X11`. This kind of scares me, as whenever I touch video-specific items like `Xorg` or video drivers, I tend to completely bork my system.   1. Is it safe to install a specific newer version of `X11`?   2. How would I do so? Is it possible to use `apt-get`?


How do I fix "make: No rule to make target `config'"?

I am very new to Linux, running Mint 15. When I type `make config` in the terminal, the system responds with:               make: *** No rule to make target `config'.  Stop.      Any idea how to fix that problem?


parted: create new partition

I have a 3TB disk, and I understand I have to use `parted` if I want to create a partition bigger than 2TB. All right then.               parted /dev/sdb          (parted) mklabel gpt          (parted) mkpart primary                                               File system type?  [ext2]?      Say what? It does not let me to create a partition without specifying a FS type. Why does `parted` insist on specifying a FS type. AFAIU, a FS type is completly independent from a partition. In `man parted`, I read that:               fs-type can be one of "fat16", "fat32", "ext2", "linux-swap", or "reiserfs".      I don't want any of these. I want to create a partition to be used as LUKS partition. What should I select?


How is upstart's socket activation used?

Upstart has gained the ability to start a process after a socket is accessed, but I found the feature to be poorly documented. How is a socket-activated daemon and upstart config written?


How to get rid of power failure problems while using Linux?

I am using Linux. My daily working directory is present on a VFAT partition of my disk. Always I mount it and do my work. When power failure happens this directory sometimes gets corrupted and 'file saving' or 'file removal' results in an error "read-only file system'. After 2-3 unmount/mount the problem goes away. But, mostly I loose some _saved_ and unsaved changes that I have done to my files. How to get rid of such power failure problems? Very much surprised that my bios setting also getting changed sometimes, including date time! Don't know how to get rid of this as well.


Installing OpenGL on LMDE

I can't install OpenGL on LMDE, I always get errors like this: "The following packages have unmet dependencies: freeglut3-dev : Depends: libgl1-mesa-dev but it is not going to be installed" I think the problem might be with the installation of the Nvidia driver but I don't know... I can't install Steam, Wine, Virtualbox. I've been searching for solutions and trying things for hours, can anyone help me please? Edit: freeglut3 installed correctly but I'm having some trouble with freeglut3-dev, I've tried solving it with synaptic but it didn't work...               sudo apt-get install freeglut3-dev          The following packages have unmet dependencies:      freeglut3-dev : Depends: libgl1-mesa-dev but it is not going to be installed or                               libgl-dev                      Depends: libglu1-mesa-dev but it is not going to be installed or                               libglu-dev                      Depends: libxt-dev but it is not going to be installed     E: Unable to correct problems, you have held broken packages.      And when trying to install steam:               The following packages have unmet dependencies:      libgl1-mesa-dri:i386 : Depends: libdrm-intel1:i386 (>= 2.4.27) but it is not going to be installed                             Depends: libdrm-nouveau1a:i386 (>= 2.4.23) but it is not going to be installed                             Depends: libdrm-radeon1:i386 (>= 2.4.17) but it is not going to be installed                             Depends: libdrm2:i386 (>= 2.4.3) but it is not going to be installed      libgl1-mesa-glx:i386 : Depends: libdrm2:i386 (>= 2.3.1) but it is not going to be installed                             Depends: libglapi-mesa:i386 (= 8.0.4-2) but it is not going to be installed                             Depends: libx11-xcb1:i386 but it is not going to be installed                             Depends: libxdamage1:i386 (>= 1:1.1) but it is not going to be installed                             Depends: libxfixes3:i386 but it is not going to be installed                             Depends: libxxf86vm1:i386 but it is not going to be installed     E: Unable to correct problems, you have held broken packages.


Best method to collect a random sample from a collection of files

Suppose there is a directory holding 300 data files. I want to randomly select 200 of those files and move them into another directory. Is there a way to do that under Unix/Linux?


How can I find a rogue alias declaration?

I'm trying to find where a specific `alias` has been declared. I've searched all the usual places I know to look for aliases:   * ~/.bashrc   * ~/.bash_profile   * /etc/bashrc   * /etc/profile With no luck. I know it's an `alias` because when I do `which COMMAND`, I get:               alias COMMAND='/path/to/command'         /path/to/command      Is there a way to find what file declares an `alias` only knowing the `alias` name?


Transforming text to tabular form

I have a text file with the following structure:               aaa     bbb     ccc     ddd     eee     fff          1     2     3     4     5     6          1.1     1.2     1.3     1.4     1.5     1.6          ggg     hhh     iii     jjj     kkk     lll          7     8     9     10     11     12          2.1     2.2     2.3     2.4     2.5     2.6      and I want the following tabular structure:               aaa    1    1.1     bbb    2    1.2     ccc    3    1.3     ddd    4    1.4     eee    5    1.5     fff    6    1.6     ggg    7    2.1     hhh    8    2.2     iii    9    2.3     jjj    10   2.4     kkk    11   2.5     lll    12   2.6      In this example each column repeats the pattern 2 times but the actual file does it more times and has more fields.


Fedora 17 Data Card Installation error

I have installed fedora 17 recently and i am trying to install my aircell datacard but i get following error message while installing               this is linux driver installtion     make -C /lib/modules/3.5.3-1.fc17.x86_64/build M=/tmp/ONDA_driver_install_V3.41 modules     make: *** /lib/modules/3.5.3-1.fc17.x86_64/build: No such file or directory.  Stop.     make: *** [modules] Error 2     this  is customized kernel ,kernel version is: 3.5.3-1.fc17.x86_64     enter customize_driver_install function     cp: cannot stat `onda.ko': No such file or directory     FATAL: Module onda not found.     disselfirefox.pp driver_install.run nm.pp se End to /opt/Connection_Manager/driver     libsepol.scope_copy_callback: spamassassin: Duplicate declaration in module: type/attribute pyzord_exec_t (No such file or directory).     libsemanage.semanage_link_sandbox: Link packages failed (No such file or directory).     /usr/sbin/semodule:  Failed!     the return is 256     libsepol.scope_copy_callback: spamassassin: Duplicate declaration in module: type/attribute pyzord_exec_t (No such file or directory).     libsemanage.semanage_link_sandbox: Link packages failed (No such file or directory).     /usr/sbin/semodule:  Failed!     the return is 256     it's ok!     usermod: group 'netdev' does not exist      Please could somebody help me out on this


How to Mirror one more disk on existing filesystem

in my test machine i can see the filesystem list using bdf commands.               $bdf       Filesystem          kbytes    used   avail %used Mounted on       /dev/vg00/lvol3    58916864 6242747 49386840   11% /       /dev/vg00/lvol1    2003481   47996 1755136    3% /stand       /dev/vg77/stds     5120000   18753 4782427    0% /var/opt/stdenv       /dev/vg77/scrap    3584000   18684 3342490    1% /tms/vts       /dev/vg77/cmdsscrap                    3584000  530986 2862264   16% /mnt        I have a scenario where i have to test the sar(1m) command to check the disk activity. for that i need a filesystem which is mirrored and configured with more then one disk. But unfortunately the above existing filesystems are having only one disk mirrored with it.               # lvdisplay -v /dev/vg00/lvol1     --- Logical volumes ---     LV Name                     /dev/vg00/lvol1     VG Name                     /dev/vg00     LV Permission               read/write                     LV Status                   available/syncd                Mirror copies               0                 Consistency Recovery        MWC                      Schedule                    parallel           LV Size (Mbytes)            2000                 Current LE                  125            Allocated PE                125              Stripes                     0            Stripe Size (Kbytes)        0                        Bad block                   off               Allocation                  strict/contiguous              IO Timeout (Seconds)        default                       --- Distribution of logical volume ---     PV Name                 LE on PV  PE on PV       /dev/disk/disk4         125       125  <-- Only one disk is mirrored.      Can anyone please let me know, How to add another disk into these existing filesystem? Please help me with the steps for mirroring the disk with filesystem. Thanks & Regards


How to make Nautilus notice changes regarding group permissions

If I follow a process I mentioned here, I am supposed to log out and then in for the changes to take place. What about Nautilus? I tried to restart it and was still unsuccessful. The only way I have so far found that works is logging out of the desktop and then in again. That's not always convenient of course.


Weblogic administration console way too slow

I've installed weblogic 10.3.3, configured simple domain with default configuration. And after starting weblogic I cannot use it via admin console because it is starting too slow (~10 mins). It seems that admin console application is being deployed incorrectly. Even when I enable 'staging' mode in AdminConsole deployment options, it does not help. Does anybody have a solution for this problem? It really bugs me out. * * * Configuration properties: **Server:** Dell PowerEdge r410 server (Six-core Intel® Xeon® x64 CPU, 8GB RAM) **OS:** Ubuntu Maverick 10.10 x86_64 **Weblogic:** 10.3.3 x64 (used wls1033_generic.jar file for installation) **Java:** : 1.6.0_17_i586 (tried with different jdk's including x64, but it does not work either)


How can I build a rpm for i386 target on a x86-64 machine?

I am building an rpm using `rpmbuild` command as: `rpmbuild -bb --root <DIRECTORY> \--target i386 --define "_topdir <DIRECTORY>" <specfile>.spec` When I use my SLED 10 SP3 x86 machine, it runs successfully. But on my SLES 10 SP3 x64 Virtual Machine, it gives following error:               error: No compatible architectures found for build      Initially I was not using `\--target` option, still it was running on x86 machine, but same error was there in x64 machine. Please help me to resolve this error


Print mac address to file

With a bash script, can I read the mac address of my eth0 and print it to a file?


How to stop bash editing the history when I reuse and modify an entry?

Some instances of bash change the command history when you re-use and edit a previous command, others apparently don't. I've been searching and searching but can't find anything that says how to prevent commands in the history from being modified when they're reused and edited. There are questions like this one, but that seems to say how to cope with the history being edited. I've only recently come across an instance of bash that does edit the history when you reuse a command - all previous bash shells I've used have (as far as I've noticed) been configured not to change the history when you reuse and edit a command. (Perhaps I've just not been paying proper attention to my shell history for the past 15 years or so...) So that's probably the best question: CAN I tell bash NEVER to modify the history - and if so, how?


Linux App that monitors log and add rules to iptables

I used to use a linux software that monitors logs like http, ssh, etc and if it detects that someone is trying to use brute force, it blocks that ip by adding a rule to iptables. I forgot what that software is called. It's opensource and free.


Using X11 as a photo frame

I'm currently using a netbook as a small home server and I was thinking about extra uses I could set up. Currently it has Ubuntu (possibly a netbook- specific version) installed, so it contains X-Windows, but also a bunch of stuff I don't care for such as GNOME. The trackpad doesn't seem to work, which should give you an idea of how much I use it as an actual graphical terminal (although I will sometimes log into it as a console terminal). However, since the screen is there, I've been thinking it could be cool for it to display some things. I've been thinking a photo frame/general info display, showing photos that are on an SMB share elsewhere on the network, as well as home automation info like temperature and recent temperature trends. My thinking was this could all be done via DHTML so all the "photo frame" needs to show is something like Firefox in a full screen mode and ignore the keyboard. One nice feature would be to have a button I could press to get a real GUI login back, but I don't really mind that, since I'm happy to just switch to a console screen and switch X-Windows round that way if I need it. So basically, how can I make it such that instead of firing up to a login screen, X11 will start to running an app (possibly as a 'photoframe' user) which is as simple a window manager as possible (or none at all) running a full screen/kiosk mode Firefox (or just some dumb WebKit-frame-hosting app) pointing at a web server on the local machine? :)


How to autoboot boot0?

How can automatically boot FreeBSD in `boot0` and, when needed, manually load win by pressing a shortcut button?


Install CentOS in a VirtualBox to a Compact Flash and use it on a mini PC

I got into a very specific situation and want to get to know your opinions. I have got a mini PC with Intel Atom processor which should run CentOS with an upgraded kernel to 3.x and some applications. Disk is a Compact Flash card connected through SATA to CF adapter. The overall performance of this mini PC is not suitable for compiling kernel. Installing Centos takes more time & effort too so I decided to do the following:   * mount Compact Flash to VirtualBox on a high-performance PC   * install CentOS and all applications through Virtual Box to the CF card   * compile new kernel through VirtualBox   * get all other settings set   * backup the content of the CF with dd (to be able to reuse it)   * boot mini PC with a finalized OS on the CF I see two main problems:   * CentOS is installed on a different architecture than it is used on = actually I tried this and it worked   * new kernel is compiled on a different architecture than it is used on = this should not be a problem if I compile the kernel to run on all architectures Do you see other problems which I should be aware of? Do you have experience with similar sirtuation? Any other ideas?


When the lines of a file or directory get too long, upgrade to ls list format?

Is there a way I can do this? For example if a gets a long name like:               i-have-names-that-are-too-long-to-describe/     i-have-names-that-are-too-long-to-describe-2/     i-have-names-that-are-too-long-to-descri-3/      Can I "upgrade" over from `ls` to `ls -l` given that I have a name of a file or directory that is longer than than say, 20 characters? Is there a way to set up a bash function in my `.bashrc` to do this? I'll call the resulting function lls(). **@tripleee asked:** > Do you want `ls -l` when the input file name is long? Why? It will make the > output longer, not shorter. What if you receive a mix of long and short > filenames? I want it more so that reading the long filenames are systematized to a list (and easier for me to digest and read going down a fixed column); for a mix of long and short filenames, I would default to the list format.


Read ~/.bash_profile but not /etc/profile

I noticed that you can prevent reading `/etc/profile` by running               bash --noprofile      However this also stops `~/.bash_profile` from being read. Can Bash be invoked in such a way as to read `~/.bash_profile` but not `/etc/profile`?


FreeBSD and StrongSwan routing issue

Good day, gentlemen. I have recently faced a problem when a device connected to the FreeBSD server via StrongSwan can't route outside its subnet. Let me explain in details: FreeBSD 10.0-RELEASE, kernel compiled with (full config: http://pastebin.com/5PQFXqhx):               options IPSEC     options IPSEC_NAT_T     device crypto     device cryptodev      ~~Forwarding turned on in **sysctl.conf** :               net.inet.ip.forwarding=1     net.inet6.ip6.forwarding=1      ~~ We have two interfaces. The first one is 192.168.1.100, the router forwards ports 500 and 4500 from the Internet to this IP (so we can connect from anywhere to the "sweet home" network). The second one is 10.0.0.1 which is used for Samba and other services. **/etc/rc.conf** :               hostname="bsdserver"     ifconfig_igb0="inet 192.168.1.100 netmask 255.255.255.0"     ifconfig_igb1="inet 10.0.0.1 netmask 255.255.255.0"     defaultrouter="192.168.1.1"     gateway_enable="YES"     ipv6_gateway_enable="YES"      ![Network scheme](http://i.stack.imgur.com/UQ0IZ.png) **ipsec.conf** :               config setup         strictcrlpolicy = no     ca bsdserver         cacert = /usr/local/etc/ipsec.d/cacerts/bsdserver_CA.der     conn android     auto = add     dpdaction = clear     keyexchange = ikev2     esp=aes-aes256-sha-modp1024,aes256-sha512-modp4096     ike=aes-aes256-sha-modp1024,aes256-sha512-modp4096     mobike = yes     left = 192.168.1.100     leftsubnet = 0.0.0.0/0,::0/0     leftauth = pubkey     leftid = "111.111.111.111" # real "white" ip here     leftcert = /usr/local/etc/ipsec.d/certs/111.111.111.111_cert.der     leftfirewall = yes     leftsourceip = %config4,%config6     right = %any     rightsourceip = 10.0.0.3/32     rightauth = pubkey     rightid = "C=XX, ST=XX, L=XX, O=ORG, OU=UNIT, CN=111.111.111.111, E=mail@host.com"     rightcert = /usr/local/etc/ipsec.d/certs/android_cert.der      This is the output from `ipsec start --nofork`:               Starting strongSwan 5.1.1 IPsec [starter]...     no netkey IPsec stack detected     no KLIPS IPsec stack detected     no known IPsec stack detected, ignoring!     00[DMN] Starting IKE charon daemon (strongSwan 5.1.1, FreeBSD 10.0-RELEASE, amd64)     00[KNL] unable to set UDP_ENCAP: Invalid argument     00[NET] enabling UDP decapsulation for IPv6 on port 4500 failed     00[CFG] loading ca certificates from '/usr/local/etc/ipsec.d/cacerts'     00[CFG]   loaded ca certificate "C=XX, ST=XX, L=XX, O=ORG, OU=UNIT, CN=111.111.111.111, E=mail@host.com" from '/usr/local/etc/ipsec.d/cacerts/UNIT_CA.der'     00[CFG] loading aa certificates from '/usr/local/etc/ipsec.d/aacerts'     00[CFG] loading ocsp signer certificates from '/usr/local/etc/ipsec.d/ocspcerts'     00[CFG] loading attribute certificates from '/usr/local/etc/ipsec.d/acerts'     00[CFG] loading crls from '/usr/local/etc/ipsec.d/crls'     00[CFG] loading secrets from '/usr/local/etc/ipsec.secrets'     00[CFG]   loaded RSA private key from '/usr/local/etc/ipsec.d/private/111.111.111.111_key.der'     00[LIB] loaded plugins: charon test-vectors curl aes des blowfish rc2 sha1 sha2 md4 md5 random nonce x509 revocation constraints pubkey pkcs1 pkcs7 pkcs8 pkcs12 pgp dnskey sshkey pem openssl fips-prf gmp xcbc cmac hmac attr kernel-pfkey kernel-pfroute resolve socket-default stroke updown eap-identity eap-aka eap-aka-3gpp2 eap-md5 eap-mschapv2 eap-dynamic eap-tls eap-ttls eap-peap xauth-generic xauth-eap whitelist addrblock     00[LIB] unable to load 4 plugin features (4 due to unmet dependencies)     00[JOB] spawning 16 worker threads     charon (49667) started after 220 ms     16[CFG] received stroke: add connection 'android'     16[CFG] adding virtXXl IP address pool 10.0.0.3/32     16[CFG] 'android' has both left- and rightsourceip, but IKE can negotiate one virtXXl IP only, ignoring local virtXXl IP     16[CFG]   loaded certificate "C=XX, ST=XX, L=XX, O=ORG, OU=UNIT, CN=111.111.111.111, E=mail@host.com" from '/usr/local/etc/ipsec.d/certs/111.111.111.111_cert.der'     16[CFG]   loaded certificate "C=XX, ST=XX, L=XX, O=ORG, OU=UNIT, CN=111.111.111.111, E=mail@host.com" from '/usr/local/etc/ipsec.d/certs/android_cert.der'     16[CFG] added configuration 'android'     16[NET] received packet: from 22.222.222.22[16483] to 192.168.1.100[500] (660 bytes)     16[ENC] parsed IKE_SA_INIT request 0 [ SA KE No N(NATD_S_IP) N(NATD_D_IP) ]     16[IKE] 22.222.222.22 is initiating an IKE_SA     16[IKE] IKE_SA (unnamed)[1] state change: CREATED => CONNECTING     16[IKE] local host is behind NAT, sending keep alives     16[IKE] remote host is behind NAT     16[IKE] sending cert request for "C=XX, ST=XX, L=XX, O=ORG, OU=UNIT, CN=111.111.111.111, E=mail@host.com"     16[ENC] generating IKE_SA_INIT response 0 [ SA KE No N(NATD_S_IP) N(NATD_D_IP) CERTREQ N(MULT_AUTH) ]     16[NET] sending packet: from 192.168.1.100[500] to 22.222.222.22[16483] (337 bytes)     16[NET] received packet: from 22.222.222.22[16549] to 192.168.1.100[4500] (1964 bytes)     16[ENC] parsed IKE_AUTH request 1 [ IDi CERT N(INIT_CONTACT) CERTREQ AUTH CPRQ(ADDR ADDR6 DNS DNS6) N(ESP_TFC_PAD_N) SA TSi TSr N(MOBIKE_SUP) N(NO_ADD_ADDR) N(MULT_AUTH) N(EAP_ONLY) ]     16[IKE] received cert request for "C=XX, ST=XX, L=XX, O=ORG, OU=UNIT, CN=111.111.111.111, E=mail@host.com"     16[IKE] received end entity cert "C=XX, ST=XX, L=XX, O=ORG, OU=UNIT, CN=111.111.111.111, E=mail@host.com"     16[CFG] looking for peer configs matching 192.168.1.100[%any]...22.222.222.22[C=XX, ST=XX, L=XX, O=ORG, OU=UNIT, CN=111.111.111.111, E=mail@host.com]     16[CFG] selected peer config 'android'     16[CFG]   using trusted ca certificate "C=XX, ST=XX, L=XX, O=ORG, OU=UNIT, CN=111.111.111.111, E=mail@host.com"     16[CFG] checking certificate status of "C=XX, ST=XX, L=XX, O=ORG, OU=UNIT, CN=111.111.111.111, E=mail@host.com"     16[CFG] certificate status is not available     16[CFG]   reached self-signed root ca with a path length of 0     16[CFG]   using trusted certificate "C=XX, ST=XX, L=XX, O=ORG, OU=UNIT, CN=111.111.111.111, E=mail@host.com"     16[IKE] authentication of 'C=XX, ST=XX, L=XX, O=ORG, OU=UNIT, CN=111.111.111.111, E=mail@host.com' with RSA signature successful     16[IKE] processing INTERNAL_IP4_ADDRESS attribute     16[IKE] processing INTERNAL_IP6_ADDRESS attribute     16[IKE] processing INTERNAL_IP4_DNS attribute     16[IKE] processing INTERNAL_IP6_DNS attribute     16[IKE] received ESP_TFC_PADDING_NOT_SUPPORTED, not using ESPv3 TFC padding     16[IKE] peer supports MOBIKE     16[IKE] authentication of '111.111.111.111' (myself) with RSA signature successful     16[IKE] IKE_SA android[1] established between 192.168.1.100[111.111.111.111]...22.222.222.22[C=XX, ST=XX, L=XX, O=ORG, OU=UNIT, CN=111.111.111.111, E=mail@host.com]     16[IKE] IKE_SA android[1] state change: CONNECTING => ESTABLISHED     16[IKE] scheduling reauthentication in 9802s     16[IKE] maximum IKE_SA lifetime 10342s     16[IKE] sending end entity cert "C=XX, ST=XX, L=XX, O=ORG, OU=UNIT, CN=111.111.111.111, E=mail@host.com"     16[IKE] peer requested virtXXl IP %any     16[CFG] assigning new lease to 'C=XX, ST=XX, L=XX, O=ORG, OU=UNIT, CN=111.111.111.111, E=mail@host.com'     16[IKE] assigning virtXXl IP 10.0.0.3 to peer 'C=XX, ST=XX, L=XX, O=ORG, OU=UNIT, CN=111.111.111.111, E=mail@host.com'     16[IKE] peer requested virtXXl IP %any6     16[IKE] no virtXXl IP found for %any6 requested by 'C=XX, ST=XX, L=XX, O=ORG, OU=UNIT, CN=111.111.111.111, E=mail@host.com'     16[IKE] CHILD_SA android{1} established with SPIs c11f2b7e_i f7ac6573_o and TS 0.0.0.0/0 ::/0 === 10.0.0.3/32     16[CHD] updown: /usr/local/libexec/ipsec/_updown: iptables: not found     16[CHD] updown: /usr/local/libexec/ipsec/_updown: iptables: not found     16[ENC] generating IKE_AUTH response 1 [ IDr CERT AUTH CPRP(ADDR) N(ESP_TFC_PAD_N) SA TSi TSr N(AUTH_LFT) N(MOBIKE_SUP) N(ADD_4_ADDR) ]     16[NET] sending packet: from 192.168.1.100[4500] to 22.222.222.22[16549] (1596 bytes)      Looking at the `tcpdump` output: 10.0.0.3 is an IP that Android client got assigned by StrongSwan. DNS:               22:21:43.971797 IP 10.0.0.3.55123 > ns1.kyivstar.net.domain: 41221+ A? www.cdn.viber.com. (35)     22:26:00.484696 IP 10.0.0.3.25462 > gi-dns1-kie3.kyivstar.net.domain: 436+ A? mtalk.google.com. (34)     22:25:59.225291 IP 10.0.0.3.53999 > ns1.kyivstar.net.domain: 56585+ A? graph.facebook.com. (36)      OK, pinging "bsdserver" works:               22:26:06.460464 IP 22-222-222-22-gprs.kyivstar.net.16445 > bsdserver.local.sae-urn: UDP-encap: ESP(spi=0xc289c560,seq=0x96), length 132     22:26:06.460749 IP bsdserver.local.sae-urn > 46-211-183-74-gprs.kyivstar.net.16445: UDP-encap: ESP(spi=0xe77a2567,seq=0x1f), length 132      But pinging 8.8.8.8 doesn't:               22:30:51.179070 IP 10.0.0.3 > google-public-dns-a.google.com: ICMP echo request, id 3, seq 6, length 64     22:30:52.098315 IP 22-222-222-22-gprs.kyivstar.net.16445 > bsdserver.local.sae-urn: UDP-encap: ESP(spi=0xc289c560,seq=0xce), length 132     22:30:52.098825 IP 10.0.0.3 > google-public-dns-a.google.com: ICMP echo request, id 3, seq 7, length 64     22:30:52.754209 STP 802.1d, Config, Flags [none], bridge-id 8000.b0:48:7a:c2:f2:92.8001, length 43     22:30:53.078436 IP 22-222-222-22-gprs.kyivstar.net.16445 > bsdserver.local.sae-urn: UDP-encap: ESP(spi=0xc289c560,seq=0xcf), length 132     22:30:53.079070 IP 10.0.0.3 > google-public-dns-a.google.com: ICMP echo request, id 3, seq 8, length 64     22:30:53.358693 IP 22-222-222-22-gprs.kyivstar.net.16445 > bsdserver.local.sae-urn: isakmp-nat-keep-alive     22:30:53.738572 IP 22-222-222-22-gprs.kyivstar.net.16445 > bsdserver.local.sae-urn: UDP-encap: ESP(spi=0xc289c560,seq=0xd0), length 116     22:30:53.739164 IP 10.0.0.3.25984 > gi-dns1-kie3.kyivstar.net.domain: 1638+ A? www.cdn.viber.com. (35)     22:30:54.098740 IP 22-222-222-22-gprs.kyivstar.net.16445 > bsdserver.local.sae-urn: UDP-encap: ESP(spi=0xc289c560,seq=0xd1), length 132     22:30:54.099248 IP 10.0.0.3 > google-public-dns-a.google.com: ICMP echo request, id 3, seq 9, length 64     22:30:54.754083 STP 802.1d, Config, Flags [none], bridge-id 8000.b0:48:7a:c2:f2:92.8001, length 43      And routing table from Android device: ![Android route](http://i.stack.imgur.com/UZmVW.png) I feel like problem isn't exactly IPsec related. Any bright ideas about possible solution?


Cannot install PHP packages in CentOS

In CentOS 6.3 ( **Edit** : updated to 6.4) I can't install any PHP (MySQL, and many other) packages. For example output of `yum install php-devel` is:               Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile      * base: mirror.vit.com.tr      * extras: mirrors.prometeus.net      * rpmforge: mirror.nl.leaseweb.net      * updates: mirrors.prometeus.net     Setting up Install Process     No package php-devel available.     Error: Nothing to do      output of `ls /etc/yum.repos.d`:               CentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-Media.repo  CentOS-Vault.repo  mirrors-rpmforge  rpmforge.repo      `grep -E "name|enabled" /etc/yum.repos.d/*`:               /etc/yum.repos.d/CentOS-Base.repo:name=CentOS-$releasever - Base     /etc/yum.repos.d/CentOS-Base.repo:name=CentOS-$releasever - Updates     /etc/yum.repos.d/CentOS-Base.repo:name=CentOS-$releasever - Extras     /etc/yum.repos.d/CentOS-Base.repo:name=CentOS-$releasever - Plus     /etc/yum.repos.d/CentOS-Base.repo:enabled=0     /etc/yum.repos.d/CentOS-Base.repo:name=CentOS-$releasever - Contrib     /etc/yum.repos.d/CentOS-Base.repo:enabled=0     /etc/yum.repos.d/CentOS-Debuginfo.repo:name=CentOS-6 - Debuginfo     /etc/yum.repos.d/CentOS-Debuginfo.repo:enabled=0     /etc/yum.repos.d/CentOS-Media.repo:name=CentOS-$releasever - Media     /etc/yum.repos.d/CentOS-Media.repo:enabled=0     /etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.0 - Base     /etc/yum.repos.d/CentOS-Vault.repo:enabled=0     /etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.0 - Updates     /etc/yum.repos.d/CentOS-Vault.repo:enabled=0     /etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.0 - Extras     /etc/yum.repos.d/CentOS-Vault.repo:enabled=0     /etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.0 - Contrib     /etc/yum.repos.d/CentOS-Vault.repo:enabled=0     /etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.0 - CentOSPlus     /etc/yum.repos.d/CentOS-Vault.repo:enabled=0     /etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.1 - Base     /etc/yum.repos.d/CentOS-Vault.repo:enabled=0     /etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.1 - Updates     /etc/yum.repos.d/CentOS-Vault.repo:enabled=0     /etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.1 - Extras     /etc/yum.repos.d/CentOS-Vault.repo:enabled=0     /etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.1 - Contrib     /etc/yum.repos.d/CentOS-Vault.repo:enabled=0     /etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.1 - CentOSPlus     /etc/yum.repos.d/CentOS-Vault.repo:enabled=0     /etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.2 - Base     /etc/yum.repos.d/CentOS-Vault.repo:enabled=0     /etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.2 - Updates     /etc/yum.repos.d/CentOS-Vault.repo:enabled=0     /etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.2 - Extras     /etc/yum.repos.d/CentOS-Vault.repo:enabled=0     /etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.2 - Contrib     /etc/yum.repos.d/CentOS-Vault.repo:enabled=0     /etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.2 - CentOSPlus     /etc/yum.repos.d/CentOS-Vault.repo:enabled=0     /etc/yum.repos.d/rpmforge.repo:name = Red Hat Enterprise $releasever - RPMforge.net - dag     /etc/yum.repos.d/rpmforge.repo:enabled = 1      `yum repolist`:               repo id                                           repo name                                                                          status     base                                              CentOS-6 - Base                                                                      6,296+85     extras                                            CentOS-6 - Extras                                                                          13     rpmforge                                          Red Hat Enterprise 6 - RPMforge.net - dag                                          11,131+144     updates                                           CentOS-6 - Updates                                                                     890+34      `yum list available 'php-*'`:               Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile      * base: mirror.vit.com.tr      * extras: mirrors.prometeus.net      * rpmforge: www.mirrorservice.org      * updates: mirrors.prometeus.net     Error: No matching Packages to list      This happens for all PHP packages. When I type `php-` and press tab key there is no auto completion. Any suggestions?


Switch between windows & tabs in Linux?

do we have keyboard shortcuts to switch between tabs or windows, am looking for shortcuts similar to of those available in windows (ctrl + tab to switch btw tabs & Alt + tab to swtich btw windows). Note: RHEL5.8 is accessed via CITRIX XENAPP as a window in windows xp


centos 6.3 apache local network not working

I have clean installed centos, apache, mysql, php and have my php pages running fine at 192.168.1.66. I type that ip in on another computer (macbook) on the same network and get nothing. Page time out. I also don't see the linux machine showing up in my network list in finder. I have tried adding port 80 to iptables but still no joy. Also, I tried running my xampp installation on the macbook and viewing that from my linux browser and get nothing. Basically the 2 computers are on the same network but don't want to see each other. I can't find any options in centos for sharing on the local network Any help is much appreciated.


Dialog - Continue in background

I installed this program: http://invisible-island.net/dialog/dialog.html Now I want to use this dialog: http://invisible-island.net/dialog/dialog-figures.html#demo_gauge               dialog --gauge 'Checking permissions' 20 60      It works fine, but the problem is that the bash script does not continue until this dialog has been closed (CTRL + C). But I want that my shell script continues, and I show the status with the dialog. Is this possible? ### EDIT #1               status="Initializing"         (echo 1      sleep 1      status="Loading"      echo 30      sleep 1      echo 90      sleep 1      echo 100     ) | dialog --gauge $status 10 40


sendmail through virtual machine

I am successfully performing some very basic SMTP sending in my machine with a basic Python script:               .... things ...          try:        smtpObj = smtplib.SMTP('localhost')        smtpObj.sendmail(sender, recievers, message.format(now, now))        print "Successfully sent email"     except SMTPException:        print "Error: unable to send email"      It works fine both in my machine and in a Ubuntu server I have in Virtual Box. Now I would like to send one email from one server using the other server as a host. I tried in my virtual host to change               smtpObj = smtplib.SMTP('localhost')      with               smtpObj = smtplib.SMTP('IP of my PC') #IP get from "ifconfig -a"      but does not work. Am I missing something?


Third cron field doesn't seem to work (job runs when I don't want it to)

I scheduled a job like this:               *   *    6-8  *  1-5  echo "test" >>/tmp/test.log 2>&1      I expect this job to run only on 6th,7th,8th, these 3 days. but today is 18th, it still runs. What is wrong with this job? What shall I do if I want it to run a some specific days?


Delete only first occurrence of character using tr

I want to delete the occurrence of a character in a string only for the first occurrence. Example:               echo "B123_BACK" | tr -d 'B'      This results in output:               123_ACK      How can I delete only the first occurrence of charcater `'B'` so that the output looks like               123_BACK


Similar method to /etc/init.d

I have set my script to run using the `/etc/init.d` method. All works good. The problem is that my script does packet capturing and when it restarts the machine after say the `crond` is loaded then it loads this script of mine and the packet capture process I guess starting then and it halts from going further. Is there any method where I can force it only to start when Linux is fully loaded ? Below is how my script looks like.               #!/bin/bash     # chkconfig: 2345 95 05     # myapp daemon     # description: myapp daemon     # processname: myapp          DAEMON_PATH="/usr/local/bin/"     DAEMON=pc1.c     #DAEMONOPTS="-my opts"     NAME=pc1.c     DESC="my packet capture"          PIDFILE=/var/run/$NAME.pid     SCRIPTNAME=/etc/init.d/$NAME          case "$1" in     start)         printf "%-50s" "Starting $NAME..."         insmod /usr/local/pfring/kernel/pf_ring.ko         /usr/local/bin/pc1.c &         $! > PIDFILE         ;;     status)             if [ -f $PIDFILE];              then if [ -d /proc/cat $PIDFILE ];                   then echo "Process is running";                   fi;              else echo "Error! PID file is missing!";                   fi          ;;     stop)             printf "%-50s" "Stopping $NAME"                 PID=`cat $PIDFILE`                 cd $DAEMON_PATH             if [ -f $PIDFILE ]; then                 kill -HUP $PID                 printf "%s\n" "Ok"                 rm -f $PIDFILE             else                 printf "%s\n" "pidfile not found"             fi     ;;     restart)         $0 stop         $0 start      ;;     *)             echo "Usage: $0 {status|start|stop|restart}"             exit 1     esac


External HDD read/write permission changing from a cron job

So, I run an overnight python script that runs a backup of our web data in the /var/www directory, then moves the backups to an external HDD in /media. The script in scheduled in the sudo crontab since it requires sudo commands. The script runs fine most everynight but once a week, the external HDD directory somehow gets it permissions changed from being accessible to all users to only being accessible to the root user. This causes our backups to fail, and this is no good. To further explain: the directory, /media/ gets duplicated into /media/_ which has no permission issue. It's like the name just got changed to have an underscore at the end. This one has all of the right data in it and is fine. The root one (/media/) is actually empty when I get in there. I am not heavily experienced with linux. I just know how to get around and issue simple commands. I do not know the ins and outs of the kernel and what could be causing the issue. I have no clue what is going on here. I am open to any suggestions. Please let me know if I am doing anything wrong/insecure. Let me know if this needs to be further explained. -Zac


svn: SSL is not supported

I am trying to check out code on a Unix box in the Z shell. When I run the following command svn checkout https://svn.example.net/svn/trunk/source build I get the following error message: svn: SSL is not supported The error message is in no way informative so I'd like to see if anyone has had a similar problem and even better if they have a solution. Thanks


Fedora 17 Freezes on Macbook Pro Install

So I put Fedora on my flash drive using this tutorial, and I also burned it onto a DVD. Whenever I try to boot from it or one of the EFI boots, the countdown on the install freezes at 0. whenever I try to press a key, it doesn't do anything. Any help would be appreciated. Thanks.


A problem with $RANDOM range in bash

why the code below, supposed to display a random from 2-3 range, actually works as if the range was 2-4?               echo $((RANDOM%3+2))


^x^y unix trick for all instances in last command?

One of my favorite Unix tricks is `^x^y`, which will take the last command and replace the first instance of "x" with "y". However, I'm wondering if a similar trick works to replace _all_ instances of "x" with "y" in the last command?


Don't stop make'ing if a command fails, but check exit status

I am trying to instruct GNU Make 3.81 to not stop if a command fails (so I prefix the command with `-`) but I also want to check the exit status on the next command and print a more informative message. However my Makefile below fails:               $ cat Makefile      all:         -/bin/false         ([ $$? -eq 0 ] && echo "success!") || echo "failure!"     $     $ make     /bin/false     make: [all] Error 1 (ignored)     ([ $? -eq 0 ] && echo "success!") || echo "failure!"     success!      Why does the Makefile above echo "success!" instead of "failure!" ? **update:** Following and expanding on the accepted answer, below is how it should be written:               failure:                                                                                @-/bin/false && ([ $$? -eq 0 ] && echo "success!") || echo "failure!"                                                                                success:                                                                                @-/bin/true && ([ $$? -eq 0 ] && echo "success!") || echo "failure!"


How can I restore default window size in KVM/QEMU

In KVM/QEMU machine window size by default matches guest OS resolution. But if I resize windows (accidently) how to restore default size?


Why can I only run a .sh file from the parent directory, not the child directory

I am a Linux noob. I noticed that this does not work:               /tomcatDirectory/bin $ startup.sh //command not found      but this does work               /tomcatDirectory $ bin/startup.sh      I am used to Windows. It seems counter-intuitive to me that I can not run a program from its working directory, only from the parent folder. What's the bigger picture of what's happening here?


What is a command that will only show me the command syntax and options?

Is there a command which will just list all the options for a given command on one or two lines and not as long and words as `man` or `info` ?


Script using "split" in a loop over large files

I'm attempting to get a bash script working, and running into terrible errors along the way. The aim of the script is to break several large text files, into multiple files with a line count read from the file.               #!/bin/bash     DIR="$( cd "$( dirname "$0" )" && pwd )"      for i in 21 22 23 24 25 26 27 28 29 30 33 34 35 36 37 38 39 210 211 212 213 214 215 216 217 218 310 311 312 313 314 315 316 317 318     do         lines="`head -1 $DIR/C$i/DOPC-C$i.xyz`"         echo $lines         lines=$((lines+2))         split -a4 -d -l$lines $DIR/C$i/DOPC-C$i.xyz $DIR/C$i/DOPC-C$i-     done      The large text file has the number of molecules as its first line, so I'm using the head command to read it in, then passing this to split as the number of lines to. It has a formatting similar to:               3     Comment     C 0.41238 0.2301928 0.123123     H 0.123123 0.123233 0.5234234     H 0.123123 0.123233 0.5234234     3     Comment     C 0.41238 0.2301928 0.123123     H 0.123123 0.123233 0.5234234     H 0.123123 0.123233 0.5234234      However, when I run this from terminal, the memory usage of my system from free -m shoots up from 1.5GB to 16GB in use, and becomes extremely unresponsive. It works correctly for the first two files, and splits them how I wanted, though. Any advice? EDIT: The source files are all ~200-300MB. When I run the split command directly on any of the files it works fine. There are 30 files which need to be split in this way, C21,C22, C23, etc. I reran the script and it got through the first ten files before it hit the memory limit this time. EDIT2: So, I made a sort of very heavy handed work around. After running it through three files, I simply put               echo 3 | tee /proc/sys/vm/drop_caches      I noticed after the split command my memory in use would sharply spike according to free -m The spike also wouldn't go away when closing the terminal window where I ran the split command. I believe there is some issue in the configuration of disc caching on my system: Linux must be caching either the files I'm writing from or writing to and not cleaning up. When putting this to run every 3rd file, the script runs, albeit relatively slowly, through all of the files, and my system remains stable after. My suspicion is that this caching may also be related in part to it being a NTFS file system that I'm working on.


Why are packets not moving forward?

I have a server with forwarding turned on. I placed an iptables LOG target in the PREROUTING, INPUT, and FORWARD chains of the mangle table. I can see the LOG messages from PREROUTING, but not INPUT or FORWARD. I have no iptables rules other than the logging. Why does the packet not get past the PREROUTING chain? From various netfilter charts, it seems that the only thing that can stop it is the routing decision. I have checked that forwarding is turned on, I don't have any special routing policies setup, and I do have a route to the packet's destination. Reverse path filtering is disabled. One netfilter chart suggests the packet goes through QOS ingress at that point. I'm not too familiar with QOS, but I've not done anything special with tc. My qdiscs are pfifo_fast (the default), and there are no filters. Additional details: This is an IPsec tunnel endpoint. The packets are coming in through IPsec, getting transformed successfully, and re-entering the networking stack. It is at this stage that I see the packet get stopped after PREROUTING before either INPUT or FORWARD.


sensors-detect does not detect

I am trying to run sensors-detect in Debian6 64 bits and I get: > Sorry, no sensors were detected. Either your system has no sensors, or they > are not supported, or they are connected to an I2C or SMBus adapter that is > not supported. Sensors applet is correctly running as well as sensor cpu * * *                   root@debian:/# dmesg | grep -i error      [ 0.558964] ACPI Error (psargs-0359): [RAMB] Namespace lookup failure, AE_NOT_FOUND      [ 7.537292] PM: Error -22 checking image file      [ 9.581500] nouveau: probe of 0000:01:00.0 failed with error -22      * * *               root@debian:/# lspci     00:00.0 Host bridge: Intel Corporation Sandy Bridge DRAM Controller (rev 09)     00:01.0 PCI bridge: Intel Corporation Sandy Bridge PCI Express Root Port (rev 09)     00:02.0 Display controller: Intel Corporation Sandy Bridge Integrated Graphics Controller (rev 09)     00:16.0 Communication controller: Intel Corporation Cougar Point HECI Controller #1 (rev 04)     00:1a.0 USB Controller: Intel Corporation Cougar Point USB Enhanced Host Controller #2 (rev 05)     00:1b.0 Audio device: Intel Corporation Cougar Point High Definition Audio Controller (rev 05)     00:1c.0 PCI bridge: Intel Corporation Cougar Point PCI Express Root Port 1 (rev b5)     00:1c.5 PCI bridge: Intel Corporation Cougar Point PCI Express Root Port 6 (rev b5)     00:1c.6 PCI bridge: Intel Corporation Cougar Point PCI Express Root Port 7 (rev b5)     00:1c.7 PCI bridge: Intel Corporation 82801 PCI Bridge (rev b5)     00:1d.0 USB Controller: Intel Corporation Cougar Point USB Enhanced Host Controller #1 (rev 05)     00:1f.0 ISA bridge: Intel Corporation Cougar Point LPC Controller (rev 05)     00:1f.2 SATA controller: Intel Corporation Cougar Point 6 port SATA AHCI Controller (rev 05)     00:1f.3 SMBus: Intel Corporation Cougar Point SMBus Controller (rev 05)     01:00.0 VGA compatible controller: nVidia Corporation Device 1244 (rev a1)     01:00.1 Audio device: nVidia Corporation Device 0bee (rev a1)     03:00.0 USB Controller: Device 1b21:1042     04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)     05:00.0 PCI bridge: Device 1b21:1080 (rev 01)      I only get the following running sensors:               root@debian:/# sensors     acpitz-virtual-0     Adapter: Virtual device     temp1:       +27.8°C  (crit = +99.0°C)                       temp2:       +29.8°C  (crit = +99.0°C)      * * * **With this proposed script (http://dl.lm-sensors.org/lm- sensors/files/sensors-detect) It seems that sensors-detect find much more, I restart Debian, or I start the service lm-sensor and I get the same outpout at sensors**


How to provide a "guest LAN" on one ethernet device

I have an always-on machine running Debian/Squeeze with a couple of ethernet ports (it's doing various serverish jobs, including DHCP) and a LAN on each. eth0 is on 192.168.7.* and has access to the internet (and the rest of the "office LAN") via a gateway (NAT-translating DSL router) on that LAN at 192.168.7.1. eth1 is on 192.168.1.* . I'm looking for a quick, easy and Debian-friendly way of configuring the machine so that anyone on the 192.168.1.* LAN only has access to the external internet, DHCP, and can't access any of the other stuff on 192.168.7.*. I'm sure this is possible using an appropriate set of iptables rules. Suspect I'm looking for one of:   * A simple guide to how to set up iptables to achieve the above (I can't be the first person to want to do this).   * A pointer to some user-friendly firewall configuring software which can do this (although note that I don't want to lock down the eth0-side and the 192.168.7.* network at all).   * Suggestion of some software which is designed to do exactly this; I have an idea there are some packages intended to achieve similar to what I want for internet cafes etc, but I'm not sure where to start looking or whether these might be overkill. Any tools being in Debian Squeeze (or Wheezy) already is a big plus.


show only tags of an xml document on the command line

Is there a command line command or utility I can use to show only the tag structure of an xml document? I looked at xmllint but I didn't see a switch to do it. For a structure like               <tag1><tag2><tag2-5>value1</tag2-5><tag3>value2</tag3></tag2></tag1>      I want to see               <tag1><tag2><tag2-5></tag2-5><tag3></tag3></tag2></tag1>


Streaming all local audio to Icecast Server

Does anyone know if it's possible to stream all audio on a computer to a local icecast server. I was able to stream individual files using ices2 but not all audio generated from my computer. Any thoughts, or is there a better way to setup some way for anyone to stream my local computers audio over the internet or local network?


vim "caught deadly signal HUP", what files are it preserving?

I logged out, apparently forgetting to bring back a vim session to the foreground. As expected, vim spat out "Vim: caught deadly signal HUP" followed by "Vim: preserving files". My question is: What files are being preserved? I guess those are the edited- but-unsaved files; where are those kept? How to I find them?


How can I configure xlock to find fonts?

Is it possible to make `xlock` to find fonts on my computer automatically? Namely, when I start xlock, it says               xlock: can not find font: -*-helvetica-medium-r-*-*-24-*-*-*-*-*-*, using fixed...      In my computer there are at least the following fonts (excerpt from `xlsfonts`):               -adobe-helvetica-medium-r-narrow--0-0-0-0-p-0-iso8859-1     -adobe-helvetica-medium-r-narrow--0-0-0-0-p-0-iso8859-15     -adobe-helvetica-medium-r-narrow--0-0-0-0-p-0-iso8859-2     -adobe-helvetica-medium-r-normal--0-0-0-0-p-0-iso8859-1     -adobe-helvetica-medium-r-normal--0-0-0-0-p-0-iso8859-15     -adobe-helvetica-medium-r-normal--0-0-0-0-p-0-iso8859-2     fixed      I know that I can use the following: `xlock -font -fixed` but I was wondering if it is possible for `xlock` to find suitable font without any parameters. And why               $ xlock -font -abobe-helvetica-medium-r-narrow--0-0-0-0-p-0-iso8859-1     xlock: can not find font: -abobe-helvetica-medium-r-narrow--0-0-0-0-p-0-iso8859-1, using fixed...`      won't work but `xlsfonts` lists that font? I tried               jaakko@jaakko-VPCEB1S1E:~$ xterm -fb -*-helvetica-medium-r-*-*-24-*-*-*-*-*-*     xterm: cannot load font '-*-helvetica-medium-r-*-*-24-*-*-*-*-*-*'     xterm: cannot load font '-*-helvetica-medium-r-*-*-24-*-*-*-*-*-*'     jaakko@jaakko-VPCEB1S1E:~$ xterm -fb -adobe-helvetica-medium-r-narrow--0-0-0-0-p-0-iso8859-43     xterm: cannot load font '-adobe-helvetica-medium-r-narrow--0-0-0-0-p-0-iso8859-43'     xterm: cannot load font '-adobe-helvetica-medium-r-narrow--0-0-0-0-p-0-iso8859-43'      and               jaakko@jaakko-VPCEB1S1E:~$ ls -l /usr/bin/xlock     -rwxr-xr-x 1 root root 129992 May 25  2012 /usr/bin/xlock


Getting a date format with grep

I've looked at similar questions and tried most suggestions, but none of them got me anywhere, even though i have a fairly simple task I think :S. I'm fairly new to this whole thing, so I've run out of ideas as to what to try or what I'm doing wrong... So the task is to get the lines of a file listed (with grep) which contain the short month name and day (like Oct 22). The file has a long format listing in it (containing files created on the current date), so there should be some results. However, I'm getting results in which only the month has been examined and found, the day hasn't. Some of the more sensible things I've tried so far:               grep $(date +"%b %e") *filename*      Then I get a line saying "grep: 22: No such file or directory" and a listing with all the results for the month ("Oct"). Same results with `+%d %e` or `+'%d %e'` or `'+%d %e'` instead of `+"%d %e";` instead of `$()`. (I also had %d for the day for a while, which made no difference, and shouldn't matter anyway as far as I know, since the date in question was now 22.) Why is the day not taken into account here?


How can I install Ubuntu 13.10 on Asus n56dp-dh11

My laptop has uefi and when I open the bios there is no clear way to tell the computer to boot from USB or CD. I'm very confused on how I'm supposed to install anything, even windows 7 can not load from a USB drive or DVD. I've seen, after a few hours of Googling that Ubuntu and other Linux distro's run great on this very exact laptop. But they have no insight as to how to do it.


Is there something like a lorem ipsum generator?

Is there something like a 'lorem ipsum generator'? I know it exists in Latex, and even in LibreOffice, but I'm looking for a terminal command. I would like to type something like `loremipsum 10 >> file1.txt` that would give me the first 10 paragraphs of lorem ipsum, each paragraph ended with one LF-character and 1 empty white line between each paragaph. And the output would be redirected to a file called file1.txt in the current directory.


Copying specific subfolders with directory structure to a new folder

I am having a the following directory structure:                               Main_Dir                        |       -----------------------------------       Subdir1       Subdir2       Subdir3          |             |             |      ---------     ---------     ---------      |   |   |     |   |   |     |   |   |                 fo1 fo2 f03   fo1 fo2 f03   fo1 fo2 f03      I want to copy all the subdirectories (`Subdir1`, `Subdir2`, `Subdir3`) to a new folder. But I only want to copy `fo1` and `fo2` folders in the new place. Not sure how could it be done.


TexLive and RHEL 6 — can I install 2011 *in addition* to 2007?

Our environment is Red Hat Enterprise Linux 6. By default, RHEL 6 comes with a version of TexLive from 2007. A user would like one of the extensions to TexLive ("PDFTex") to be updated. From everything I can find, the only way to accomplish this is to update TexLive as a whole. There's an "unofficial" repo online for TexLive 2011, which works with RHEL 6: http://jnovy.fedorapeople.org/texlive/2011/packages.el6/ I added this repo to my personal computer and installed it (all 960 packages!). It forcefully erased any trace of 2007. And for all intents and purposes...it appears to be working. However, we have hundreds of users of varying levels of technical knowledge. While it may appear to be fine for me (who has no idea how to really do anything with LateX), it's not realistically possible for me to test all 960 packages, while also confirming one by one that some feature someone may have relied on in the 2007 version didn't get implicitly canned or changed in the later version. Therefore I can't justify installing it to the network just yet. Is there any way that I can install all 960 packages in a completely isolated and independent location, so that the 2007 version can remain unchanged, while also giving users the chance to check out and informally act as testers for the 2011 version? I'm quite new at this so if I should provide any further or more detailed information, please let me know what.


Split tmux windows with same keys as in Emacs?

In emacs, you split a window with `C-x 2` (one above the other) or `C-x 3` (one next to the other). How can I get the same key bindings in `tmux`? Also, once a window is split, in emacs you cycle through them with `C-x o`. Can I configure `tmux` to use the same key?


Permit root to login via ssh only with key-based authentication

I have some doubts about certain ssh server configurations on `/etc/ssh/sshd_config`. I want the next behavior:   1. Public key authentication is the only way to authenticate as root (no password authentication or other)   2. Normal users can use both (password and public key authentication) If I set `PasswordAuthentication no` my first point is satisfied but not the second. There is a way to set `PasswordAuthentication no` only for root?


Adding more Emacs-like bindings to ZSH's line editor (ZLE)

I have a couple of questions regarding the emacs-like keyboard bindings in Zsh. As background to all the questions: I have Emacs-like keybinding activated with `bindkey -e` (activated by default) ### Copying and region highlighting: In Emacs, if you run `C-space` (`set-mark`), select a region and then copy it using `M-w`, Emacs puts the region in the kill ring and stops selecting text (i.e. if I move the point, no more text is selected). However, I can't get the same behavior in ZLE. Once I copy a region with `M-W`, the selection mode is still on, and if I move my cursor, the selection keeps changing. ### Stop selection: In Emacs, if I am selecting a region, and press `C-g`, the selection stops (the current mark is killed). In Zsh, by default, `C-g` starts a new line in the shell. So is there a ZLE command that I can bind to (maybe using something different from `C-g`) to stop an ongoing selection?


Auto indent / format code for Vim?

I'm trying to use Vim more and more when I can. One of my biggest grip between Vim and an IDE like Aptana is the ability to auto indent. Is there a means of auto formatting code (HTML, CSS, PHP) so it is properly indented? If so how do you install this into vim? I don't understand plugins very much. I tried reviewing this thread and it confused me more: How to change vim auto- indent behavior?


Emacs M-h selects paragraph + an extra line

In Emacs, when I type `M-h` (`mark-paragraph`), Emacs selects the paragraph under point plus an extra line (typically right above the paragraph). Is there a way to ask Emacs to just select the paragraph? **Note:** I have noticed this behavior under `shell-script-mode`, but haven't checked if it occurs with other major modes.


Can't get Hurricane Electric IPv6 tunnel to work on Fedora

I have recently moved to a university where all computers get a public IPv4 address. Since the teredo tunnel I was using doesn't work anymore and I have a public address, I am wanting to use Hurricane Electric's tunnel broker service on my Fedora 15 Gnome machine. I've already configured HE with my information and am just trying to get it working in Fedora. I'm using a modified configuration script from the Fedora Wiki (which didn't work without modifications). My `/etc/sysconfig/network` config:               NETWORKING=yes     HOSTNAME=quackpad-fedora     NTPSERVERARGS=iburst     NETWORKING_IPV6=yes     IPV6INIT=yes     IPV6_DEFAULTDEV=he-ipv6     IPV6_DEFAULTGW=2001:470:1f10:11d0::1/64   # Server IPv6 Address      And my `/etc/sysconfig/network-scripts/ifcfg-he-ipv6`               DEVICE=he-ipv6     BOOTPROTO=none     ONBOOT=yes                              IPV6INIT=yes     IPV6TUNNELIPV4=209.51.181.2        # Server IPv4 address     IPV6TUNNELIPV4LOCAL=***.***.*.***  # My IPv4 address     IPV6ADDR=2001:470:1f10:11d0::2/64  # Client IPv6 address      If I do `sudo ifup he-ipv6` I get (why does ifup-eth care about that?)                ERROR    : [/etc/sysconfig/network-scripts/ifup-eth] Device he-ipv6 does not seem to be present, delaying initialization.      If I do `sudo service network restart`               Sep  1 18:15:07 quackpad-fedora NetworkManager[938]: <warn> connection /org/freedesktop/NetworkManager/Settings/1 failed to activate: (2) Device not managed by NetworkManager or unavailable     Sep  1 18:15:07 quackpad-fedora NetworkManager[938]: <warn> connection /org/freedesktop/NetworkManager/Settings/2 failed to activate: (2) Device not managed by NetworkManager or unavailable     Sep  1 18:15:08 quackpad-fedora /etc/sysconfig/network-scripts/ifup-eth: Device he-ipv6 does not seem to be present, delaying initialization.     Sep  1 18:15:08 quackpad-fedora NetworkManager[938]: <warn> connection /org/freedesktop/NetworkManager/Settings/0 failed to activate: (2) Device not managed by NetworkManager or unavailable     Sep  1 18:15:08 quackpad-fedora systemd[1]: network.service: control process exited, code=exited status=1     Sep  1 18:15:08 quackpad-fedora systemd[1]: Unit network.service entered failed state.      What am I doing wrong here? Why do these keep failing?


How does this bash statemnet test ".$TOMCAT_USER" = . && TOMCAT_USER=tomcat work?

I am trying to understand the tomcat daemon.sh script which contains a bunch of lines along the lines `test ".$TOMCAT_USER" = . && TOMCAT_USER=tomcat` I figured out that `test ".$TOMCAT_USER" = . && TOMCAT_USER=tomcat` checks if an environment variable TOMCAT_USER is already defined if so it uses it and if not it uses the default value of tomcat What I understand is the how the statement is evaluated by bash. I am a bash scripting noob. I am looking for a step by step explanation of how this statement works.


Upgrading error

When I do apt-get update // apt-get upgrade i received this error whatever I do:               root@debian:~# apt-get upgrade     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:      curl : Depends: libcurl3 (= 7.26.0-1+wheezy3) but 7.21.0-2.1+squeeze2 is installed      multiarch-support : Depends: libc6 (>= 2.13-5) but 2.11.3-4 is installed     E: Unmet dependencies. Try using -f.     root@debian:~#      This is not my server so I don´t know what is installed inside, the only thing I know is that I need to upgrade the php from 5.2 minimum to 5.3. The told me that Zend Server is installed but I don´t know which version either. The first thing I tried is this and everytime I get this error. cat /etc/issue says: Debian GNU/Linux 6.0 \n \l This is my /etc/apt/sources.list:               root@debian:~# cat /etc/apt/sources.list          # deb cdrom:[Debian GNU/Linux 6.0.6 _Squeeze_ - Official i386 NETINST Binary-1 20120930-15:55]/ squeeze main          #deb cdrom:[Debian GNU/Linux 6.0.6 _Squeeze_ - Official i386 NETINST Binary-1 20120930-15:55]/ squeeze main          deb http://ftp.es.debian.org/debian/ squeeze main     deb-src http://ftp.es.debian.org/debian/ squeeze main          deb http://security.debian.org/ squeeze/updates main     deb-src http://security.debian.org/ squeeze/updates main          # squeeze-updates, previously known as 'volatile'     deb http://ftp.es.debian.org/debian/ squeeze-updates main     deb-src http://ftp.es.debian.org/debian/ squeeze-updates main     deb http://ftp2.de.debian.org/debian squeeze main non-free     deb http://repos.zend.com/zend-server/deb server non-free     root@debian:~#      and this is my output using apt-get install -f curl:               root@debian:~# apt-get install -f curl     Reading package lists... Done     Building dependency tree     Reading state information... Done     curl is already the newest version.     You might want to run 'apt-get -f install' to correct these:     The following packages have unmet dependencies:      curl : Depends: libcurl3 (= 7.26.0-1+wheezy3) but 7.21.0-2.1+squeeze2 is to be installed      multiarch-support : Depends: libc6 (>= 2.13-5) but 2.11.3-4 is to be installed     E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).


GRUB error Fedora 15 when Dual Booting on MacBook Pro

I am having trouble getting Fedora 15 running on my MacBook Pro. I had Fedora 15 installed before on this MBP before, so I know it works. I basically followed the good old instructions of   1. Create a Windows partition in bootcamp (rEFIt was already installed from trying to get ubuntu running)   2. Boot from disk and install in Windows partition with bootloader on installed on the / partition   3. Install, reboot, and resync the MBR using rEFIt partitioning tool   4. Shut down the computer and start up on the parition you installed linux on Now I get a grub error:               error file not found     grub rescue>      Another weird thing is that I have two Linux boot instances showing up in rEFIt, but that is just a rEFIt issue. Any recommendation on what do to? EDIT: It seems like the error message is GRUB 2 error message and so that seems to lurking around somewhere, problem has been there since I formatted the drives. Any ideas?


How to build a custom kernel with localmodconfig that support hardware of multiple machines?

When configuring a server to run a single task, like an appliance, there might rise the need to build a custom kernel. For example to save disk space. > _Ubuntu Core 13.10 amd64 root filesystem is a **38 MB** download, where the > "linux-image-generic" meta package including required dependencies will > download **79 MB** of archives, and the size of a kernel-image-x.y.z-generic > package is still **14 MB**._ For building a kernel that is stripped from modules that your hardware will not use, the `make localmodconfig` command is the right tool for the job. However your virtual machine that runs your build and test environment loads different modules than your target deployment hardware. And/or after a while your deployment hardware might become eol, and different hardware is used. And at the frequency where kernel updates are released it might become too cumbersome to build a custom kernel for every different hardware configuration. How to quickly build a custom Linux kernel that runs on a few different hardware boxes?


Thinkpad T400: Suspend to HD doesn't resume

I've got a Thinkpad T400 with Gentoo Linux installed. Suspend-to-RAM works like a charm. However, Susped-to-Disk doesn't work: if I suspend, the Laptop powers down and accesses the HD for around 30s. However, if I switch it back on, it just boots as normal, but doesn't resume to the previous state. Here's the `/var/log/pm-suspend.log` just before the suspend:               Sun Oct 21 14:16:44 CEST 2012: Finished.     Initial commandline parameters:      Blacklisting 01grub.     Sun Oct 21 15:26:06 CEST 2012: Running hooks for hibernate.     Running hook /usr/lib64/pm-utils/sleep.d/00logging hibernate hibernate:     Linux rgs-lenovo 3.4.9-gentoo #1 SMP Fri Aug 31 18:55:03 CEST 2012 x86_64 Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz GenuineIntel GNU/Linux     Module                  Size  Used by     cdc_wdm                 8704  0      cdc_acm                14890  0      rfcomm                 21490  0      bnep                    9782  0      btusb                  10904  0      bluetooth             162465  5 rfcomm,bnep,btusb     mmc_block              16408  0      nls_iso8859_1           4521  0      nls_cp850               5362  0      vfat                    8384  0      fat                    45316  1 vfat     twofish_x86_64_3way    19478  0      lrw                     3622  1 twofish_x86_64_3way     twofish_x86_64          5539  1 twofish_x86_64_3way     twofish_common         14649  2 twofish_x86_64_3way,twofish_x86_64     aes_x86_64              7768  0      aes_generic            26983  1 aes_x86_64     xts                     2912  1 twofish_x86_64_3way     gf128mul                7431  2 lrw,xts     dm_crypt               13973  0      dm_mod                 62853  1 dm_crypt     rndis_host              6143  0      cdc_ether               4584  1 rndis_host     usbnet                 17584  2 rndis_host,cdc_ether     arc4                    1345  2      sdhci_pci              10056  0      sdhci                  20883  1 sdhci_pci     firewire_ohci          27077  0      mmc_core               82856  3 mmc_block,sdhci_pci,sdhci     firewire_core          49742  1 firewire_ohci     crc_itu_t               1635  1 firewire_core     iwlwifi               233406  0      snd_hda_codec_conexant    43770  1      mac80211              338064  1 iwlwifi     cfg80211              156724  2 iwlwifi,mac80211     snd_hda_intel          22760  4      snd_hda_codec          88731  2 snd_hda_codec_conexant,snd_hda_intel     snd_pcm                73911  3 snd_hda_intel,snd_hda_codec     snd_timer              18324  2 snd_pcm     snd_page_alloc          7332  2 snd_hda_intel,snd_pcm     loop                   15063  0      vboxnetflt             12915  0      vboxdrv              1759366  1 vboxnetflt     fuse                   60817  1      thinkpad_acpi          64233  0      snd                    59641  12 snd_hda_codec_conexant,snd_hda_intel,snd_hda_codec,snd_pcm,snd_timer,thinkpad_acpi                  total       used       free     shared    buffers     cached     Mem:       8062552    6417912    1644640          0     427824    4174720     -/+ buffers/cache:    1815368    6247184     Swap:     12582908          0   12582908          /usr/lib64/pm-utils/sleep.d/00logging hibernate hibernate: success.     Running hook /usr/lib64/pm-utils/sleep.d/00powersave hibernate hibernate:     Blacklisting 01grub.          /usr/lib64/pm-utils/sleep.d/00powersave hibernate hibernate: success.     Running hook /usr/lib64/pm-utils/sleep.d/01grub hibernate hibernate:          /usr/lib64/pm-utils/sleep.d/01grub hibernate hibernate: success.     Running hook /usr/lib64/pm-utils/sleep.d/49bluetooth hibernate hibernate:          /usr/lib64/pm-utils/sleep.d/49bluetooth hibernate hibernate: success.     Running hook /usr/lib64/pm-utils/sleep.d/75modules hibernate hibernate:          /usr/lib64/pm-utils/sleep.d/75modules hibernate hibernate: success.     Running hook /usr/lib64/pm-utils/sleep.d/90clock hibernate hibernate:          /usr/lib64/pm-utils/sleep.d/90clock hibernate hibernate: success.     Running hook /usr/lib64/pm-utils/sleep.d/94cpufreq hibernate hibernate:          /usr/lib64/pm-utils/sleep.d/94cpufreq hibernate hibernate: success.     Running hook /usr/lib64/pm-utils/sleep.d/95led hibernate hibernate:          /usr/lib64/pm-utils/sleep.d/95led hibernate hibernate: success.     Running hook /usr/lib64/pm-utils/sleep.d/98video-quirk-db-handler hibernate hibernate:     Kernel modesetting video driver detected, not using quirks.          /usr/lib64/pm-utils/sleep.d/98video-quirk-db-handler hibernate hibernate: success.     Running hook /usr/lib64/pm-utils/sleep.d/99video hibernate hibernate:          /usr/lib64/pm-utils/sleep.d/99video hibernate hibernate: success.     Sun Oct 21 15:26:08 CEST 2012: performing hibernate      In the `/var/log/syslog` I found the following line:               Oct 21 15:27:10 lenovo kernel: PM: Hibernation image not present or could not be loaded.      Here's my grub config:               title Gentoo Linux     root (hd0,0)     kernel /3.4.9-gentoo root=/dev/sda3 rootfstype=ext4 resume=swap:/dev/sda2 i915.modeset=1 fan_control=1      `/dev/sda2` is my swap partition. What could be wrong?


where is log file of Gnome 3?

I've just installed gnome3 on openSUSE 11.4 following these instructions but when from `kdm` I try to load gnome3, it just shows me a page saying that it cannot load and it doesn't give me any further information about what is the problem. Where should I look for log file that stores error messages?


Syntax errors in a bash script executed from tcsh

I wrote the line below in order to verify if the first or second fields of a list of numbers are equal to 146. I want to run the line from `tcsh`, with one line interpreted by `bash`. What's the problem here?               echo $numbers     146 146 0 16 16 10 42 12 10 32 32 3 2 32 26     tcsh          bash -c 'for i in 1 2; do if [ 146 = `echo $numbers | cut -f$i  -d' ' ` ]; then echo "NUM is OK "; fi done'      The errors:               ` ]; then echo "NUM is OK "; fi done: -c: line 0: unexpected EOF while looking for matching ``'     ` ]; then echo "NUM is OK "; fi done: -c: line 1: syntax error: unexpected end of file


supported 2014 distro with 2.6.x kernel

I'm cutting my teeth at putting together a Linux install for a PC104 board that supports <= kernel 2.6.x with a Disk-On-Chip. I've read up on Embedded.org and Yocto, but before I try compiling totally from source I'd like to try and use an available distro. Ubuntu 8.04 boots just fine from usb but I need sys/acl and zlib.h packages to build the mtd-tools binary that will allow me to mount the Disk-On-Chip. The universe/multiverse repos for hardy are now totally dead. Is there another distro the uses a 2.6.x kernel suitable for this task? Preferably one who's repos are not set to expire in the near future. Are all of the repos for Debian Etch still up? I'm open to a CentOS based solution as well.


How to add system alias?

I have this alias in my `.zshrc`:               alias grim='gvim --remote'      But this is not seen from ranger file manager, I believe that ranger runs a 'generic' shell skipping my `.zshrc`. I want to make this alias visible in every shell. I added it to `~/.profile` and to `/etc/zsh/zshrc` but no effect. To be specific a got this message:               /bin/sh: grim: not found


Chinese characters instead of Latin being written to file

When I run `sed` like this and print to a console everything is fine:               sed '/Q/{     s/Q//g     r /Users/ericbrotto/Desktop/question.txt     }' Commision.txt      But when I do this and output t a file:               sed '/Q/{     s/Q//g     r /Users/ericbrotto/Desktop/question.txt     }' Commision.txt > newFile      ...my new string (the one that was properly replaced in the previous output) now reads as a bunch of asian (I believe Mandarin) characters. Any ideas? This is a follow up problem to a question I posed earlier.


Turning an old computer into a network firewall

I have an old Dell Dimension with two ethernet cards, and I need to turn it into a firewall. I've tried FireStarter and IPCop, but I don't think I'm setting them up right. Here's the setup that I'm trying to accomplish: I need to have one ethernet card plugged directly into the modem, and the other ethernet card plugged into a 16-port switch/hub. Part of the problem is that I've never done this before and despite hours of Googling, I'm still not sure where to start. I don't need anything fancy or endlessly configurable - I just need some basic protection that I can tweak out later. The bottom line is that it's 10:45p, everyone else left the office at 5p, and I'm still trying to get this taken care of. Thanks in advance for any help.


How intelligent are unix utilities?

Unix utilities like sort, find, grep, diff et al are very handy to perform quick tasks, sometimes without writing any code at all. I wanted to know what algorithms do they internally use and how do intelligently decide a specific algorithm for a specific task? For example if sort gets a huge input file, will it use different algorithms for different data sizes? Does grep intelligently switch algorithms while searching different data sets?


Setting regions in a Screen session

I'm trying to get a 'Screen' with 4 tabs to split the screen into 4 regions. I'm running 4 instances of bfgminer. One instance per USB Hardware miner. Unfortunately it has to be this way. So I'm trying to get all 4 outputs on 1 screen. I am starting up screen with the following config file, to give me 4 tabs that I can switch between.                   screen -t  USB0         select 0         stuff "command /home/pi/Mining/bfgminer --scrypt -c miner.conf         screen -t USB1         select 1         stuff "command /home/pi/Mining/bfgminer --scrypt -c miner.conf         screen -t USB2         select 2         stuff "command /home/pi/Mining/bfgminer --scrypt -c miner.conf         screen -t USB3         select 3         stuff "command /home/pi/Mining/bfgminer --scrypt -c miner.conf              altscreen on         term screen-256color                                                   bind ','         prev                                                                           bind '.' next          #                                                                                #change the hardstatus settings to give an window list at the bottom of the             #screen, with the time and date and with the current window highlighted                 hardstatus alwayslastline                                                               #hardstatus string '%{= kG}%-Lw%{= kW}%50> %n%f* %t%{= kG}%+Lw%< %{= kG}%-=%c:%         hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%      I found it in an old post on here somewhere. And tweaked it a bit for my needs. From reading the Screen man pages, I think that the 'Regions' function should allow me to get all 4 tabs split on 1 screen instead of having to use `Ctrl`+`A`, `CTRL`+`,` just to look at the next screen. How can I get Screen to show all 4 instances of bfgminer, on one single screen? I'm going to be using ssh to get onto my Pi and check the miners from time to time, and it'll be a lot easier with only 1 logon, and screen to run.