Fedora 19 - Booting doesn't show login screen

I have done some common updates in my system, and now I have the following problem: It starts as usual, loading services, but when trying to launch the login screen (I use KDE), it stops and show me once more the starting services screen, where it blocks after some time. I could go to another tty, login as root and do the following commands:               init 3     init 5      And it starts as expected. But every time I restart, I have to do the same thing to see my desktop. I have seen my `/var/log/boot.log` file and I haven't seen anything unusual. There is it:               [  OK  ] Found device SAMSUNG_HD204UI.     [  OK  ] Found device SAMSUNG_HD204UI.     [  OK  ] Found device SAMSUNG_HD204UI.     [  OK  ] Started dracut initqueue hook.              Mounting /sysroot...     [  OK  ] Started Show Plymouth Boot Screen.     [  OK  ] Reached target Paths.     [  OK  ] Reached target Basic System.     [  OK  ] Mounted /sysroot.     [  OK  ] Reached target Initrd Root File System.              Starting Reload Configuration from the Real Root...     [  OK  ] Started Reload Configuration from the Real Root.     [  OK  ] Reached target Initrd File Systems.     [  OK  ] Reached target Initrd Default Target.          Welcome to [0;34mFedora 19 (Schrödinger’s Cat)!          [  OK  ] Stopped Switch Root.     [  OK  ] Stopped target Switch Root.     [  OK  ] Stopped target Initrd File Systems.     [  OK  ] Stopped target Initrd Root File System.              Starting Collect Read-Ahead Data...              Starting Replay Read-Ahead Data...     [  OK  ] Reached target Login Prompts.     [  OK  ] Reached target Remote File Systems.     [  OK  ] Listening on Syslog Socket.     [  OK  ] Listening on Delayed Shutdown Socket.     [  OK  ] Listening on /dev/initctl Compatibility Named Pipe.              Mounting Debug File System...              Starting Create static device nodes in /dev...     [  OK  ] Set up automount Arbitrary Executable File Formats F...utomount Point.              Mounting Huge Pages File System...              Mounting POSIX Message Queue File System...     [  OK  ] Listening on udev Kernel Socket.     [  OK  ] Listening on udev Control Socket.              Starting udev Coldplug all Devices...     [  OK  ] Listening on LVM2 metadata daemon socket.     [  OK  ] Listening on Device-mapper event daemon FIFOs.              Starting Monitoring of LVM2 mirrors, snapshots etc. ...ress polling...              Expecting device dev-disk-by\x2duuid-06995479\x2d888...de5ee.device...              Mounting Temporary Directory...              Expecting device dev-disk-by\x2duuid-f88e071f\x2ddb3...1d57c.device...              Expecting device dev-disk-by\x2duuid-5c6ae9c2\x2d610...c99fb.device...              Expecting device dev-disk-by\x2dlabel-Documentos.device...              Expecting device dev-disk-by\x2dlabel-Programas.device...              Expecting device dev-disk-by\x2dlabel-Extra.device...     [  OK  ] Stopped Trigger Flushing of Journal to Persistent Storage.              Stopping Journal Service...     [  OK  ] Stopped Journal Service.              Starting Journal Service...     [  OK  ] Started Journal Service.     [  OK  ] Started Collect Read-Ahead Data.     [  OK  ] Started Replay Read-Ahead Data.              Starting Load legacy module configuration...              Starting File System Check on Root Device...              Starting Apply Kernel Variables...              Mounting Configuration File System...              Starting Set Up Additional Binary Formats...              Starting LVM2 metadata daemon...     [  OK  ] Mounted Temporary Directory.     [  OK  ] Mounted Configuration File System.     [  OK  ] Mounted Debug File System.     [  OK  ] Mounted Huge Pages File System.     [  OK  ] Mounted POSIX Message Queue File System.     [  OK  ] Started udev Coldplug all Devices.              Starting udev Wait for Complete Device Initialization...              Mounting Arbitrary Executable File Formats File System...     [  OK  ] Started LVM2 metadata daemon.     [  OK  ] Started Apply Kernel Variables.     [  OK  ] Started Load legacy module configuration.     [    8.501835] systemd-fsck[261]: Fedora_19: clean, 964326/4825088 files, 8824281/19283456 blocks     [  OK  ] Started File System Check on Root Device.              Starting Remount Root and Kernel File Systems...     [  OK  ] Started Remount Root and Kernel File Systems.              Starting Configure read-only root support...     [  OK  ] Started Monitoring of LVM2 mirrors, snapshots etc. u...ogress polling.     [  OK  ] Mounted Arbitrary Executable File Formats File System.     [  OK  ] Started Set Up Additional Binary Formats.     [  OK  ] Started Create static device nodes in /dev.              Starting udev Kernel Device Manager...     [  OK  ] Started udev Kernel Device Manager.     [  OK  ] Reached target Local File Systems (Pre).     [  OK  ] Started Configure read-only root support.              Starting Load Random Seed...     [  OK  ] Started Load Random Seed.     [  OK  ] Started udev Wait for Complete Device Initialization.              Starting Activation of DM RAID sets...     [  OK  ] Reached target Sound Card.     [  OK  ] Started Activation of DM RAID sets.     [  OK  ] Reached target Encrypted Volumes.     [  OK  ] Found device SAMSUNG_HD204UI.              Activating swap /dev/disk/by-uuid/06995479-888f-4e3f...99fa3c5de5ee...     [  OK  ] Found device SAMSUNG_HD204UI.              Starting File System Check on /dev/disk/by-uuid/5c6a...d143aacc99fb...     [  OK  ] Found device SAMSUNG_HD204UI.              Starting File System Check on /dev/disk/by-uuid/f88e...fe923f01d57c...     [  OK  ] Activated swap /dev/disk/by-uuid/06995479-888f-4e3f-b62c-99fa3c5de5ee.     [  OK  ] Reached target Swap.     [   12.871604] systemd-fsck[375]: /dev/sda7: clean, 89896/2411920 files, 3370321/9640192 blocks     [  OK  ] Found device SAMSUNG_HD204UI.              Mounting /media/Documentos...     [  OK  ] Found device SAMSUNG_HD204UI.              Mounting /media/Extra...     [  OK  ] Started File System Check on /dev/disk/by-uuid/5c6ae...d-d143aacc99fb.              Mounting /home...     [   13.813950] systemd-fsck[379]: BOOT: clean, 374/64768 files, 28850/258822 blocks              Mounting FUSE Control File System...     [  OK  ] Mounted FUSE Control File System.     [  OK  ] Found device SAMSUNG_HD204UI.              Mounting /media/Programas...     [  OK  ] Started File System Check on /dev/disk/by-uuid/f88e0...4-fe923f01d57c.              Mounting /boot...     [  OK  ] Mounted /boot.     [  OK  ] Mounted /home.     [  OK  ] Mounted /media/Documentos.     [  OK  ] Mounted /media/Extra.     [  OK  ] Mounted /media/Programas.     [  OK  ] Reached target Local File Systems.              Starting Security Auditing Service...              Starting Recreate Volatile Files and Directories...              Starting Tell Plymouth To Write Out Runtime Data...              Starting Trigger Flushing of Journal to Persistent Storage...     [  OK  ] Started Security Auditing Service.     [  OK  ] Started Trigger Flushing of Journal to Persistent Storage.     [  OK  ] Started Tell Plymouth To Write Out Runtime Data.     [  OK  ] Started Recreate Volatile Files and Directories.     [  OK  ] Reached target System Initialization.     [  OK  ] Reached target Timers.              Starting Manage Sound Card State (restore and store)...     [  OK  ] Started Manage Sound Card State (restore and store).     [  OK  ] Reached target Paths.     [  OK  ] Listening on Open-iSCSI iscsiuio Socket.     [  OK  ] Listening on Open-iSCSI iscsid Socket.     [  OK  ] Listening on RPCbind Server Activation Socket.     [  OK  ] Listening on PC/SC Smart Card Daemon Activation Socket.     [  OK  ] Listening on CUPS Printing Service Sockets.     [  OK  ] Listening on D-Bus System Message Bus Socket.     [  OK  ] Reached target Sockets.     [  OK  ] Reached target Basic System.              Starting firewalld - dynamic firewall daemon...              Starting Network Manager Script Dispatcher Service...              Starting Hardware RNG Entropy Gatherer Daemon...     [  OK  ] Started Hardware RNG Entropy Gatherer Daemon.              Starting irqbalance daemon...     [  OK  ] Started irqbalance daemon.              Starting NTP client/server...              Starting ABRT Automated Bug Reporting Tool...     [  OK  ] Started ABRT Automated Bug Reporting Tool.              Starting ABRT Xorg log watcher...     [  OK  ] Started ABRT Xorg log watcher.              Starting Builds and install new kmods from akmod packages...              Starting ABRT kernel log watcher...     [  OK  ] Started ABRT kernel log watcher.              Starting Machine Check Exception Logging Daemon...              Starting Install ABRT coredump hook...              Starting Builds and install new kmods from akmod packages...              Starting Self Monitoring and Reporting Technology (SMART) Daemon...     [  OK  ] Started Self Monitoring and Reporting Technology (SMART) Daemon.              Starting Login Service...              Starting RealtimeKit Scheduling Policy Service...              Starting Accounts Service...              Starting Permit User Sessions...              Starting RPC bind service...              Starting CUPS Printing Service...     [  OK  ] Started CUPS Printing Service.              Starting System Logging Service...     [  OK  ] Started System Logging Service.              Starting D-Bus System Message Bus...     [  OK  ] Started D-Bus System Message Bus.     [  OK  ] Started Machine Check Exception Logging Daemon.     [  OK  ] Started Permit User Sessions.              Starting Command Scheduler...     [  OK  ] Started Command Scheduler.              Starting Job spooling tools...     [  OK  ] Started Job spooling tools.              Starting Wait for Plymouth Boot Screen to Quit...     [  OK  ] Started Install ABRT coredump hook.     [  OK  ] Started RPC bind service.     [  OK  ] Started NTP client/server.     [  OK  ] Started RealtimeKit Scheduling Policy Service.     [  OK  ] Started Network Manager Script Dispatcher Service.     [  OK  ] Started Login Service.     [  OK  ] Started Builds and install new kmods from akmod packages.     [  OK  ] Started Builds and install new kmods from akmod packages.              Starting The KDE login manager...     [  OK  ] Started The KDE login manager.     [  OK  ] Started Accounts Service.              Starting Authorization Manager...      What should I do to solve my problem? Sorry for my bad english. **Edit:** I can start without problems with GDM. The problem should be in KDM.


"install" command as script

I'm working on a heavily modified Linux based OS targeted for a really specific environment - easy-to-use NAS systems. It does not provide any GUI, apart from a web interface, but it at least has SSH. I'm trying to run a manual package build (as far as "./configure && make" is manual), but it fails at one specific point - it cannot find the install command. As the platform misses a multitude of otherwise essential and default Linux commands, I'm not surprised by this, but by the fact that a good half- hour search resulted in no hits about how to replace it. Seriously, nobody ever thought about having a simple bash script that has the same functionality? So question is - how to replace "install"? Is there any script or executable that does the exact same, on x86/bromolow platform (or platform- independently)?


Text processing for words connected by hyphen

I have text files (*.txt) which I process, I want to find words connected by hyphen such as "drug-associated" or "drug-linked", "drug-related". I need your help to convert the first one to "associated with drug" and the second one convert it to "linked with drug" instead. In one file I could have many of those, one time it is "associated", "linked", "related" and could have other terms.


Why is swappiness set to 60 by default?

I just read some stuff about swappiness on Linux. I don't understand why the default is set to 60. According to me this parameter should be set to 10 in order to reduce swap. Swap is on my hard drives so it us much slower than my memory. Why did they configure the kernel like that?


Can pf be used to modify HTTP Headers and Contents?

I'm looking at options to replace my router with something that offers me more options for content filtering and also content modification. One of the things that I want to do is to modify HTTP Requests, e.g. Add or Remove certain Headers or the contents of the body (e.g., to remove any references to `ga.js`). Also, I want to block access to certain sub-paths of a domain, e.g. block `twitter.com/widgets` without blocking the main `twitter.com` website (in which case a custom DNS that returns 0.0.0.0 would do the job) I'm wondering if PF on OpenBSD can do that, or if it's too low level and if I need a higher level tool like a proxy. The problem with using a proxy is that it's not transparent for clients and thus doesn't help e.g. protecting my phone while it's on my WiFi.


Supply input to a program with a password prompt

Is there any Linux command which supplies multiple enter keys to another process which is running in a terminal till the other process dies? For example consider the command `yes ' ' | ./ssr-sim prepare`. I need a command on the LHS side of the pipe(`|`). For example instead of `yes ' '` on the left of `|`, another command which supplies multiple enter keys to the `./ssr-sim prepare` on the right side. I wanted to automate enter keys inside a shell script and the command `./ssr- sim prepare` produces output which asks for password multiple number of times and the user needs to manually press the `Enter` key every time (no need to give password here, only press `Enter` each time when it asks for password). I need to automate that pressing of enter key part.   The command `yes ' ' | ./ssr-sim prepare` is not working.


What exactly is the lwp and threads in solaris?

The book "Solaris Internals" says Solaris executes kernel threads for kernel-related tasks, such as interrupt handling, memory page management, device drivers, etc. For user-process execution, kernel threads have a corresponding LWP; these kernel threads are scheduled for execution by the kernel on behalf of the user processes I am a little confused about the words and below is my understanding In solaris, the " **real thread** " is the " **kernel thread** ". The kernel threads can execute kernel-related tasks and user-related tasks. When execute user-related tasks, the kernel thread needs a data structure called LWP to provide the environment. So, the **user thread** and **LWP** are not the execution unit or thread at all. They are just data structres in the system. The **user thread** is just the user task needed to be executed which includes the user data and code. The LWP is the kernel data structure providing the kernel infomation. The real execution unit or flow is **kernel thread**. Provided my understanding is correct, in the early solaris where two-level thread model exists, many user threads can be bound to one lwp which means that in the underlying implementation of solaris the " **many user thread** " are really one thread(kernel thread) to the kernel or CPU and the only kernel thread executes the tasks in each user thread in turn. If the user thread is unbound it can not be executed. Am I right?


Phusion Passenger not working with Apache while installing redmine

I am trying to install redmine (which is a ruby app ) in my arch system. But I am not able to fire up the app as it gives me the error for phusion passenger. ![enter image description here](http://i.stack.imgur.com/as0Ko.jpg)


Postfix - unable to send mails to Internet (i.e. Gmail)

I've set up postfix (Debian) and it works fine. I can recieve mail and I can send them, but I can only send them to local (and local virtual) adresses. But when I try to send the mail for example to my Gmail account, I get this in syslog:               Jun 30 18:34:44 vps postfix/smtpd[9087]: NOQUEUE: reject: RCPT from vps[77.93.223.122]: 554 5.7.1 <hrdina.pavel@gmail.com>: Relay access denied; from=<info@w-cms.cz> to=<hrdina.pavel@gmail.com> proto=ESMTP helo=<localhost.localdomain>      I've googled a lot but I did figure it out thought. I think that something is wrong with my* directives. Here are mine:               myhostname = mail.xxx.cz     alias_maps = hash:/etc/aliases     alias_database = hash:/etc/aliases     myorigin = /etc/mailname     mydestination = xxx.cz, vps, localhost.localdomain, localhost     relayhost =     mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128


Count distinct values of a field in a file

I have a file contains around million number of lines. In the lines I have a field called transactionid, which has repeatitive values. What I need to do is to count them distinctly. No matter of how many times a value is repeated, it should be counted only once. Can you help with a way.


Substring failing in shell script

for file in *.csv     do       split -n 5 -d -a 1  "$file" "$file"       for each in $(seq -w 2 3)       do             echo $each             filestem="$file$each"             len_filestem=${#filestem}             subs=substr(len_filestem,3,4)             echo $subs             echo $filestem       #awk '{filename = "wrd." int((NR-1)/10000) ".txt"; print >> filename}' $file--$each       awk -v filestem= "{$filestem}" '{filename = substr(filestem,3,5};  print >> filename}' $filestem            done     done      Im trying to find the substring of a string but my script is failing in substr(len_filestem,3,4)


Sort a text file according to a character within a field

I have a file named : `newfile` which consist of the following data               1 AC BB CC     2 AB CC DD     3 CA BB CC     4 BE DD EE     5 BD AA AA      I type the following command in bash to sort the data according to the second character, second field > sort -k3 newfile I expected the following results               3 CA BB CC     2 AB CC DD     1 AC BB CC     5 BD AA AA     4 BE DD EE      why am i getting the following results and how am i suppose to solve according to the third character (ignoring the blank)               5 BD AA AA     1 AC BB CC     3 CA BB CC     2 AB CC DD     4 BE DD EE


Mint Linux Wireless Issues

as I understand it LMDE is built based upon Ubuntu; and I did not receive much help from the official Linux Mint forum, so I've decided to post here. My problem started yesterday, when I installed LMDE for the first time. Everything ran smoothly, up until I got to configuring my wireless. The first wireless network was a breeze to configure. I was able to join and it worked fine. That day, when I went to school... I found I was unable to actually join any other networks. If I selected a network in the list, it would unselect itself. I eventually diagnosed the problem as the fact that it was always trying to join my home network. The file at etc/NetworkManager/system-connections was labeled "AUTO (My home network's name)"... so, using 'sudo rm etc/NetworkManager/system-connections/"Auto (My home network's name)" ', I removed that file hoping it would fix my issue. What I found, however is that the problem has persisted through this "fix", and I can still not join any networks. I found the Network Connections app, and when I went to the "Wireless" tab, then hit the "Add network" button... all the options are blanked out. If I use the "echo $UID" prompt, I am told I am the first user (user 1000) on the disk... so I'm at a loss. Is there any way of reconfiguring my wireless files all over again, or regaining control of my Network Connections application?


Commercial support for CentOS

As you know CentOS is taken over by RedHat, so i boils out couple of points as mentioned here.   * Will CentOS remain complete free as it was(is) before(now)?   * Can we expect upgrades of CentOS in future, as and when RHEL new version is released.?   * Will RHEL make it enterprise version? What are the organizations that provide commercial support for CentOS? Redhat has said they are not going to provide commercial support for CentOS.


Which is the real PATH variable

On my office computer it seems like I've have two PATH variables. > $path : This is delimited by " " (Space) > > $PATH : This is delimited by ":" (Colon) Though when I update one, the other one gets updated as well. Is this the normal behavior in Linux or is there something wierd going on in my machine? Should I keep them both, or delete one of them? **Edit:** I'm using csh, I found this because some of my colleagues were updating the "path" variable, while others did it with "PATH". Though I deleted all occurences of updating "PATH" in my .cshrc, it still appears when I try to echo them.


Systemd Unit for reconnecting wireless on failure

I have a systemd service called conWlan0.service which establishes WiFi connection. Now I want to create another Unit which periodically checks the connection. Is this a reasonable start?               [Unit]     Description=...     After=conWlan0.service     OnFailure=conWlan0.service          [Service]     Type=simple     ExecStart=/usr/bin/checkWiFi     RestartSec=120     Restart=always      The checkWifi script exits 0 if everything is correct and an error code otherwise. Any suggestions?


How to extract a list of user accounts deleted from the system over a period of 1 year?

I'm auditing a Unix system and I would like to know how many user accounts were created and deleted over a 1 year period. Is there some way of getting this data from the Unix system?


Redirect SSH user server side

I know that I can create shortcuts for specific users/servers on the client side via `~/.ssh/config` or `/etc/ssh/ssh_config`, but I would like to do something similar but on the server side. That is, when I issue on the client:                ssh pub@name.server.top      I am actually chrooted to               /home/jon/pub      on `name.server.top` where I will use sftp. In `/etc/ssh/sshd_config` I have seen examples as the following:               Subsystem sftp internal-sftp     Match user pub         ChrootDirectory %h         ForceCommand internal-sftp         AllowTcpForwarding no      Will also the following work?                   ChrootDirectory /home/jon/pub      Is it possible to create the `pub` as a sort of virtual user? That is, the remote user logs as `pub` and his public key is in `/home/jon/.ssh/authorized_keys`, so without the hassle of creating a separate `/home/pub/.ssh/authorized_keys` or the `/home/pub` directory at all.


NOR flash CFI MTD driver troubles with JFFS2 mtdblock

## Context I'm developing a linux 2.6.32 MTD driver for a NOR flash S29GL064N compatible with CFI command set 0002. My driver has the same mapping than the SBC_GXX but with only one partition used as data. Actually, the hardware contains two 8MB NOR flashs accessed through a 8 bits ISA bus via a CPLD that provides a physical addresses 16 KiB window (0xdc000-0xdffff) and two registers bytes (14 bits) for page selection. So the flashes are seen as a unique one in addressing.               S29GL064N flash: IO:0x258-0x259 MEM:0xdc000-0xdffff     S29GL064N flash: Found 1 x16 devices at 0x0 in 8-bit bank     S29GL064N flash: Found 1 x16 devices at 0x800000 in 8-bit bank     S29GL064N flash: CFI does not contain boot bank location. Assuming top.     Creating 1 MTD partitions on "S29GL064N flash":     0x000000000000-0x000001000000 : "S29GL64N flash partition"      As the flash should be used with JFFS2 file system, I have activated block device access. So I see the devices `/dev/mtd0` and `/dev/mtdblock0`. I can format in JFFS2 `flash_eraseall -j /dev/mtd0` and mount the device block `mount /dev/mtdblock0 /mnt/mtd -t jffs2`. Then I can use the partition to copy data to/from it. ## Problems:   1. **Half space taken into account using`df`** For instance, when copying a file of 2MB, the `df` sees 1MB used space while `du` proides the good size.               # du -h /mnt/mtd/     1.0M    /mnt/mtd/     # df -h     /dev/mtdblock0         16M  1.1M   15M   7% /mnt/mtd     # cp tstfile_2M /mnt     # du -h /mnt/mtd/     3.0M    /mnt/mtd/     # df -h     /dev/mtdblock0         16M  2.1M   14M  13% /mnt/mtd        2. **Copying big file accross the two flashes crashes the system** If I copy small files (1 or 2 MB) while crossing the 8MB, there is no problem. If a big file, let's say 6MB is copied and crosses the two flashs, the system will crash:               # du -h /mnt/mtd/     5.0M    /mnt/mtd/     # cp tstfile_6M /mnt/mtd     BUG: unable to handle kernel paging request at 840f2c40     IP: [<c01408a3>] __rmqueue+0xe3/0x2c0     *pde = 00000000      Oops: 0002 [#1]      last sysfs file: /sys/devices/virtual/net/lo/operstate     Modules linked in:          Pid: 3601, comm: cp Not tainted (2.6.32.63-custom #16)      EIP: 0060:[<c01408a3>] EFLAGS: 00000083 CPU: 0     EIP is at __rmqueue+0xe3/0x2c0     EAX: c1398018 EBX: 0000000a ECX: 840f2c3c EDX: c045ca28     ESI: c045ca18 EDI: c13a7ff8 EBP: df9bfcc8 ESP: df9bfc90      DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068     Process cp (pid: 3601, ti=df9be000 task=df950000 task.ti=df9be000)     Stack:      00000000 00000002 00000000 c045c820 c1398000 00000001 df9bfd1c c0230a4d     <0> 00000001 df9ac1d8 00000368 00000015 c045c820 c13a7ff8 df9bfd2c c0141a5c     <0> 00000001 00000041 df185540 c045c83c 00000001 00000000 00000000 000201da     Call Trace:      [<c0230a4d>] ? deflate_fast+0x23d/0x270      [<c0141a5c>] ? get_page_from_freelist+0xdc/0x3a0      [<c0141df0>] ? __alloc_pages_nodemask+0xd0/0x4f0      [<c0143db2>] ? __do_page_cache_readahead+0xb2/0x1c0      [<c0143ee8>] ? ra_submit+0x28/0x40      [<c01440cd>] ? ondemand_readahead+0xed/0x1b0      [<c01441f3>] ? page_cache_async_readahead+0x63/0xa0      [<c013ea2a>] ? generic_file_aio_read+0x37a/0x620      [<c01629cc>] ? do_sync_read+0xcc/0x110      [<c013c169>] ? __rcu_process_callbacks+0x69/0x350      [<c01274a0>] ? autoremove_wake_function+0x0/0x50      [<c011b00a>] ? irq_exit+0x2a/0x40      [<c01630f0>] ? vfs_read+0x90/0x120      [<c0162900>] ? do_sync_read+0x0/0x110      [<c016347d>] ? sys_read+0x3d/0x70      [<c0102c25>] ? syscall_call+0x7/0xb     Code: 04 75 d5 ff 4d e0 8b 45 e0 39 45 d0 7e ba c7 45 cc 03 00 00 00 e9 4c ff ff ff 8b 55 cc 8b 04 d6 8d 48 e8 89 4d d8 8b 08 8b 50 04 <89> 51 04 89 0a c7 40 04 00 02 20 00 c7 00 00 01 10 00 0f ba 70      EIP: [<c01408a3>] __rmqueue+0xe3/0x2c0 SS:ESP 0068:df9bfc90     CR2: 00000000840f2c40     ---[ end trace dfe13b27303ff46a ]---          Message from syslogd@debian at Fri Aug  8 02:13:57 2008 ...     debian kernel: last sysfs file: /sys/devices/virtual/net/lo/operstate          Message from syslogd@debian at Fri Aug  8 02:13:57 2008 ...     debian kernel: Oops: 0002 [#1]           Message from syslogd@debian at Fri Aug  8 02:13:57 2008 ...     debian kernel: Process cp (pid: 3601, ti=df9be000 task=df950000 task.ti=df9be000)          Message from syslogd@debian at Fri Aug  8 02:13:57 2008 ...     debian kernel: Stack:          Message from syslogd@debian at Fri Aug  8 02:13:57 2008 ...     debian kernel: Call Trace:          Message from syslogd@debian at Fri Aug  8 02:13:57 2008 ...     debian kernel: Code: 04 75 d5 ff 4d e0 8b 45 e0 39 45 d0 7e ba c7 45 cc 03 00 00 00 e9 4c ff ff ff 8b 55 cc 8b 04 d6 8d 48 e8 89 4d d8 8b 08 8b 50 04 <89> 51 04 89 0a c7 40 04 00 02 20 00 c7 00 00 01 10 00 0f ba 70           Message from syslogd@debian at Fri Aug  8 02:13:57 2008 ...     debian kernel: EIP: [<c01408a3>] __rmqueue+0xe3/0x2c0 SS:ESP 0068:df9bfc90          Message from syslogd@debian at Fri Aug  8 02:13:57 2008 ...     debian kernel: CR2: 00000000840f2c40     Killed      ## Request I don't know how to validate my driver, the `mtd_test` module works only with NAND flashes. I didn't find why the system crashes on that kind of copy and not in other way. I am looking for advices to know how to address my problems.


Vim Copy to System Clipboard without overwriting the defualt register(")

When I use `"+y` to copy to the system clipboard, the selected content is copied to the `+` register as well as the default(") register. How can I ensure that the content is copied only to the `+` register without modifying the `"` register? EDIT: I now understand that this is the intended behavior and any yanking will modify the default register. I still want to know whether there's a workaround for this. I have come with a naive solution for visual mode `vnoremap <Leader>y :<C-u>let @+=@*<CR>` and for single line in `nnoremap <Leader>yy :<C-u>let @+=getline('.') . "\n"<CR>` But we will be missing many yank features. I hope someone provides a better solution.


Find files in multiple directories taken from list in a file?

FreeBSD 9.2 RELEASE p2      I have a file `dirs.txt`. In this file is a new line separated directory list like so:               /etc     /home     /home/goods/      I need to first find in all directory's files which have names like "good" or contain string "(NODES_'TASK')" and then copy all these files into the directory `/tmp`. I think must be something like:               $ find $fromDirs.txt -type f -name 'good' | \         grep -lr '\(NODES_\'TASK\'\)' $fromDirs.txt | > /tmp


Is it harmful to close a terminal window without properly exiting an application?

Using Ubuntu 12.04 LTS, my question is that if I started an application in a terminal window, then is there anything bad about just closing the terminal window without exiting the application properly first. For example, I use MATLAB. I open up a terminal and type               matlab -nodisplay -nodesktop -nosplash      and then run a bunch of scripts. Then I can either               exit      to end MATLAB and then close the terminal window or just close the terminal window. What really is the difference between these two methods? Does the second method somehow "harm" anything? Is the first method preferred? Why?


Is it possible assigning an separate LAN IP to service/daemon?

I'm using `pfsense` for prioritizing traffic around LAN. It works well for specified port, IP, network, but I'm having a problem with torrent (transmission bittorrent) outbound connections. The outbound connections are random and no filter can be specified to slow them down if needed. So I was thinking was it possible to specify a virtual IP just for the transmission daemon so I could use separate rules just for that IP? The example would be:               Machine IP:          192.168.0.1     Transmission Daemon: 192.168.0.2      If not, what are the other solutions?


Netbeans has no display on my computer

I installed netbeans using `zypper install netbeans`. Trying to run it, I get the "loading" splash screen which is proceeded by a small popup which asks me if I want to register my copy and receive some benefits. Once that popup is gone, I'm left with a big beige screen and nothing else. It's almost like netbeans can't be displayed. Running `netbeans` from the command line does not give me any output or error messages. I also had this same issue when I was trying to install it using the `.sh` file found on their website. I'm running opensuse 11.4 with dwm as my window manager. I'm also using the AMD's fglrx graphics driver (I have also experienced this issue using the default open source driver shipped with opensuse). **EDIT** When trying to run `sudo netbeans`, I get:               /usr/share/netbeans/6.8/bin/../platform11/lib/nbexec: WARNING: environment variable DISPLAY is not set      And no display. This is not same behavior as when I launch as a regular user.


How can I wrap text at a certain column size?

I know that I can use something like `cat test.txt | pr -w 80` to wrap lines to 80 characters wide, but that puts a lot of space on the top and bottom of the printed lines and it does not work right on some systems What's the best way to force a text file with long lines to be wrapped at a certain width? Bonus points if you can keep it from breaking words.


Mount points in a chroot

I have some device (say `/dev/sda1`) mounted at `/home/user1`. I also have a full Linux system under `/tmp/chroot`, and the directory `/tmp/chroot/home` contains only one directory named `user2`. If I `chroot` inside `/tmp/chroot`, mount `/dev`, `/sys` and `/proc` there and issue the `mount` command (or `cat /proc/mounts`), I can still see `/dev/sda1` mounted at `/home/user1` whereas the directory `/home/user1` does not even exist anymore (in the chroot). I also tried with `jchroot` instead of `chroot` (this is a program with an interface similar to `chroot` but creating a new mount namespace and a new PID namespace), but the results are the same. Is this normal behaviour? It sounds weird that I can access information about mount points outside the chroot.   Is there a way to make them disappear from `/proc/mounts`?


When I try to run a cracked Call of Duty 2 server (I must mention here I HAVE BOUGHT the game, only my friends not) on my Ubuntu 12.04 instance I get the following error:               Inconsistency detected by ld.so: dl-version.c: 230: _dl_check_map_versions: Assertion `needed != ((void *)0)' failed!      I use this cod2_lnxded: http://www.gamecopyworld.com/games/pc_call_of_duty_2.shtml#Call of Duty 2 v1.3 PRIVATE LINUX SERVER + NO-WAIT PATCH The way I am trying to start the server:               ./cod2_lnxded +set fs_homepath srv +set fs_game fs +exec default_mp.cfg +set net_port 30126 +set dedicated 2 +set sv_maxclients 32 +set sv_punkbuster 1 +map_rotate      I googled few hours and I found that ld.so handles dynamic directories. What does this exactly mean? The other thing I found a lot of bugs have reported about ld.so and adviced somewhere one should downgrade it, but I did not managed to do this yet because I don't really want to crash my system... In addition I must mention I successfully started an original CoD2 server, only cracked not working.


Network connecting trouble shooting

I am trying to connect to the network of my school. With Windows 7 + IE it is not problem at all. I connect to it, no matter what web-page I try to reach, I get forwarded to               http://94.245.115.209:8000/index.php      then, have to login with a username/password and can navigate the web after login. Using Ubuntu 12 + Firefox or Konqueror I do not manage the second step. I think there is some security measure there that blocks me when the page tries to forward me after I input my username/password. There is no pop-up blocker or pop-ups at all and the browsers are configured to run any javascript. What else can I set to get rid of this problem?


xtightvnc through ssh gateway -- connection refused

Following setup: homepc -> gateway -> workpc               workpc:~$ tightvncserver :12          homepc:~$ ssh -N gatewayuser@gateway -L 1212:workpc:5912      Now I try to connect via               homepc:~$ xtightvncviewer localhost:1212     xtightvncviewer: VNC server closed connection      I also get the output for the tunnel               channel 2: open failed: connect failed: Connection refused      Any ideas? I searched the web, but didn't get it working with those as I didn't find the very same setup..


getting "//" after the URL

I'm running nginx web server. I have not written any rule to redirect abc.com to www.abc.com, I have just added both in server_name directive which looks like, server_name abc.com www.abc.com; My doubt is, when I hit the URL in browser, like abc.com it redirect to www.abc.com//. What does this "//" means ? Do I need to change anything in my nginx conf file ?


How do I write a retry logic in script to keep retrying to run it upto 5 times?

I want to write logic in shell script which will retry it to run again after 15 sec upto 5 times based on **_"status code=FAIL"_** if it fails due to some issue.


System proxy settings not taking effect on Kali (debian 6)

I'm in the process of trying to configure TOR on a Kali installation, as a system-wide SOCKS proxy. I just did this successfully on Ubuntu, and it worked like a charm. I installed TOR & Vidalia from the Debian repositories, started the TOR service using `service tor start`, and checked to see that my computer was listening on the default port, `9050`, for SOCKS connections to be routed through the TOR service; which it was. Vidalia tells me I'm connected to the TOR network. The problem is the Network -> Proxy section of the settings manager in Kali. I can enter in the necessary information to connect to the local SOCKS proxy, but there is no 'apply' button or anything to that effect. I have entered the information, hit enter, exited out (and when I go back, it is still there) of the settings manager, restarted the `networking` service, etc., but I have not been able to get the proxy settings to take effect. This worked beautifully in Ubuntu, I entered the SOCKS settings in the settings manager and hit 'apply', and all traffic was being routed through the TOR network. Any ideas?


Where does Firefox store its cookies on Linux?

Where does Firefox store cookies in Linux? I searched everywhere but did not find anything.


install a kernel module into BeagleBoard (BB)

I want to install a kernel module (For example "Hello world") on the BeagleBoard(BB). (The installed OS on the BB is an Ubuntu Linux). If anybody already worked on this could you suggest me a step by step instruction? Any suggestions are also welcome.


How to configure DHCP so that boot is completed even without a DHCP server?

I have configured /etc/network/interface like this:               auto lo eth0     iface lo inet loopback     iface eth0 inet dhcp      But when a lease cannot be obtained, the booting is not completed. Is it possible to leave DHCP enabled but, in case a DHCP lease is not achieved, still complete the boot (so that a new network configuration can be performed)?


Module Stacking in Linux device drivers

I am trying my hand with Linux, just come across the concept of module stacking. It can be used to use symbol exported by other Modules. Means we can use something already made in some module so we do not have to do something that is already done. But still I am not getting where in real-time we see this type of concept with Linux. I am following the same link from the o'reilly book - http://www.makelinux.net/ldd3/chp-2-sect-5.shtml Stacking in the parallel port subsystem is shown in Figure 2-2; I am not able to understand this figure? Can you just give SOME REALTIME EXAMPLE APPLICATION where we can use concept of module stacking, which will increase my vision horizon?


Character encoding issue with my linux install?

I just installed Ubuntu 12.04.4 64 bits, all seemed to be ok, when I started to work on console I noticed:   * that I couldn't get some accented characters typed in to the console, for example, if I tried to type _é_ I would get a _?_   * That neither a `ls` or any other unix commands output would display such characters properly.   * _ANSIX3.4-1968_ appeared as default character encoding in terminal, so:      * I changed the character encoding to UTF-8 at _Set Character Encoding_ option in Terminal menu. I can type these special characters properly but can't get other commands to output in a correct way. And I have to change this every time I open a new console. When I install anything I see this among the outputs and log info:               perl: warning: Setting locale failed.     perl: warning: Please check that your locale settings:         LANGUAGE = "en_US:en",         LC_ALL = (unset),         LC_TIME = "es_MX.UTF-8",         LC_MONETARY = "es_MX.UTF-8",         LC_ADDRESS = "es_MX.UTF-8",         LC_TELEPHONE = "es_MX.UTF-8",         LC_NAME = "es_MX.UTF-8",         LC_MEASUREMENT = "es_MX.UTF-8",         LC_IDENTIFICATION = "es_MX.UTF-8",         LC_NUMERIC = "es_MX.UTF-8",         LC_PAPER = "es_MX.UTF-8",         LANG = "en_US.UTF-8"         are supported and installed on your system.     perl: warning: Falling back to the standard locale ("C").     locale: Cannot set LC_ALL to default locale: No such file or directory      Also if I do a typo at any command working from console I get:               Sorry, command-not-found has crashed! Please file a bug report at:     https://bugs.launchpad.net/command-not-found/+filebug     Please include the following information with the report:          command-not-found version: 0.2.44      My settings at install were only English language and Spanish Keyboard layout. What could it have happened? And how can I fix it _permanently_?


"lsmod |grep audio" doesn't return anything?

I am running Debian Squeeze. I installed and removed Gnome3 and reinstalled Gnome2.x (epic fail and stupidity) and in the process I have lost audio, `lspci` returns following               # lspci | grep Audio     00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)         But lsmod doesn't return any thing.               $ lsmod |grep audio      Any idea what could be wrong? Here is an update, I tried to install whatever possible package was removed by studying `/var/log/dpkg.log`. This fixed my other issues like no right click on desktop and blunt looking buttons etc. Now I have everything in order but sound is missing. I don't see sound section in `gnome-control-center`. Here are some findings:               kumar@debian-box:/$ lspci | grep Audio     00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)     kumar@debian-box:/$ lsmod |grep audio     kumar@debian-box:/$ lsmod |grep snd       kumar@debian-box:/$ lsmod |grep sound     kumar@debian-box:/$ cat alsa-base.conf     # autoloader aliases     install sound-slot-0 /sbin/modprobe snd-card-0     install sound-slot-1 /sbin/modprobe snd-card-1     install sound-slot-2 /sbin/modprobe snd-card-2     install sound-slot-3 /sbin/modprobe snd-card-3     install sound-slot-4 /sbin/modprobe snd-card-4     install sound-slot-5 /sbin/modprobe snd-card-5     install sound-slot-6 /sbin/modprobe snd-card-6     install sound-slot-7 /sbin/modprobe snd-card-7     # Cause optional modules to be loaded above generic modules     install snd /sbin/modprobe --ignore-install snd && { /sbin/modprobe --quiet snd-ioctl32 ; /sbin/modprobe --quiet snd-seq ; }     install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi && { /sbin/modprobe --quiet snd-seq-midi ; : ; }     install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 && { /sbin/modprobe --quiet snd-emu10k1-synth ; : ; }          # Prevent abnormal drivers from grabbing index 0     options bt87x index=-2     options cx88_alsa index=-2     options snd-atiixp-modem index=-2     options snd-intel8x0m index=-2     options snd-via82xx-modem index=-2     # Keep snd-pcsp from beeing loaded as first soundcard     options snd-pcsp index=-2     # Keep snd-usb-audio from beeing loaded as first soundcard     options snd-usb-audio index=-2      Hope this helps in helping me. Its really hard for me to concentrate w/out headphones :( Last update, I fixed it using `sudo modprobe snd-hda-intel`, it seems I messed up kernel headers.


Server won't boot, kernel panic - not syncing

After a reboot of a CentOS 6.2 server we are getting a kernel panic with the following error:               Kernel panic - not syncing: Attempted to kill init!     Panic occurred, switching back to text console      When passing **init=option selinux=0** to the kernel at boot the server will boot without a problem. I have tried searching for what init=option does but I have not been able to find any recourses explaining it.   * Could someone explain what this parameter does?    * Also, as this is a production server are there any negatives/risks in running with the init=option? I have tried to remake the initramfs via dracut which did not work and received the above error upon boot. As this is a clustered server and the primary server should be identical I have copied the /boot drive from the other server but this did not solve the problem either. (The other server does not have this behavior) Restoring /boot from backup did not work either. Could you please help me investigate this problem   * What causes this kernel panic?   * How would you go about resolving this issue?    * What logs (if any) would tell you more information?   * As this is an older install, would an update/upgrade potentially fix this issue? I would also like to add that the only other possible related issue was that the root disk which was raid mirrored failed and was replaced before this happened. Thanks for your help!


"which" command difference

What is the difference between `(unix-system “which [name])` and `which [name]` commands. For example when I use the `(unix-system “which visual_elite)` command I get the following result:               /home/vhdl/edatools/mentor/visualelite/VisualElite-4.2.1/Linux2.4/bin/visual_elite      When I do the same on the command line using `which visual_elite` I get               enidl-atlas-schur <76> # which visual_elite     visual_elite is /home/vhdl/edatools/mentor/visualelite/VisualElite-4.2.1/visual_elite      Why do I have this difference?


What is the "/usr/local/src" folder meant for?

I wanted to put my work files (code) in `/usr/local/src`, but I think it's already a folder that has some other semantic meaning. What is that? Should I put source code there, or is there a better place? **Edit** - I am the sole user and admin of the machine, and I don't want to use my home directory because it's on an NFS drive.


How to execute a shell command from a "starter"?

I would like to execute a command by double-clicking on a _starter_ on my Ubuntu Lucid desktop. More specifically, I would like to start a `rdesktop` session. I have thus entered `rdesktop -u user -d domain address.to.remote.server` into the _Command_ field of the starter. However, double clicking does nothing, even though the starter is set to _executable_. What am I doing wrong?


redirect web server with no-ip and port forwarding in livebox

I want my Apache web server running on a Livebox (home router appliance running Linux) to be accessible from the Internet (WAN). I installed and configured the application noip2 on my Ubuntu PC. When I ping my hostname, it redirects me to my WAN ip, which is what I wanted. But I cannot access my Apache web server. I tried this:   * Disabling the `iptables` firewall configuration or the firewall of my Sagem modem.   * Port forwarding on sagem modem (NAT).   * Configuration of Apache. What else can I try? How can I make my web server accessible from the WAN side?


Sourcing a shell script from within Emacs

I would like to **source** a shell script that changes my environment variables from within Emacs. That is, I would like the shell script to change the environment in which Emacs runs, and I would like to do this from within a running Emacs session. In other words:   1. I start Emacs from `zsh`   2. I would like to source a `zsh` script from within Emacs that changes environment variables such as `LD_LIBRARY_PATH` ### Background: This is an attempt to circumvent the problem that I described here, where I need to **set** `LD_LIBRARY_PATH` to run Emacs, but I need to **unset** it to run a specific Python distribution (Anaconda). Specifically, I want to use an Emacs package (emacs-jedi) that requires access to this Python distribution, but currently I need to **unset** `LD_LIBRARY_PATH` first to start Emacs, so I would need to **set** it later so that I can use `emacs-jedi` from within Emacs. Is this at all possible?


How can I use variables when doing a sed?

I want to do:               cat update_via_sed.sh | sed 's/old_name/new_name/' > new_update_via_sed.sh      in my program. But I want to use variables, e.g.               old_run='old_name_952'     new_run='old_name_953'      I have tried using them but the substitution doesn't happen (no error). I have tried:               cat update_via_sed.sh | sed 's/old_run/new_run/'     cat update_via_sed.sh | sed 's/$old_run/$new_run/'     cat update_via_sed.sh | sed 's/${old_run}/${new_run}/'


Is it best practice to update mysql , php and apache on linux regularly to current version?

I have a VPS unmanaged and have installed CentOS 6.3, mysql 5.1.69, php 5.3.3 and apache 2.2.15 No formal or otherwise education in computer programming so trying to follow as many documented guidelines as I can to close any obvious security holes. Is it is best practice to use only current versions of each ? Are the ones I am using now too out dated?


How to install PostgreSQL 9.3 in FreeBSD jail?

I configured virtual NICS using `pf`, and a jail for FreeBSD using `qjail create pgsql-jail 192.168.0.3`. When I tried to install PostgreSQL 9.3 using port collection, it shows strange message at first.               pgsql-jail /usr/ports/databases/postgresql93-server >make install     ===> Building/installing dialog4ports as it is required for the config dialog     ===>  Cleaning for dialog4ports-0.1.5_1     ===> Skipping 'config' as NO_DIALOG is defined     ====> You must select one and only one option from the KRB5 single     *** [check-config] Error code 1          Stop in /basejail/usr/ports/ports-mgmt/dialog4ports.     *** [install] Error code 1          Stop in /basejail/usr/ports/ports-mgmt/dialog4ports.     ===> Options unchanged     => postgresql-9.3.0.tar.bz2 doesn't seem to exist in /var/ports/distfiles/postgresql.     => Attempting to fetch ftp://ftp.se.postgresql.org/pub/databases/relational/postgresql/source/v9.3.0/postgresql-9.3.0.tar.bz2     postgresql-9.3.0.tar.bz2                        1% of   16 MB   71 kBps      Anyway, installation continues, so I waited. I chose all default options for all option dialogs. And at the end of the process, I saw it finally failed with this message.               ====> Compressing man pages     ===>  Building package for pkgconf-0.9.3     Creating package /basejail/usr/ports/devel/pkgconf/pkgconf-0.9.3.tbz     Registering depends:.     Registering conflicts: pkg-config-*.     Creating bzip'd tar ball in '/basejail/usr/ports/devel/pkgconf/pkgconf-0.9.3.tbz'     tar: Failed to open '/basejail/usr/ports/devel/pkgconf/pkgconf-0.9.3.tbz'     pkg_create: make_dist: tar command failed with code 256     *** [do-package] Error code 1          Stop in /basejail/usr/ports/devel/pkgconf.     *** [build-depends] Error code 1          Stop in /basejail/usr/ports/textproc/libxml2.     *** [install] Error code 1          Stop in /basejail/usr/ports/textproc/libxml2.     *** [lib-depends] Error code 1          Stop in /basejail/usr/ports/databases/postgresql93-server.     *** [install] Error code 1          Stop in /basejail/usr/ports/databases/postgresql93-server.      I have no idea why this fails. Errors at beginning seems I have something wrong with `dialog4ports`. And errors at last seems installer cannot write to ports file tree. AFAIK, the ports files are read-only shared from host system. What's wrong with my jail? How can install PostgreSQL 9.3 in my jail?


Appending values to environment variables from within Emacs

I am new to Elisp. I would like to do the following in my init file:               ; Retrieve the value of LD_LIBRARY_PATH     ; Append '/path/to/some/lib/:'to it     ; Save the new value of LD_LIBRARY_PATH      So far I know that I can use:               (getenv "LD_LIBRARY_PATH")      to retrieve the value, and:               (setenv "LD_LIBRARY_PATH" "foo")      to set a new value, but my knowledge of Elisp is extremely rudimentary so I don't know to proceed from this point. ### Background: This question is inspired by the fact that it is not be possible to source a shell script to manipulate this environment from within Emacs, so I would need to do this using Elisp.


How to make sense of an iptables chain configuration

This is about how to make sense of the _chains_ found in the `iptables` default configuration on a typical home router running OpenWrt (a stripped down Linux for router devices), but which ultimately may not be specific to that particular system. Let's focus on the `INPUT` main chain here, and disregard `FORWARD` and `OUTPUT` from the same _table_, as well as `PREROUTING` and `POSTROUTING` from the `nat` table. Doing an `iptables -L -t filter` shows a large number of rules. I have rearranged the output below to make it less intimidating, and in an attempt to pinpoint the parts that hamper my understanding. There are three built-in chains in the `filter` table, which appear at the top of the output. (I specified `-v` because I find it less confusing.)               Chain INPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination      1260  133K ACCEPT     all  --  any    any     anywhere             anywhere            ctstate RELATED,ESTABLISHED         8   544 ACCEPT     all  --  lo     any     anywhere             anywhere       787 41632 syn_flood  tcp  --  any    any     anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN     13012 1249K input_rule  all  --  any    any     anywhere             anywhere     13012 1249K input      all  --  any    any     anywhere             anywhere          Chain FORWARD … # not considering this chain here     Chain OUTPUT …  # not considering either      As you can see, I snipped the chains referenced from `FORWARD` and `OUTPUT` in order to focus on `INPUT`. (I could have chosen any of the other two as they are built up in a similiar manner.) `INPUT` has a policy of `ACCEPT`, and it specifies five rules. The first three ones are clear to me. First, accept stuff that is "established" or "related". (For example, accept the response from an HTTP or DNS request I made.) Seconds, accept everything going to the loopback device (`127.0.0.1`). (This may only come from localhost itself, and I do want that to work. Wouldn't make sense otherwise.) Third, have a synflood protection. (Which protects against a certain kind of attack.)               Chain syn_flood (1 references)      pkts bytes target     prot opt in     out     source               destination       787 41632 RETURN     tcp  --  any    any     anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN limit: avg 25/sec burst 50         0     0 DROP       all  --  any    any     anywhere             anywhere      But then, there are two rules branching into two chains called `input` and `input_rule`, and the question is, why are there two of them, and which one are you supposed to use for what? Let's drill down the jump stack of those rules.               Chain input_rule (1 references)      pkts bytes target     prot opt in     out     source               destination      There's nothing in here yet. It is meant for me to add rules. But what kind of rules?               Chain input (1 references)      pkts bytes target     prot opt in     out     source               destination      6315  482K zone_lan   all  --  br-lan any     anywhere             anywhere      6697  767K zone_wan   all  --  pppoe-wan any     anywhere             anywhere      Okay, this one does have stuff, jumping further down into LAN and WAN, which makes sense for a home router.               Chain zone_lan (1 references)      pkts bytes target     prot opt in     out     source               destination      6315  482K input_lan  all  --  any    any     anywhere             anywhere      6315  482K zone_lan_ACCEPT  all  --  any    any     anywhere             anywhere          Chain zone_wan (1 references)      pkts bytes target     prot opt in     out     source               destination         0     0 ACCEPT     udp  --  any    any     anywhere             anywhere            udp dpt:bootpc         0     0 ACCEPT     icmp --  any    any     anywhere             anywhere            icmp echo-request      6697  767K input_wan  all  --  any    any     anywhere             anywhere      6697  767K zone_wan_REJECT  all  --  any    any     anywhere             anywhere      As you can see, each one of those rules jumps further down the stack to more user-defined rules.               Chain input_lan (1 references)      pkts bytes target     prot opt in     out     source               destination          Chain zone_lan_ACCEPT (2 references)      pkts bytes target     prot opt in     out     source               destination         4  1322 ACCEPT     all  --  any    br-lan  anywhere             anywhere      6315  482K ACCEPT     all  --  br-lan any     anywhere             anywhere      What is the purpose of `input_lan`? The other one is probably to accept packets, but it makes me wonder … the policy for `INPUT` is `ACCEPT`, so why repeat `ACCEPT` here? Now, input from WAN. If you scroll up you can see that some UDP and ICMP stuff is accepted. This is for DHCP and, basically, `ping`. That much is clear. What is less clear, again, is the partially empty stuff following those rules:               Chain input_wan (1 references)      pkts bytes target     prot opt in     out     source               destination      Same question as for `input_lan`.               Chain zone_wan_REJECT (2 references)      pkts bytes target     prot opt in     out     source               destination         0     0 reject     all  --  any    pppoe-wan  anywhere             anywhere      6697  767K reject     all  --  pppoe-wan any     anywhere             anywhere      Okay, that is input from WAN (not established or related), and yes, we probably want to reject it, and now there are two kinds of rejection here, one closing the socket (`tcp-reset`) for TCP connection attempts, and another one via ICMP reply (`icmp-port-unreachable`) for ICMP messages (think `ping`).               Chain reject (5 references)      pkts bytes target     prot opt in     out     source               destination       595 31817 REJECT     tcp  --  any    any     anywhere             anywhere            reject-with tcp-reset      4858  582K REJECT     all  --  any    any     anywhere             anywhere            reject-with icmp-port-unreachable      This last one is a catch-all. So nothing will get accepted here. Finally, here's a list of other chains found in the `filter` table that aren't referenced from the built-in `INPUT` chain in the `net` table. Just for completeness, and to see that they seem to have analogous constructs.               # other chains, not reached from the INPUT chain, so truncated and moved here     Chain forward (1 references)     Chain forwarding_lan (1 references)     Chain forwarding_rule (1 references)     Chain forwarding_wan (1 references)     Chain nat_reflection_fwd (1 references)     Chain output (1 references)     Chain output_rule (1 references)     Chain reject (5 references)     Chain zone_lan_DROP (0 references)     Chain zone_lan_REJECT (1 references)     Chain zone_lan_forward (1 references)     Chain zone_wan_ACCEPT (2 references)     Chain zone_wan_DROP (0 references)     Chain zone_wan_forward (1 references)      So, well. Sorry for this long post. There were a couple questions along the way. I don't know how to put this in an easier or shorter way. This `iptables` configuration is not exactly easy to grasp because there are unclear details spread about here and there. Hope you can clarify this and explain the underlying rationale. Thanks for your attention.


Remove newline from unix variable

I have a variable whose value is found using sql query. I want to remove the new line charcater from that variable since I want to concatenate this variable with the other. Below is the code:               dt=`sqlplus -s user/pwd@servicename <<EOF     set feedback off;     set head off;     select  replace(to_char((sysdate-7),'YYYYMonDD')||'_'||to_char((sysdate-1),'YYYYMonDD'),chr(10), '') from dual;     exit;     EOF`          echo "test $dt"


How do I use a serial port on Linux like a pipe or netcat?

I have two computers with two serial ports: ttyS0 and ttyUSB0. (Actually they are on the same computer but that's just for testing). The ports are connected via null modem cable. I want to be able to simply send bytes into one end and come out the other end, and vice versa. Why doesn't the below work?:               # set both serial ports to 9600 8n1     # `-parenb` means no parity,     # `-cstopb` means 1 stop bit     # cs8 means 8 bits at a time      stty -F /dev/ttyUSB0 cs8 -cstopb -parenb 9600     stty -F /dev/ttyS0 cs8 -cstopb -parenb 9600          # in one terminal:     echo "asdf" > /dev/ttyUSB0          # in another terminal, this hangs and does nothing     cat < /dev/ttyS0      I can do similar things with `netcat` and pipes very easily (below), so I feel something like the above should be possible as well.               mkfifo mypipe          # in one terminal     cat < mypipe          # in another. works as expected     echo "asdf" > mypipe


Home directory vs Working directory

In unix like systems what is the difference between a `home directory` and `working directory` ?


Discovering possible RAID configuration of a bunch of disks

I have a stack of 8 disks which were at one point all inside of one host. That host no longer exists, but it's been requested that I retrieve data from these disks. No one can tell me anything about their configuration. At first I was hoping they were JBOD, but after looking at the results of various disk checking utilities, I can only conclude that they are in some sort of RAID configuration, and/or possibly corrupt. Here are my findings. I'm hoping someone can give me a sliver of a hint as to how to actually access the data on them. =========================================== **Disk #1 (250 GB)** : primary disk with the OS. /boot and / partitions exist, which contain your typical layout of RHEL5 config files, etc. There is no problem mounting and accessing this drive. **Disk #2 (1 TB)** : gdisk reports that this one has a "damaged" GPT. It then says in more detail that the "backup GPT" is damaged, and that the primary GPT is fine. As such, I can type "p" to view the partitions, and it shows one: /dev/sdc1 at 5.5 TB. This is what tipped me off that we got some RAID action going on somewhere, as this disk itself is 1 TB. **Disk #3 (1 TB)** : gdisk shows no partition table nor any partitions, but curiously fdisk -l shows two partitions (/dev/sdc1: GPT and /dev/sdc3: empty). **Disk #4 (1 TB)** : gdisk/fdisk shows no partition table nor any partitions. **Disk #5 (1 TB)** : gdisk/fdisk shows no partition table nor any partitions. **Disk #6 (1 TB)** : gdisk/fdisk shows no partition table nor any partitions. **Disk #7 (1 TB)** : gdisk/fdisk shows no partition table nor any partitions. **Disk #8 (1 TB)** : gdisk/fdisk shows no partition table nor any partitions. But the difference with this one is that my computer actually makes an attempt to mount an ext3 filesystem automatically upon plugging it in, and fails with the error message "Block bitmap for group 1920 not in group (block 398460416)!" =========================================== How does one go about figuring this out or getting the data off of these disks? I was hoping that I could look at the primary ( **Disk #1** )'s /etc/ files to try to find some mdadm.conf or something that would indicate RAID setup, but I couldn't find anything relevant.


How do I add a screenshot for my package?

I created a repository with `reprepro` and it is working fine, but I would like to add the "images" to the packages when they are displayed with some package manager such as synaptic. At first, i was having problems with change-logs too, but when asking for a change-log the following message is displayed `URI was: http://foo/pool/main/7/7zrecover/7zrecover_2.6_all.changelog` So I understood that I needed to create that URL in order to call the change- log. I did it and it worked. I wanted to use the same method to call the image of the package, but when the error is displayed the URL is not shown so I don't have any idea of what URL is being requested. I've also been doing Internet researches but I just get dumb stuff or packages! Open synaptic and select any package. Then you will see that in the package description there are two buttons "Get Screenshoot" and "Get Changelog". I would like to make work the "Get Screenshoot" button of my packages.


Server returning 'Not Found' for "www.host.com" but not "host.com"

My server is returning the correct paths for all of my domains as long as they are not prefixed with www. The following is one of my domains in it's simplest form:               <VirtualHost *:80>       ServerName kyle-o.info       ServerAlias www.kyle-o.info       DocumentRoot /home/kyle/www/kyle-o.info     </VirtualHost>      I can provide logs if needed. The server is running Ubuntu:                 Distributor ID:   Ubuntu       Description:   Ubuntu 12.10       Release: 12.10       Codename:   quantal


Difference between POSIX, Single UNIX Specification, and Open Group Base Specifications?

What are the differences between POSIX, the Single UNIX Specification, and the Open Group Base Specifications? I think their purpose is for determining if an OS is Unix?


Who's got the other end of this unix socketpair?

**I want to determine what process has the other end of a unix socket, that was created with`socketpair()`.** I have a program `parent` which creates a `socketpair(AF_UNIX, SOCK_STREAM, 0, fds)`, and `fork()`s. The parent process closes `fds[1]` and keeps `fds[0]` to communicate. The child does the opposite, `close(fds[0]); s=fds[1]`. Then the child `exec()`s another program, `child1`. The two can communicate back and forth via this socketpair. Now, let's say I know who `parent` is, but I want to figure out who `child1` is. How do I do this? There are several tools at my disposal, but none can tell me which process is on the other end of the socket. ### lsof `lsof -c progname` lists the open files for all processes named `progname`. When I execute `lsof -c parent -c child1` I see the following (unrelated entries removed):               jonathon@jrr-suse113:/proc/net> lsof -c server -c child     COMMAND   PID     USER   FD   TYPE     DEVICE SIZE/OFF   NODE NAME     server  12923 jonathon    0u   CHR      136,3      0t0      6 /dev/pts/3     server  12923 jonathon    1u   CHR      136,3      0t0      6 /dev/pts/3     server  12923 jonathon    2u   CHR      136,3      0t0      6 /dev/pts/3     server  12923 jonathon    3u  unix 0xf67b8440      0t0  32721 socket     child   12924 jonathon    0u   CHR      136,3      0t0      6 /dev/pts/3     child   12924 jonathon    1u   CHR      136,3      0t0      6 /dev/pts/3     child   12924 jonathon    2u   CHR      136,3      0t0      6 /dev/pts/3     child   12924 jonathon    3u  unix 0xf42ff4c0      0t0  32722 socket      So I see the file descriptors for stdin/out/err, as well as my socket (which has been `dup2`'d to #3 for the child as well). Additionally, we see the socket device numbers in hex, and node (inode). Yet there is nothing that tells me these two are connected (which they definitely are.) ### /proc/xxx/fd This simply shows me the open file descriptors and what they point to. No surprises here.               jonathon@jrr-suse113:/> ls -l /proc/`pidof server`/fd     total 0     lrwx------ 1 jonathon users 64 2011-07-08 17:58 0 -> /dev/pts/3     lrwx------ 1 jonathon users 64 2011-07-08 17:58 1 -> /dev/pts/3     lrwx------ 1 jonathon users 64 2011-07-08 17:58 2 -> /dev/pts/3     lrwx------ 1 jonathon users 64 2011-07-08 17:58 3 -> socket:[32721]      ### /proc/net/unix This also doesn't show me anything that `lsof` doesn't (probably because these are where it gets its information.)               Num       RefCount Protocol Flags    Type St Inode Path     f42ff4c0: 00000003 00000000 00000000 0001 03 32722     f67b8440: 00000003 00000000 00000000 0001 03 32721      So basically, I can see the two sockets, and everything about them, but cannot tell that they are connected. Before you ask why I want to see this, consider the case where there are 40 different children processes running. I am trying to then determine which FD in the parent is communicating with which child process.


What is the significance of single and double quotes in environment variables?

I defined some environment variables in my .profile like this:               MY_HOME="/home/my_user"      but the variable does not seem to evaluate unless I strip off the quotes and re-source the file. I believe the quotes are necessary if there will be spaces, and single quotes are used if escapes are not desired. Can someone clarify the significance of single and double quotes in variable definitions? How about front-ticks and back-ticks?


Why is my interface font larger with LibreOffice than with other GTK applications?

I installed LibreOffice and the libreoffice-gtk package. The GUI has the same appearance as other GTK applications, however, the fonts in the interface appear to be 1.5 to 2 times larger than those in other GTK applications.   * I had this problem with OpenOffice.org and after upgrading to LibreOffice.   * I set the font using the `xfce4-appearance-settings` application.   * The font size difference appears no matter what font or size is selected.   * Restarting the computer does not solve the problem. Debian 6 LibreOffice 3.5.4.2 XFce 4.6.2


What is a fragment size in an ext3 filesystem?

This is an output from dumpe2fs:               root: ~/# dumpe2fs -h /dev/sdb3 | grep -i 'fragment|block size'     dumpe2fs 1.39 (29-May-2006)     Block size:               4096     Fragment size:            4096     Fragments per group:      32768      Is this related to disk fragmentation?


Have you seen this cat?

I am of course referring to the 'screenmate' cat, Neko - looks like this: ![enter image description here](http://i.stack.imgur.com/lf1B0.gif) A few years ago, I remember Neko could follow my mouse cursor around, and was a helpful distraction from during long hours of work. I am reminded of this after finding this extension for XPenguins: ![enter image description here](http://i.stack.imgur.com/wyxtW.png) And in my short quest, I have found: http://users.frii.com/suzannem/neko/index.html#links http://sourceforge.net/projects/ungattino/?source=directory The first does work, but within a Window in Wine, as it is a exe: ![enter image description here](http://i.stack.imgur.com/vnUeh.png) The second seems to start and work after running it with `java -jar...`, but seems to crash or disapear sometimes. **So where can I get Neko from for my computer - so that it can run around the screen like it used to?** Ubuntu 12.04 & Fedora 19 * * * Here are screenshots from after it was solved: ![moggy 1](http://i.stack.imgur.com/SLZMy.png) ![moggy 2 + penguin](http://i.stack.imgur.com/vb3l1.png)


Getting branch from git

let's say I want to get this branch the same way I get the latest one, using `git clone git://github.com/raspberrypi/linux.git`. How do I do it?


Transfer X from monitor to remote machine

I want to remote login to another laptop to continue working on session left over. VNC is slow because it's bandwith hog. I know (or I think I know) that it's not latency, it's bandwith because the first update from the top of screen or the top of recently changed view occurs very fast, but the entire redraw takes time.   I believe that X doesn't send the pixelmap, but instructions on how to redraw screen. So I'd like to use X. Question: Is there a way for me to say, to all the applications, please now migrate to the X server available remotely? Or can I make my computer think that what it calls :0.0 is no longer attached to the monitor, but is now on a remote machine. (And can I reverse this process so that I can switch back to the other laptop whenever I want)?


Executing a shell script from remote server on local machine

Imagine a shell script on the remote server as               #!/bin/bash     rm /test.x      How can I (if possible) to execute this script from my local machine to delete `/test.x` file on my local machine. Obviously, the solution should be with something like `ssh` authorization, but without downloading the script file from the remote server. In fact, I want to use the remote script as a provider of shell commands to be run on the local machine.


Process IDs range

On GNU/Linux system I seen only positive PIDs, but when kernel panic occured I seen info about process with PID=0. What's it? On Minix 3 I seen processes with negative PIDs. Minix is POSIX-compatible system, but POSIX allows only positive PIDs. What's it? What variable type I should use in C for saving process ID?


untabify on save in Emacs 24 without make-local-hook

I'd like to untabify whenever I save a buffer. This worked fine until I upgraded to Emacs 24 which broke it, as there is no `make-local-hook` anymore. Have a look:               ;;; untabify on C-x C-s (except for GNUmakefiles that needs tabs)     ;;;   (note: `stringp` check to avoid bug (?) in HTML-mode)     (defun untab-all ()       (unless (and (stringp mode-name)                    (string= mode-name "GNUmakefile") )         (untabify (point-min) (point-max)) ))          ;; TODO: doesn't work anymore as no make-local-hook in Emacs 24 -      ;; it won't work with simply dropping that line,     ;; or doing that, and passing a 4th `t` argument in the second     ;; add-hook call (which is the LOCAL parameter)          ;; (add-hook 'emacs-lisp-mode-hook     ;;    '(lambda ()     ;;       (make-local-hook 'write-contents-hooks)     ;;       (add-hook 'write-contents-hooks 'untab-all) ))      **EDIT** Got it to work with the below help and this site. Ironic thing is, with my old solution (using `make-local-hook`), somehow I got this **globally** (which is why I had to add that check for GNU makefiles). Now, this seems to be a local thing: this is good as that check needn't be done at every save; only, you have to state for what modes untabify should be done. (I guess you could just add them one by one as you go along, every time you discover a tab, until you're done. Although it feels like you're using 5-6 modes, when you think about it, you use tons!) But, to confuse things even more, the HTML mode seems to do this, with no intervention! If you read the code above, you see that even for the old solution, HTML was the cat among the ermines... Anyway, this seems to work:               (defun untab-all ()       (untabify (point-min) (point-max))        nil ) ; did not write buffer to disk          (defun add-write-contents-hooks-hook ()       (add-hook        'write-contents-hooks        'untab-all          nil  ; APPEND  unrelated, explicit default nil as optional :)          t )) ; LOCAL   non-nil => make hook local          ;; more modes: http://www.emacswiki.org/CategoryModes     (add-hook 'emacs-lisp-mode-hook #'add-write-contents-hooks-hook)     (add-hook 'c-mode-common-hook   #'add-write-contents-hooks-hook)     (add-hook 'sh-mode-hook         #'add-write-contents-hooks-hook)     (add-hook 'text-mode-hook       #'add-write-contents-hooks-hook)     (add-hook 'sql-mode-hook        #'add-write-contents-hooks-hook)     (add-hook 'css-mode-hook        #'add-write-contents-hooks-hook)


Why would I want to create more partitions if RHEL will only recognize up to 16?

During some basic RHEL training, I came across this blurb: > Although it's possible to create more, RHEL will recognize only up to 16 > partitions on any individual SATA, SCSI, PATA, or virtual hard drive. That sentence seems to conflict with itself. If RHEL can't recognize more than 16 partitions, why would I ever want to create more than 16?


rails command getting removed from $PATH after resume from hibernet

i came across a very strange issue. i have installed rails through rvm & tested the installation. next day when i logged into system neither ruby nor rails command was found. I reinstalled everything again (rvm, ruby, rails) and tested last night. now this time i kept a terminal open and hibernated the system. but as I am trying to run rails on the new terminal instance it is giving error `"bash: rails: command not found"` though other commands ruby, rvm, and gem are working and its showing in rails in`"gem list"` however when i tried running it into the instance i kept open it works fine. what could be the issue? i have no clue really. :( `echo $PATH` (terminalA - rails not working)               terminalA: /usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:                /usr/sbin:/sbin:/home/ankit/.rvm/bin:/home/ankit/bin:                /home/ankit/.rvm/bin          terminalB: /home/ankit/.rvm/gems/ruby-2.0.0-p353/bin:                /home/ankit/.rvm/gems/ruby-2.0.0-p353@global/bin:                /home/ankit/.rvm/rubies/ruby-2.0.0-p353/bin:                /home/ankit/.rvm/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:                /usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/ankit/bin      **EDIT:** although i see that by updating the path it would work. but why is it showing 2 different values for the same system at the same time? is there anything know that cause such problem? **EDIT2: I noticed that, this command is getting removed from path everytime system wake up from hibernate. it works on terminal instance which i left open before hibernate. but on every new instance of terminal i get the command not found error.**


Autorun Tomcat in Linux Mandriva - java.io.IOException: invalid argument

Here's the autorun script, which i use -               #!/bin/sh              # description: Tomcat start/stop script         # chkconfig:              TOMCAT_PATH=/java/apache-tomcat-7.0.32/bin         TOMCAT_START=$TOMCAT_PATH/startup.sh         TOMCAT_STOP=$TOMCAT_PATH/shutdown.sh              start()         {         if [ -x ${TOMCAT_START} ]; then         echo "Starting tomcat server..."         ${TOMCAT_START} &         else         echo "Cannot start tomcat server"         fi         }              stop()         {         if [ -x ${TOMCAT_STOP} ]; then         echo "Stopping tomcat server"         ${TOMCAT_STOP} &         else         echo "Cannot stop tomcat server..."         fi         }              restart()         {         stop         sleep 10         start         }              case "$1" in         'start')         start         ;;         'stop')         stop         ;;         'restart')         restart         ;;         *)         echo "Please supply an argument [start|stop|restart]"         esac      I put it in -               /etc/rc.d/init.d/      I added it to the startup:               /sbin/chkconfig --add --level 345 tomcat      But when i reboot the system, watch the logs and see - **catalina.out** :               ...     INFO: Stopping service Catalina     jan 03, 2013 6:09:04 PM hudson.util.CharacterEncodingFilter destroy     INFO: CharacterEncodingFilter destroyed.     jan 03, 2013 6:09:04 PM javax.jmdns.impl.tasks.state.DNSStateTask run     WARNING: Canceler(www-...-ru.local.).run() exception      java.io.IOException: Invalid argument         at java.net.PlainDatagramSocketImpl.send(Native Method)         at java.net.DatagramSocket.send(DatagramSocket.java:676)         at javax.jmdns.impl.JmDNSImpl.send(JmDNSImpl.java:1537)         at javax.jmdns.impl.tasks.state.DNSStateTask.run(DNSStateTask.java:131)         at java.util.TimerThread.mainLoop(Timer.java:555)         at java.util.TimerThread.run(Timer.java:505)      The process does not start. But if i execute the command -               /etc/rc.d/init.d/tomcat start      The process starts well. Why does it not start automatically? Thanks!


security concern around adding cron user to web application group

I have a permissions issue on my CentOS 5.6 machine with regards to the cron user. On my test/staging environment my cron user (`picco-cron`) is a member of one group - `picco-cron`, as below:               [crmpicco@1872-stage1 downloads]$ id picco-cron     uid=601(picco-cron) gid=601(picco-cron) groups=601(picco-cron)      Whereas, my development environment the same user, is a member of the `dev` group.               [root@dev53 dev_crmpicco]# id picco-cron     uid=503(picco-cron) gid=503(picco-cron) groups=503(picco-cron),555(dev)      The problem I have is that my PHP web application directories have a group of `dev`, which is correct, so on my development environment I can write/read to and from these directories as expected. However, on the test/staging environment I cannot as `picco-cron` is not a member of the `dev` group. My question is - is there a security issue around letting the "cron" user have access to writing to 90% of the directories in my application? Is it as simple as to add `picco-cron` to the `dev` group or is there a security concern here?


Query about Quad Boot system

I have triple boot system with win7, ubuntu 13.10 and fedora 20 installed.How to quad boot with kali linux ? my hard disk is 750gb


Mounting a partition into a 'sandbox'

I'm wondering if this is possible. I want to set up a linux system that mounts `/` remote linux machine to `/` on the local machine. However, I want all changes on the local machine to be saved to ram so that it doesn't affect the remote machine. Ideally the changes would NEVER be written, so that when I reboot, it mounts the original `/` partition again disregarding all changes made during the previous session. Is something like that possible?


is there a audit tool to track package installs and kernel version

I'm currently diagnosing a problem that started about a week ago on my laptop (running Ubunutu). The exact issue is not relevant though. Because I was already running several locally built kernel versions and still accepting regular ubuntu package updates, it would have been useful to have a log to refer to of when each new deb package was installed and also the kernel version I was running on each boot up. This would have helped me figure out what change to the system caused the problem to start occuring. So my question is does such an auditing tool (for a linux distro) that is able to keep a log of all OS package installs/updates/removals and the kernel version thats used each time the machine boots? I does specifically need to be under an open-source license and reasonably straight forward to setup and run, for an experienced Linux user but one who is not a full-time sysadmin - this is on a developer laptop not a large server after all.


What does tail -f <directory name> do?

I mistakenly executed the following command in the terminal: `tail -f /logs/applications/logs*` I got the following output:               tail: file shrunk!     Error 0      I am not sure what exactly happened. I have not been keeping track on the number of files in the directory for quiet a while. Could someone please explain what exactly happened, and did I lose any files. Edit: I am not sure if it is coincidence or not, but after I executed the code, I counted the number of files in the directory, and it was 10! First time the number 10 got me paranoid...


fwui.log error while running this script

I run this bash script in order to put all the files with the following format dated today in the same folder. for example here I want `2012-12-17_083213` to be my folder and then inside it I have the `.log` and `.log_stats` and etc with this name inside it? But I am not able to get the script working. For example, if I try everything up until `dir=$(echo $i | awk '{split($1,a,"_"); print a[1]}');`   And then to test it, I did echo $dir, and that displays the following:   `fwui.log`   I searched and understood its about locks in the db but how to solve it? This is the script:               #!/bin/bash       tosend=""       for i in *.log; do              dir=$(echo $i | awk '{split($1,a,"_"); print a[1]}');           if [ ! -d $dir ]; then               mkdir $dir;           fi;           cp $i $dir;           tosend="$tosend\n$dir"       done       for i in $(echo -e $tosend | uniq);do           echo Compressing $i           tar -zcvf $i.tar.gz $i           scp $i.tar.gz user@server       done        and this is the file formats:               2012-12-17_083213_1.log       2012-12-17_083213_1.log_stats       2012-12-17_083213_1.logaccount_ptr         2012-12-17_083213_1.loginitial_ptr       2012-12-17_083213_1.logptr       2012-12-17_093049_2.log       2012-12-17_093049_2.log_stats       2012-12-17_093049_2.logaccount_ptr       2012-12-17_093049_2.loginitial_ptr       2012-12-17_093049_2.logptr


flar archive creation

I'm facing issue, I need to perform a patch of a solaris flar image and all the commands take quite some time to perform it. To avoid me being in front of it I prepared a script that almost works flawlessly. So, basically I have a existing flar archive that needs to be updated. Let's call it common.flar. The script unpacks the Recommneded patches, uncompresses the common.flar applies the patches and then it should compress back the archive. I'm falling at the following command:               find . |cpio -ocv|compress > ../flash/archive      If I do this outside the script it works without any problem, but if I do it inside a script, it processes the first 5 files of the archive and "aborts" with > ../flash/archive: -- file unchanged When this happens and I let the script finish, the new flar archive has the exact same size as the original, if I do it manually, the new flar is bigger. (In this particular case it is installing 72 patches) In the script I make sure that I am get into the proper directory to run the piped commands for the compress. I'm not redirecting the input, just the output to a file but still I am unable to understand why it fails. Another test I've done: Create a test script with only two lines: cd dir; find . |cpio -ocv|compress > ../flash/archive and this works fine. Feeling kinda lost


How to define similar bash function at once

I have these functions in `~/.bashrc`:               function guard() {         if [ -e 'Gemfile' ]; then         bundle exec guard "$@"         else         command guard "$@"         fi     }     function rspec() {         if [ -e 'Gemfile' ]; then         bundle exec rspec "$@"         else         command rspec "$@"         fi     }     function rake() {         if [ -e 'Gemfile' ]; then             bundle exec rake "$@"         else             command rake "$@"         fi     }      As you see these functions are very similar. I want to define these 3 functions at once. Is there a way to make it? _environment_               bash --version     GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)


Compare files and tell how similar they are

Is there a way to compare two file and give some kind of numeric indication of their similarity? For example, if I have two files that differ by just one character (say, a character was deleted or changed), the program ought to say something like "file X differs by 1 character." Or if two lines are different, say "file X differs by two lines." The best output would be something like "File X is 95% similar to file Y"


how to use patch and diff to merge two files

I have read about diff and patch but I can't figure out how to apply what I need. I guess its pretty simple, so to show my problem take these two files: a.xml               <resources>        <color name="same_in_b">#AAABBB</color>        <color name="not_in_b">#AAAAAA</color>        <color name="in_b_but_different_val">#AAAAAA</color>        <color name="not_in_b_too">#AAAAAA</color>     </resources>      b.xml               <resources>        <color name="same_in_b">#AAABBB</color>        <color name="in_b_but_different_val">#BBBBBB</color>        <color name="not_in_a">#AAAAAA</color>     </resources>      I want to have an output, which looks like this (order doesn't matter):               <resources>        <color name="same_in_b">#AAABBB</color>        <color name="not_in_b">#AAAAAA</color>        <color name="in_b_but_different_val">#BBBBBB</color>        <color name="not_in_b_too">#AAAAAA</color>        <color name="not_in_a">#AAAAAA</color>     </resources>      The merge should conatin all lines along this simple rules:   1. any line which is only in one of the files   2. if a line has the same name tag but a different value, take the value from the second I want to apply this task inside a bash script, so it must not nessesarily need to get done with diff and patch, if another programm is better at it.


How install xfce >= 4.10 from backports repository in debian

I am working in Debian 7 64bits with xfce 4.8 ![enter image description here](http://i.stack.imgur.com/bhaxG.jpg) But in backports repository I found xfce 4.10.1 ![enter image description here](http://i.stack.imgur.com/fgb4F.jpg) and I added this line in my sources.list:               deb http://ftp.debian.org/debian/ wheezy-backports main contrib non-free      but when I upgrade I do not see that can be updated. ![enter image description here](http://i.stack.imgur.com/NDPDH.jpg) Then, how I can upgrade xfce 4.8 to 4.10 cleanly with backports? without tricks like adding repo of debian 8 testing or others. Greetings.


Startx failing in FreeBSD

I've install gnome2, xorg, and xinit (should xorg have done that for me?), and startx yields: "xinit: unable to run server "/usr/local/bin/X": No such file or directory" I checked in the directory, and startx, xpath, and xinit are all there Am I still missing dependencies? If so, which ones? Both the gnome2 and x11 installations took a lifetime and a half so I thought they got everything...


Not able to install GRUB (grub legacy) on flash drive!

I'm following this tutorial of Dedoimedo to install GRUB on USB flash drive. Though this tutorial doesn't talk of installing in pen drive but I though it can be used here even.                      [ Minimal BASH-like line editing is supported.   For              the   first   word,  TAB  lists  possible  command              completions.  Anywhere else TAB lists the possible              completions of a device/filename. ]          grub> find /grub/stage1      (hd0,4)          grub> root (hd0,4)          grub> setup (hd1)      Checking if "/boot/grub/stage1" exists... no      Checking if "/grub/stage1" exists... yes      Checking if "/grub/stage2" exists... yes      Checking if "/grub/e2fs_stage1_5" exists... yes      Running "embed /grub/e2fs_stage1_5 (hd1)"...  21 sectors are embedded.     succeeded      Running "install /grub/stage1 d (hd1) (hd1)1+21 p (hd0,4)/grub/stage2 /grub/me     nu.lst"... succeeded     Done.          grub>       Still I don't see anything in the flash drive. Also when I rebooted my laptop setting USB flash drive to boot, it didn't boot from my USB. Please throw some light on this. [I have seen sites (pendrivelinux.com) http://www.pendrivelinux.com/install- grub2-on-usb-from-ubuntu-linux/ where it talks on installing on USB but I want to know why my method isn't working]


Can I execute a python statement from a terminal?

I'd like to simply execute a Python command without having to write a script or enter the interpreter. Is there a way that I could run something like:               python --execute "pow(12.31351,2)"      And have it simply print the result?


How can I redirect matching lines to a file, and non-matching lines to a different file?

Is there a script/program/utility already available for the following requirement in a optimised way?               someCommand |        tee >(grep "pattern" > LinesWhichMatch) |        grep -v "pattern" > LinesWhichDoesNotMatch


Corsair Vengeance K-95 Keyboard & Linux

I've been thinking that I want a mechanical keyboard, currently I'm using a logitech G510 which is perfect with it's 18 programmable keys (I'm using it with this) but I hear a lot of people drooling over mechanical keys, especially programmers, and I do certainly write a lot and on occasion I code too. Not to mention gaming of course. But one thing I really cannot think of losing is the 18(x3) programmables, I don't care about the rest of the features, but being able to open folders, switch workspaces and navigate through my browser with single buttons changes everything. Not to mention it is very efficient. Media keys are also always nice (Play/Pause, Volume wheel) The Corsair Vengeance K-95 was the first keyboard I found that seems to match my needs.   1. Does it work with Linux? (If so, how well?)   2. Can I map custom commands (like terminal commands) to the G keys?


Equivalent to "copies=2" feature of ZFS in Linux with LVM

I have a laptop with only one HDD and is impossible add other HDD. The feature "copies=2" of ZFS is the perfect solution for to add redundancy to my /home in the laptop. I would like emulate the copies=2 option of ZFS with LVM (or other software if you prefer), for example 2 copies of each block of my /home partition. In this HDD, I have other systems and I use habitually the laptop for testing a lot of new versions of OS, so I need continue using a standard MBR partition table and the changes must be in the partition level. I will not use ZFS or btrfs for this. If you have other ideas, all are welcome :) . http://blogs.oracle.com/relling/entry/zfs_copies_and_data_protection Update: Like Gilles said, my idea only give me protection from invalid sectors and similar failures for a very limited time. Not for human errors, software bugs or mechanical/electronic failures of my HDD. This is the idea.


How to install packages during live installation in Fedora?

I have Fedora 20 live USB and some packages with me. I want to install these packages during the live installation itself. Is there any script to do this?


Why did BASH print "bash: cd: write error: Success"?

I noticed this several times today. If I type `cd ../Directory` to change to another directory, it prints "bash: cd: write error: Success". I can't determine what other previous commands might be related to this.   * `typeset -f` prints nothing.   * `alias` prints nothing.    * `type -a cd` prints "cd is a shell builtin".   * `echo $CDPATH` prints an empty line.   * `$BASH_VERSION` prints "bash: 4.2.37(1)-release: command not found".   * I only noticed this 2-3 times. The initial directory and target directory were identical in both situations. I changed directories in this manner many other times, but did not encounter the error always. What could be causing this?


what are the compilation steps for Firefox in RHEL 6.3?

i have changed the code of Mozilla firefox in /usr/lib64/firefox/omni.ja now i want to compile the firefox so that the changes will get effect.


Emacs sync w/ Google Calendar and Contacts?

Is there a way to use Emacs to sync with Google Calendar and Google Contacts, ideally keeping a local copy so I can access them offline?


How do I recursively delete directories with wildcard?

I am working through SSH on a WD My Book World Edition. Basically I would like to start at a particular directory level, and recursively remove all sub- directories matching .Apple* - how would I go about that? I tried `rm -rf .Apple*` and `rm -fR .Apple*` both not deleting directories matching that name within sub-directories. Any help would be greatly appreciated. Thanks, Dany.


Configure guessnet to switch automatically between LAN and WLAN

I want to configure guessnet and wpa_supplicant such that if I plug in my LAN cable, it connect to the network via the cable and if I unplug it, it automatically switches to WLAN and vice versa. I managed to make it work, however if I unplug the cable, it takes 10 to 20 seconds to connect to the WLAN network, which is pretty slow. In contrast, if I plug in the cable, it takes just a second to disconnect from WLAN and connect to LAN. Is there any way to get a better configuration to make the switching to WLAN much faster? By the way, when I tried new settings I often hat to reboot which was very annoying, a simple `service networking restart` was not enough - perhaps this has to do something with my configuration. My system is ubuntu 13.10. Here are my config-files: `/etc/network/interfaces`               auto lo     iface lo inet loopback          #use guessnett     mapping eth0             script /usr/sbin/guessnet-ifupdown             #map timeout: 3             map default: unknown               iface home inet static           address 192.168.1.80           netmask 255.255.255.0           gateway 192.168.1.1           dns-nameservers 192.168.1.1           test1 peer address 192.168.1.1               iface no-net inet manual           test2  missing-cable          iface unknown inet dhcp          iface wlanWork inet dhcp          auto wlan0     iface wlan0 inet manual            wpa-roam  /etc/wpa_supplicant/wpa_supplicant.conf      And this is my `/etc/wpa/supplicant.conf`               ctrl_interface=/var/run/wpa_supplicant          eapol_version=1          ap_scan=1          network={         ssid="mywlan"         scan_ssid=1         psk="1234"         proto=RSN         key_mgmt=WPA-PSK         pairwise=CCMP         group=CCMP         id_str="home" ## specified in /etc/network/interfaces     }               network={         ssid="wlanWork"         scan_ssid=1         psk="1234"         proto=RSN         key_mgmt=WPA-PSK         pairwise=CCMP         group=CCMP         id_str="wlanWork" ## specified in /etc/network/interfaces     }      Finally this is `/etc/default/ifplugd` as generated by `dpkg-reconfigure ifplugd`               INTERFACES="eth0"     HOTPLUG_INTERFACES=""     ARGS="-q -f -u0 -d10 -w -I"     SUSPEND_ACTION="stop"      **Edit** I noticed some wired problems with this setup which I cannot reproduce. One time WLAN worked, but LAN didn't have the proper route/gateway. After setting the gateway manually via `route add default gw 192.168.1.1` and rebooting, it worked again. After a second reboot nothing worked despite the fact that I got the correct IP (even `ping 192.168.1.1` didn't work). Then I had to do `sudo dhclient` to get a working internet connection again...


What makes Ubuntu not totally Free Software?

I heard that Ubuntu is not completely free (as in Freedom). What are the specific parts of Ubuntu that are not Free?