Terminal colors putty raspbian

I'm connecting to my Raspberry Pi from my Windows Machine using putty. I already adjusted the colors for bold blue in putty to be more readable (using this guide). But I still have problems with the colors in my terminal: for example when I run htop, the first value for the load average is completely black, or the swap values are not readable. When I copy the text through to windows into a text file it's readable. Can somebody please help me figure out where to adjust the settings?


How to read CPU temperature on a shared server?

I would like to read my CPU temperature with PHP, but I cannot find the relevant info. All paths under `/proc/acpi/thermal_zone` appear empty. I have tried:   * /proc/acpi/thermal_zone/THM0/temperature   * /proc/acpi/thermal_zone/THRM/temperature   * /proc/acpi/thermal_zone/THR1/temperature None of these (appear to) exist. What is the correct path to the CPU temperature monitor? `phpinfo()` says:               PHP Version 5.4.12     Linux infong 2.4 #1 SMP Thu Feb 14 13:02:49 CET 2013 i686 GNU/Linux     Safe mode is off     Apache


Best way run a command on each file in a directory tree

There appear be a number of ways to do this including loops in shell script, find and xargs. Which of these is best, and which is most portable?


Transferring Files SSH SCP Error Message: 'Stdin: is not a tty'

I am using a Macbook SSH terminal and generated RSA key pairs and uploaded remote `id_rsa.pub` with approved permissions. I can connect with remote Apache web server. I can create, open, move, modify and on preliminary inspection can manage files on the web server, no problem ... and generate no error messages. Surprisingly I can not `scp` a folder nor document from my desktop to the remote server. Nor can I `scp` a folder or document from the remote server to my desktop. Each time I receive the error message: > stdin: is not a tty The `scp` command to or from the remote web server does not work with either absolute or relative file location references. My standard syntax looks like this: From local host:               scp -rp ~/Desktop/foldername username@secureremoteserver.com:~/public_html From remote host:               scp -rp username@secureremoteserver.com:~/public_html/foldername ~/Desktop/ It appears to be an issue with the `stdin: is not a tty` error message. What's going on? If this error is preventing the file transfers, how do I resolve the `stdin: is not a tty`?


Network in LXC not forwading through a bridge

I've got an LXC container, on the host I've got a bridge between the LXC container and `eth0`. The LXC container can ping it's Host `10.1.0.5`, but can't ping the gateway of `10.1.0.2`. The host is able to ping the gateway. `tcpdump` on the interface created for the LXC container is sending the pings to the router and is getting a reply back. But a `tcpdump` within the container shows nothing. Furthermore, running `tcpdump` in the container hangs when you press ^C (20-40sec), that doesn't happen in the host. Any ideas what I should look for here?               root@hadoop-jobtracker:~# ping 10.1.0.2 &     [1] 876     root@hadoop-jobtracker:~# PING 10.1.0.2 (10.1.0.2) 56(84) bytes of data.               root@hadoop-jobtracker:~# tcpdump     tcpdump: verbose output suppressed, use -v or -vv for full protocol decode     listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes     ^C     ::::20+ sec delay occurs here::::     05:56:34.835833 IP 10.1.0.35.ssh > 10.1.0.5.32990: Flags [P.], seq 2715418718:2715418910, ack 3505056160, win 196, options [nop,nop,TS val 1608155 ecr 1608151], length 192          1 packet captured     111 packets received by filter     80 packets dropped by kernel


Is there a keyboard shortcut to make a window occupy half the screen?

Is there a keyboard shortcut I can use to make a window occupy the left or right half of the screen? I'm using a modified version of Ubuntu. On Mac I just use Divvy but I'm not sure if there is a Linux tool to do the same thing.


Using FFMPEG to stream to Twitch.tv with desktop audio?

I've been trying for the last hour or so to stream to Twitch.tv with desktop audio in the stream. Currently, I'm able to use this to get a video to display on Twitch:               #! /bin/bash          INRES="1280x800"             # input resolution     OUTRES="640x480"             # Output resolution     FPS="30"                     # target FPS     QUAL="medium"                # one of the many FFMPEG presets     STREAM_KEY=$(cat ~/.twitch_key)          ffmpeg \         -f x11grab -s $INRES  -r "$FPS" -i :0.0 \         -f alsa -ac 2 -i pulse  \         -vcodec libx264 -s $OUTRES -preset $QUAL \         -acodec libmp3lame -ar 44100 -threads 6 -qscale 3 -b 712000  -bufsize 512k \         -f flv "rtmp://live.justin.tv/app/$STREAM_KEY"      What I want this to do is along with my microphone, I need the audio that my computer is playing (e.g. the audio from a YouTube video) to upload to the stream as well. I'm also open to other options, but I haven't been able to find any as of yet.


Automatic scheduled backup of website (/var/www and MySQL dump)

I've been trying to set up a scheduled backup for my server but i can't seem to get it working. I need to copy the contents of /var/www into a compressed file (tar?) in a folder in my home directory every 24 hours. I also want to perform a dump of all mysql databases every 24 hours and store it in another folder in my home directory. I want both backups to be named with the current date. The server is running Ubuntu 12.04.1, i only have access through SSH so no graphical interfaces. Is this possible to do? I've been looking into the TAR and rsync utility, but i'm not sure how to do it. If anyone can help me out if would be very appreciated.


Process is eating all of the CPU time

Is there any magic command to track down which process is starting this perl task that is eating 100% of CPU time? I have this problem on several machines where JBoss AS is installed. ![enter image description here](http://i.stack.imgur.com/sz8F3.png)


Centos 6 stuck at loading splash screen after successful installation

I'm trying to dual-boot CentOS with Windows 7. My current disk layout are as follow:-               /dev/sda1 - Windows 7     /dev/sda3 - NTFS partition      I created a standard partition for `/boot` and that was assigned as `/dev/sda2`. When I create LVM Physical Volume, it automatically creates an **Extended Partition** (`/dev/sda4`) and the LVM Physical Volume (`/dev/sda5`) was created under the Extended Partition. I then created 2 volume group for `/` and `swap`. Upon complete installation, I'm unable to login to Centos at all. It is stuck at the loading splash screen. Does this have anything to do with the disk layout? If so, how can I fix this? EDITED Instead of dual-booting it, I installed it as a VM on my Windows Machine. I started off with a blank disk layout, create /boot partition followed by the LVM Physical Volume. It installed fine and was able to boot up normally. I presume the issue was due to the LVM Physical Volume sitting in the Extended Partition that ruined the boot-up. Could be wrong through. Should I mount the extended partition first or something?


Why I was able to fix a broken package with aptitude but I could not with either apt-get or synaptic?

Yesterday I upgraded my Debian Testing and Audacious stopped to work. Troubleshooting I found that the problem was that it was updated to a recent version but the needed plugins were not. I tried to manually install the plugins from its website but I couldn't, missing a lot of packages, and every time I installed one it requires other and so on. So my solution was to change my repositories to wheezy and go back to the old version. After this, audacious was broken and I couldn't fix it. I tried `apt- get clean`, `apt-get install -f` and the Fix broken packages at Synaptic. Neither worked. However, I installed it using aptitude and it was installed after automatically fix the dependencies. My question is, why neither apt-get nor Synaptic weren't able to fix the dependencies, and aptitude was?


What is 'ls quote'?

Today I happened to press `'` after `ls`   So the command is `ls'` After I issued this command: ![enter image description here](http://i.stack.imgur.com/5NwCN.png) [edit]Seems the image can't display properly               > ls'     quote> ls'     zsh: command not found: ls\nls     >      Can someone tell me, what is the `ls quote` thing?


screen + vim -- Any way to automatically set screen window name to open vim filename?

I have a pretty nice screen rc file that shows me the open screen windows almost like tabs at the bottom of the terminal. Currently the windows are named according to my prompt which is not so useful. Is there a way to automatically name the windows based on the filename of an open vim session currently in the window? I think this would make a supreme multi window editor if it were possible.


MAC Address changes after dirty shutdown

I'm having a strange issue which I originally thought was tied to the fact that I created an Ubuntu system from an image of another. However, after reinstalling Ubuntu from scratch I am getting the same behaviour. Basically whenever there is a dirty shutdown (power gets yanked) the MAC address gets set to a new value, and the `/etc/network/interfaces` gets updated with the new address and an incremented `ethX`. This is causing all kinds of problems and I really have no idea why this is happening. I've set up many systems just like this one and never had this happen. I'm running Ubuntu 12.04 32 bit with all updates installed. Any thoughts?


Chromium CPU usage 100%

If I visit loungefm in Chromium, my CPU usage goes up to 106%. If I start the player, it goes down to 50-60%. The output of Chromium if I start it via a terminal is: > ATTENTION: default value of option force_s3tc_enable overridden by > environment. What could cause that problem? I'm on Arch-Linux, Laptop is a Thinkpad T420s


Ubuntu12.04/KDE4 - Panel issue Switching between 4 and 2 monitor workstations

Overview: The environment I work in currently has two different style of workstations. The first is a 4 monitor setup and the second is a two monitor setup. Both are running Ubuntu 12.04 with KDE4. The user accounts are accessible between workstations via LDAP/Kerberos/NFS. Issue: The issue is that when a worker goes from a 4 monitor workstation to a 2 monitor workstation and then back to a 4 monitor workstation, all the panels are now overlapped and need to be dragged back into place. This also affects some applications if they configure them to load on the 3rd monitor, but then sit on a 2 monitor workstation, they can't get the application due to it being told to load on the 3rd. (hope this makes sense). Question: I'm wondering if there is an easy, non-scripted, solution to this issue. I know I can do fancy stuff like use different .kde4 directories based off the workstation they log into, or write a script to move things around when they log in (or click on a button). But I'm looking for an easy supportable solution. PS: I have seen other posts similar to this issue, but slightly different, with no resolution. These posts are also older, so I'm hoping that something has come along since then.


kernel: disabling /dev/kmem and /dev/mem

I understand that `/dev/kmem` and `/dev/mem` provide access to the memory (i.e. raw RAM) of the system. I am also aware, that `/dev/kmem` can be completely disabled in kernel and that access can be restricted for `/dev/mem`. It seems to me, having raw access to memory can be useful for developers and hackers, but why should I need access to memory through `/dev/mem`. AFAIK it cannot be disabled in kernel (unlike `/dev/kmem`). Having access to raw memory that can be potentially abused/exploited seems to me to be just asking for trouble. Is there some practical use for it? Do any user programs require it to work properly?


How does the colon sign and dollar question mark combine in sh?

The "colon sign" and the "dollar question mark" can be combined to check if a `sh` script does have an argument and assigns it directly to a variable of interest:               cmd=${1:? "Usage: $0 {build|upload|log}"}      Can someone explain step for step how this works, and where I can find the details on its implementation? For example I would like to be able to call a function instead of printing to `stderr`.               help() {       echo $"Usage: $0 {build|upload|log}"       exit 1     }     cmd=${1:? help}      Why is this not possible?


Debian, nonroot, cron, bash script and rebooting at specific time

As nonroot user, how can I schedule a reboot every day at 4:30am? 30 04 * * * /home/user/scripts/reboot.sh As a nonroot normal user, I'm sure the system won't allow me to use the reboot command. What settings do I need to change in Debian order to make this scheduled reboot work? (without asking for sudo password)


Will purging GNOME remove gedit?

If I remove the GNOME desktop environment from my Debian 7 installation, will that also remove additional applications like gedit or will they remain installed and usable?


Samba shares - Cannot access with users

I have installed a Samba server on Ubuntu Server 12.04 so I can store files there from my desktop or laptop or whatever. `/etc/samba/smb.conf`:               #======================= Global Settings =====================================     [global]     workgroup = WORKGROUP     server string = Samba Server %v     netbios name = xxx     security = user     map to guest = bad user     dns proxy = no          #============================ Share Definitions ==============================     [Public]     path = xxx     browsable = yes     writable = yes     guest ok = yes     read only = no     create mask = 0660     directory mode = 0770          [Jochem]     path = xxx     browsable = yes     writable = yes     guest ok = no     valid users = jochem     read only = no     create mask = 0660     directory mode = 0770      I added a user: `sudo adduser jochem`, `sudo addgroup smbgrp`, `sudo adduser jochem smbgrp`, `sudo smbpasswd -a jochem` Then restarted the service: `sudo service smbd restart`. When I open Windows Explorer and go to `\\xxx\` I can see 2 folders: `Public` and `Jochem`. I can access `Public` without any problem, can write files to it, read, etc. Then when I want to access `Jochem`, I get this window: ![credentials window](http://i.stack.imgur.com/9tXi9.png) I then fill in my username and password as entered via `smbpasswd -a jochem`, but then I get an error message. What is wrong here? I think it might be because I am logging in via my PC's domain `JOCHEM-PC`, but I've tried `xxx\jochem` and it doesn't work either.. Any ideas?


How to disable the boot log daemon by editing the init script?

I understand that boot log daemon (see this question Starting Bootlog daemon: bootlogd is a part of the init script. But I don't know how to edit this script to disable this daemon. Can some one explain the complete procedure to disable it? **Update** Unfortunately in my linux flavour (petalinux running on arm cortexA 9 based zynq chip) I could not find the file /etc/default.bootlogd:               root@Xilinx-ZC702-14_7:/etc# grep -r "BOOTLOGD_ENABLE" *     init.d/stop-bootlogd:case "$BOOTLOGD_ENABLE" in     init.d/bootlogd:case "$BOOTLOGD_ENABLE" in     rc2.d/S99stop-bootlogd:case "$BOOTLOGD_ENABLE" in     rc3.d/S99stop-bootlogd:case "$BOOTLOGD_ENABLE" in     rc4.d/S99stop-bootlogd:case "$BOOTLOGD_ENABLE" in     rc5.d/S99stop-bootlogd:case "$BOOTLOGD_ENABLE" in     rcS.d/S07bootlogd:case "$BOOTLOGD_ENABLE" in      Now I am unable to understand where should I make change? Here is the out put of **vi init.d/bootlogd**               ! /bin/sh     #     # bootlogd      One of the first scripts to be executed. Starts or stops     #               the bootlogd log program. If this script is called as     #               "stop-bootlogd", it will stop the daemon instead of     #               starting it even when called with the "start" argument.     #     # Version:      @(#)bootlogd  2.85-12  21-Mar-2004  miquels@cistron.nl     #          PATH=/sbin:/bin:/usr/sbin:/usr/bin     DAEMON=/sbin/bootlogd     NAME=bootlogd     DESC="Bootlog daemon"          test -f $DAEMON || exit 0          [ -r /etc/default/bootlogd ] && . /etc/default/bootlogd          ## set -e # not needed     case "$BOOTLOGD_ENABLE" in             [Nn]*)                     exit 0                     ;;     esac          STOPPER=     ACTION="$1"     case "$0" in             *stop-bootlog*)                     STOPPER=Y                     if [ "$ACTION" = start ]                     then                             ACTION=stop                     fi                     ;;     esac          case "$ACTION" in             start)                     echo -n "Starting $DESC: "                     if [ -d /proc/1/. ]                     then                             umask 027                             start-stop-daemon --start --quiet \                                     --exec $DAEMON -- -r                     else                             $DAEMON -r                     fi                     echo "$NAME."                     ;;             stop)                     echo -n "Stopping $DESC: "                     start-stop-daemon --stop --quiet --exec $DAEMON          if [ "$STOPPER" ] && [ -f /var/log/boot ] && \                        [ -f /var/log/boot~ ]                     then                             cd /var/log                             chgrp adm boot                             savelog -p -c 5 boot > /dev/null 2>&1                             mv boot.0 boot                             mv boot~ boot.0                     fi                          echo "$NAME."                     ;;              restart|force-reload)                     echo -n "Restarting $DESC: "                     start-stop-daemon --stop --quiet --exec $DAEMON                     sleep 1                     start-stop-daemon --start --quiet --exec $DAEMON                     echo "$NAME."                     ;;             *)                     N=${0##*/}      N=${N#[SK]??}                     echo "Usage: $N {start|stop|restart|force-reload}" >&2                     exit 1                     ;;     esac          exit 0


Looking for a complete TUI script for configuring date and networking of CentOS 5

I'm looking for a script that allows complete configuration of a CentOS 5 system via TUI (no GUI, X, etc.). I found system-config-network-tui but other than the fact it looks unprofessional (typos, bugs, etc.) I actually would like to find a script which supports the configuration of many other aspects (such as date/time, timezone, routing, etc.) Is there anything available?


How did they manage to drive a Unix computer before mice and copy & paste?

Since Unix is 40 years old, Unix is older than the invention of the computer mouse. (actually only 3 years if Unix is from 1969 and the mouse from 1972) How in the world did a new user do anything on Unix without copy & paste? I know they always had a text editor with copy/paste, but everything I do on Linux is copy from web browser, and paste (from the CLIPBOARD) into vim or gedit or gnome terminal. You're the same, right? I just can't imagine loading up a man file into vim, copying & pasting code from it- into a temporary buffer, and then having bash execute that buffer. This question has an answer, i'm hoping someone who knows can tell me. Maybe they never left emacs, is that the answer?


Redirecting Google search to HTTPS with Privoxy

I tried this in the `user.action` file:               { +redirect{s@http://www.google.*/search@https://encrypted.google.com/search@} }     .google.      But it doesn't work. My goal is to redirect from this:               http://www.google.*/searchBLA-BLA      to this:               https://encrypted.google.com/searchBLA-BLA      It could be `de`, `pl`, etc.; that's why I need the `*`.


How do I parse namespaces from an XML file using XMLLINT and BASH

Below I have an example of an Adobe XML swidtag used to track inventory. I need to parse out relevant information using xmllint in bash and output that to a new text file. For example I would like to parse the following               swid:entitlement_required_indicator     swid:product_title     swid:product_version     swid:name     swid:numeric     swid:major     swid:minor     swid:build     swid:review      I have tried using this, but it will not let me read the namespace               xmllint --xpath '//swid:product_version/swid:name/text()' file.xml      I've also tried               xmllint --xpath "//*[local-name1()='product_version']/*[local-name2()='name']/text()" file.xml      But got these errors               xmlXPathCompOpEval: function local-nameame1 not found     XPath error : Unregistered function     XPath error : Stack usage errror     XPath evaluation failure      Sample tag file for Creative Suite 5 The following sample is for Adobe Photoshop CS5 serialized as Creative Suite 5 Master Collection (Suite)               <?xml version="1.0" encoding="utf-8"?>     <swid:software_identification_tag xsi:schemaLocation="http://standards.iso.org/iso/19770/-2/2008/schema.xsd software_identification_tag.xsd"           xmlns:swid="http://standards.iso.org/iso/19770/-2/2008/schema.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">          <!--Mandatory Identity elements -->     <swid:entitlement_required_indicator>true</swid:entitlement_required_indicator>     <swid:product_title>Acrobat XI Pro</swid:product_title>     <swid:product_version>         <swid:name>1.0</swid:name>         <swid:numeric>             <swid:major>1</swid:major>             <swid:minor>0</swid:minor>             <swid:build>0</swid:build>             <swid:review>0</swid:review>         </swid:numeric>     </swid:product_version>     <swid:software_creator>         <swid:name>Adobe Systems Incorporated</swid:name>         <swid:regid>regid.1986-12.com.adobe</swid:regid>     </swid:software_creator>     <swid:software_licensor>         <swid:name>Adobe Systems Incorporated</swid:name>         <swid:regid>regid.1986-12.com.adobe</swid:regid>     </swid:software_licensor>     <swid:software_id>         <swid:unique_id>CreativeCloud-CS6-Mac-GM-MUL</swid:unique_id>         <swid:tag_creator_regid>regid.1986-12.com.adobe</swid:tag_creator_regid>     </swid:software_id>          <swid:tag_creator>         <swid:name>Adobe Systems Incorporated</swid:name>         <swid:regid>regid.1986-12.com.adobe</swid:regid>     </swid:tag_creator>     <!--Optional Identity elements -->     <swid:license_linkage>         <swid:activation_status>activated</swid:activation_status>         <swid:channel_type>SUBSCRIPTION</swid:channel_type>         <swid:customer_type>RETAIL</swid:customer_type>     </swid:license_linkage>     <swid:serial_number>909702426602037824854600</swid:serial_number>     </swid:software_identification_tag>


Fedora 17 Xorg fails to start on boot

My Fedora 17 installation is no longer booting into X : it finished loading the boot screen, then the cursor turns into an "X", flashes a quickly a few times then the just stalls. To get X to load, I have to log into a terminal, kill the Xorg process and run it manually using `startx`, at which point it all works fine. I thought it might have been an issue with the Plymouth service, as described in another post here: Fedora 17 freezes on boot, but disabling the plymouth service like this:               systemctl mask plymouth-start.service      had not effect. Oddly, in my `/var/log` directory, there are 6 Xorg log files created at every boot (named `Xorg.0.log` \--> `Xorg.5.log`). Is this normal? Are 6 Xorg servers trying to start? The #1 to #5 log files all have the same error message in them:               [ 21.665] (EE) Screen(s) found, but none have a usable configuration.      I have tried reinstalling my graphics driver (gallium driver for AMD 3450 HD card) as well as uninstalling and reinstalling plymouth. Xorg obviously works as I can start it from the command line, but why does it fail to start from booting? Any help would be very much appreciated!


What exactly is happening when I run `netctl-auto enable-all`?

My wifi connection has been dying very regularly. I notice when I run `netctl- auto enable-all` I reconnect within 5 seconds every time. (My connection has dropped twice while posting this.) Why does this work, and what does this suggest about the actual problem? How can I solve this for good? If you need more info, please ask and I'll gladly supply it. `IWCONFIG` output:               wlp3s0    IEEE 802.11abgn  ESSID:"NETGEAR30"                 Mode:Managed  Frequency:2.442 GHz  Access Point: 44:94:xx:xx:xx:xx                  Bit Rate=1 Mb/s   Tx-Power=16 dBm                  Retry  long limit:7   RTS thr:off   Fragment thr:off               Power Management:on               Link Quality=33/70  Signal level=-77 dBm                 Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0               Tx excessive retries:906  Invalid misc:12   Missed beacon:0          lo        no wireless extensions.          enp2s0    no wireless extensions.      * * * `lspci -nnk | grep -i -A5 network` output:               03:00.0 Network controller [0280]: Intel Corporation Wireless 7260 [8086:08b1] (rev 6b)         Subsystem: Intel Corporation Wireless-N 7260 [8086:c162]         Kernel driver in use: iwlwifi         Kernel modules: iwlwifi      * * * The last 20 lines of `dmesg`:               [    4.054881] systemd-journald[118]: Received request to flush runtime journal from PID 1     [    4.262104] iwlwifi 0000:03:00.0: L1 Disabled; Enabling L0S     [    4.262246] iwlwifi 0000:03:00.0: L1 Disabled; Enabling L0S     [    4.274116] IPv6: ADDRCONF(NETDEV_UP): wlp3s0: link is not ready     [    8.058666] wlp3s0: authenticate with 00:0f:xx:xx:xx:xx     [    8.060065] wlp3s0: send auth to 00:xx:xx:xx:xx:xx (try 1/3)     [    8.061828] wlp3s0: authenticated     [    8.061941] iwlwifi 0000:03:00.0 wlp3s0: disabling HT/VHT due to WEP/TKIP use     [    8.063395] wlp3s0: associate with 00:0f:xx:xx:xx:xx (try 1/3)     [    8.067304] wlp3s0: RX AssocResp from 00:0f:xx:xx:xx:xx (capab=0x431 status=0 aid=1)     [    8.068513] wlp3s0: associated     [    8.068542] IPv6: ADDRCONF(NETDEV_CHANGE): wlp3s0: link becomes ready     [   15.848000] fuse init (API version 7.22)     [  217.763444] cfg80211: Calling CRDA to update world regulatory domain     [  221.502417] wlp3s0: authenticate with 44:94:xx:xx:xx:xx     [  221.503254] wlp3s0: send auth to 44:94:xx:xx:xx:xx (try 1/3)     [  221.505078] wlp3s0: authenticated     [  221.506711] wlp3s0: associate with 44:94:xx:xx:xx:xx (try 1/3)     [  221.510277] wlp3s0: RX AssocResp from 44:94:xx:xx:xx:xx (capab=0x411 status=0 aid=10)     [  221.512033] wlp3s0: associated      * * * `lshw -c network` output:                 *-network DISABLED            description: Ethernet interface            product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller            vendor: Realtek Semiconductor Co., Ltd.            physical id: 0            bus info: pci@0000:02:00.0            logical name: enp2s0            version: 0c            serial: 20:1a:06:78:84:ae            size: 10Mbit/s            capacity: 1Gbit/s            width: 64 bits            clock: 33MHz            capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation            configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half latency=0 link=no multicast=yes port=MII speed=10Mbit/s            resources: irq:60 ioport:e000(size=256) memory:f7d00000-f7d00fff memory:f0000000-f0003fff       *-network            description: Wireless interface            product: Wireless 7260            vendor: Intel Corporation            physical id: 0            bus info: pci@0000:03:00.0            logical name: wlp3s0            version: 6b            serial: 5c:51:4f:51:b0:d5            width: 64 bits            clock: 33MHz            capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless            configuration: broadcast=yes driver=iwlwifi driverversion=3.12.9-2-ARCH firmware=22.1.7.0 ip=192.168.1.2 latency=0 link=yes multicast=yes wireless=IEEE 802.11abgn            resources: irq:61 memory:f7c00000-f7c01fff


problem dual booting windows 7 with debian

I install windows and resize its partition. I then try to install debian in the remaining space. As it's installing the base system, it consistently gives me the following error message: "No Installable kernel was found in the defined APT source". This has never happened when I just use the entire disk. I tried ignoring the message and continuing. When it finally started grub 1.99 (this was debian testing), it gave me a prompt asking me to enter a command instead of the normal "select the operating system" screen. I messed around and got another message which said something along the lines of "no kernel is installed." Why is this happening? What difference does it make that I'm now trying to install onto a smaller partition? The same thing happens with debian stable.


Make top shows only server process

Can I make _top_ show info about the **web** and **db servers**? Can it be done by piping the _pids_ to the _top_? They can be many process from every one?!? Or is there any better method for this?


Does Printing a PDF to PDF degrade its quality?

Say I have a PDF of a website which is very long. After reading some of it, I decide there are extraneous pages in it; but rather than finding the website every time I decide to eliminate a page, I want to print it to PDF and just not select that page to print (using CUPS-PDF). Will this degrade the quality of the PDF, particularly if I were to do it multiple times? Is there a better way to achieve what I am looking for? I have tried PDFEdit, with mixed results, and would like something more reliable. Of course, I can always just go back to the site and save a new version, using the same technique of neglected those pages that I don't want.


What is the significance of the the leading "4" before the listing of modified files?

After running the following command:               find /Users/UserName/Documents -type f -mtime -1 -print0 | xargs -0 du -sk | sort -nr      I receive the following output:               4   /Users/UserName/Documents/SubFolder/hello_2.txt     4   /Users/UserName/Documents/SubFolder/hello.txt     4   /Users/UserName/Documents/hello.txt      What is the significance of the leading "4 "?


How are large directories stored (one inode or many?)

I've been studying up on the ext2 file system and inodes, and I'm not quite understanding a few things. How big is an inode? The output from tune2fs says its 256 for my system, so is that 256 byes? How are large directories stored? From what I understand, a directory is represented on the filesystem as an inode who's contents are a list of filenames and inode numbers that represent the contents of the directory. Are the contents stored in the inode itself, or in this case are they stored as "data" the same way file data is stored?


How can I make Debian run m python script at startup?

I have this script in my home folder (pi): server.py. How could I make Debian run this script at startup so I dont need to log in and to i manually?


How to stop warnings from being treated as errors in JHBuild

I tried building `mutter` module using JHBuild and it fails:               <snip>     make[4]: Entering directory `/home/wena/src/mutter/src'       CC     screen.lo     core/screen.c: In function 'reload_monitor_infos':     core/screen.c:445:16: error: variable 'display' set but not used [-Werror=unused-but-set-variable]     core/screen.c: At top level:     core/screen.c:394:1: error: 'find_monitor_with_rect' defined but not used [-Werror=unused-function]     core/screen.c:418:1: error: 'find_main_output_for_crtc' defined but not used [-Werror=unused-function]     cc1: all warnings being treated as errors          make[4]: *** [screen.lo] Error 1     make[4]: Leaving directory `/home/wena/src/mutter/src'     make[3]: *** [all-recursive] Error 1     make[3]: Leaving directory `/home/wena/src/mutter/src'     make[2]: *** [all] Error 2     make[2]: Leaving directory `/home/wena/src/mutter/src'     make[1]: *** [all-recursive] Error 1     make[1]: Leaving directory `/home/wena/src/mutter'     make: *** [all] Error 2     *** Error during phase build of mutter: ########## Error running make   *** [1/1]


How do I install Chromium on F17?

I just installed the Beefy Miracle on my box, but essentially being the first time I've used Linux I'm not sure how to perform even some of the most basic tasks. I thought I would try to install Chromium as a starting exercise. I tried:               sudo yum install chromium      but the package doesn't exist. How does this work on Linux? I could easily `sudo yum install Git`, but I can't for Chromium.


Is there any way to use xargs across a pipe?

I'm trying to automatically convert flac files moved to a folder into mp3 in another folder. My current line of code is this:               inotifywait -m -r -q -e moved_to --format "'%w%f'" ~/test |  xargs -I x flac -cd x - | lame -b 320 - /media/1tb/x.mp3      To explain how this works so far, inotifywait monitors ~/test recursively for files moved there, outputting the path and filename to a pipe. xargs takes that name and creates the proper flac command, replacing x with the filename and decoding the file to another pipe. In the new pipe lame processes the output of flac into mp3 under /media. I want xargs to either reach across the pipe in some way, replacing the x in the lame command or in some way send it to a variable both commands can access or something. I tried messing around with named pipes and that jazz but the fact that there is actual data being piped between the two commands has me in way over my head. Any suggestions would be appreciated, and if something is unclear, please let me know.


Is it safe to use GParted while booted?

I have Linux Mint installed on an external hard drive, and I have the 4 main partitions (`/boot`, `swap`, `/`, and `/home`). I also have 600GB of unallocated space. I know there's always the chance of data loss, but would it be any more dangerous to add a partition while booted to that physical disk than it would while booted to another? Would adding a partition while booted to that disk be like erasing `/` as root?


XRDP Custom Resolution (Fedora 19)

How can I configure a custom display resultion for xrdp sessions? I want the session to use all the display size, minus few lines for the original decorations. that will be around 1920x1050, a resultion that isn't available in xrandr. I'm using i3 as wm, so there is no GUI or DE configuration tool.


Where are cron errors logged?

If I setup `cron` jobs incorrectly they appear to silently fail. Where should I look for an error log to understand what went wrong?


How to add self to sudoers list?

I've added myself into the sudoers users list by using the command               root@debian:/home/oshirowanen#adduser oshirowanen sudo      If I try to run that command again,               root@debian:/home/oshirowanen# adduser oshirowanen sudo     The user `oshirowanen' is already a member of `sudo'.     root@debian:/home/oshirowanen#       All looks good so far. When I then exit the root user and try to install/remove/search something using my own account, it doesn't work and complains that I am not a sudoer... For example               root@debian:/home/oshirowanen# exit     exit     oshirowanen@debian:~$ sudo aptitude search ice     [sudo] password for oshirowanen:      oshirowanen is not in the sudoers file.  This incident will be reported.     oshirowanen@debian:~$       Why is this happening? * * * This is what I get from `visudo`               #     # This file MUST be edited with the 'visudo' command as root.     #     # Please consider adding local content in /etc/sudoers.d/ instead of     # directly modifying this file.     #     # See the man page for details on how to write a sudoers file.     #     Defaults        env_reset     Defaults        mail_badpass     Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"          # Host alias specification          # User alias specification          # Cmnd alias specification          # User privilege specification     root    ALL=(ALL:ALL) ALL          # Allow members of group sudo to execute any command     %sudo   ALL=(ALL:ALL) ALL          # See sudoers(5) for more information on "#include" directives:          #includedir /etc/sudoers.d


Encoding changed after running cat

After running `cat` on some files I get the infamous 'bushes': ␌⎺└⎻⎼␊⎽⎽␊␍ ├▒⎼ °␋┌␊. B␊├├␊⎼ ┤⎽␊ ├▒⎼'⎽ ≥ which I believe are result of encoding being changed. Is there any way to recover the terminal after the encoding has changed?


Is there a command like head but for line truncation?

Linux's `head` selects a number of lines from the top of a file. Is there a command that selects a number of characters from the front of a line? The use case behind the question is this: I want to `head` the first 10 lines from a file, but each of those 10 lines is extremely long and contain lots of white space, making it hard to discern where the line breaks are. It would be much easier to get a general idea of the contents of the file if I could `head` the first 10 lines, but only view the first 50 characters of each line.


Is there a tool for seeing audit events as they happen without writing them to the disk?

Linux has an audit system that is usually used together with auditd, a daemon that, as far as I know, is designed for logging all events to the disk. However, I would like a way to directly get the events as output of a command. Is there a command that attaches to the kernel the same way auditd does, but then just prints the audit events to stdout or so instead of writing them to a file?


Python in GNOME code base

Is Python present in the Gnome code base? If so, how is it involved? **Note** : My question concerns the core GNOME Desktop Environment only (e.g. **`nautilus`** , **`gnome-session`** , **`NetworkManager`** ) and any underlying App or library.


Why doesn't su change the user ID of the shell from which it was run?

Instead, it starts a new shell process with the new user ID. The original shell is blocked until the new shell completes and su exits. Why does it work like this?


Install init scripts manually under Debian Wheezy

I played around with LSB-compatible init-scripts under Debian Wheezy (`init` is from sysvinit package version 2.88dsf-41+deb7u1). My script in the `/etc/init.d` directory is as follows:               root@T60:~# ls -l /etc/init.d/test-script     -rwxr-xr-x 1 root root 811 Aug 10 03:18 /etc/init.d/test-script     root@T60:~# cat /etc/init.d/test-script     #! /bin/sh          ### BEGIN INIT INFO     # Provides:          test     # Required-Start:    $all     # Required-Stop:     $all     # Default-Start:     2 3 4 5     # Default-Stop:      0 1 6     # Short-Description: test script     # Description:       test script     ### END INIT INFO          # always executes     touch /var/test-file          case "$1" in       start)         echo "Starting script test"         touch /var/test-file-start         ;;       stop)         echo "Stopping script test"         touch /var/test-file-stop         ;;       restart)         echo "Restarting script test"         touch /var/test-file-restart         ;;       force-reload)         echo "Force-reloading script test"         touch /var/test-file-force-reload         ;;       status)         echo "Status of test"         touch /var/test-file-status         ;;       *)         echo "Usage: /etc/init.d/test-script {start|stop}"         exit 1         ;;     esac          exit 0     root@T60:~#       As a next step I added symlink to `/etc/rc3.d` directory:               root@T60:~# file /etc/rc3.d/S05test-script     /etc/rc3.d/S05test-script: symbolic link to `../init.d/test-script'     root@T60:~#       Now if I changed my runlevel from 2 to 3 I expected script to be executed, but this did not happen:               root@T60:~# who -r              run-level 2  2014-08-01 20:47                   last=S     root@T60:~# init 3     root@T60:~# who -r              run-level 3  2014-08-10 03:27                   last=2     root@T60:~# ls -l /var/test*     ls: cannot access /var/test*: No such file or directory     root@T60:~#       I am aware that I could use `insserv` or `update-rc.d` to install scripts and then they will work as expected. Am I correct that both `insserv` and `update- rc.d` take some additional steps when enabling the script besides installing the symlinks? If yes, then which steps?


Wikipedia says that: > A page, memory page, or virtual page is a fixed-length **contiguous** block > of virtual memory, described by a single entry in the page table. It is the > smallest unit of data for memory allocation performed by the operating > system on behalf of a program, and for transfers between the main memory and > any other auxiliary store, such as a hard disk drive. Is a page contiguous in the virtual address space or physical memory or both? Thanks.


Is a symbolic/soft link similar to a shortcut/alias on a desktop?

It sounds to me like the basic idea of soft/symbolic links compared to shortcuts (on a PC) or aliases (on a Mac) are the same thing. Am I way off? Are they similar?


How to make exported shell variables permanent?

export LD_PRELOAD=/usr/lib/libtsocks.so      It's ok that I can export in this way, but how can I make it permanent? I want LD_PRELOAD to still be changed after a reboot. I'm using Ubuntu and Fedora


Upstart and bash function names containing "-"

I inherited some bash scripts where the author used "-" in the function names instead of the more normal "_" e.g.:               function a-b {     ...     }      Ugly but legal in bash. Problem is I sourced this inside an upstart script and got > x.sh: line 5: `a-b': not a valid identifier Took a while to realize it was the name and not the function contents. Anyway, renaming is not an easy option in this case and as I've learned, upstart uses `/bin/sh` not `/bin/bash` to parse? run its scripts. Hence I guess this issue. Any ideas on a workaround other than renaming? If nothing else, at least I hope this question will warn others on the perils of odd bash coding styles and how they come back to bite you sometimes.


Where does Mac OS X come from?

Discussing with Mac owners, I got several versions of where Mac OS X comes from. It is known to have some root in BSD, but how much, and where? Some say that Mac OS X has a FreeBSD kernel, with all the utilities above that makes it an OS being Mac specific. (Not speaking about user apps here, only all of the `init`, `ls`, `cd`, and others. _binutils?_ ) Others say Mac OS X is a Darwin kernel, that is pure Mac, and that the OS utilities come from BSD. Where's the truth?


print a file in hex using awk

I have a file name `x`               $ cat x     1A34532112345      I wants to print in hex using `awk` I written a script (with help from web)               fold -1 /home/cscape/Desktop/x | gawk '{ printf("%s , %X\n",$0, int($0) )}'       But output for each char is `0`               $ fold -1 /home/cscape/Desktop/x | gawk '{ printf("%s , %X\n",$0, int($0) )}'     1 , 1     A , 0     3 , 3     4 , 4     5 , 5     3 , 3     2 , 2     1 , 1     1 , 1     2 , 2     3 , 3     4 , 4     5 , 5      Why `0` for `A`. even with `%d`. I wants to print ASCII value of `A` as `HEX`.


How to test whether the file is crlf or lf without modyfing it?

I need to periodically run a command, that ensures that some _text_ files are kept in linux mode. Unfortunately `dos2unix` always modifies file, which would mess file's and folder's timestamp and cause unnecessary writes. The script I write is in Bash, so I'd prefer answers based on Bash.


Install application to /usr/local

Some application that installs automatically such as Netbean, JDK often install to `/usr/local` and I run it by normal user (not root). But another application, just extract `tar.gz` file and run it. Under normal user, I cannot use `cp` command to copy from `Download` directory to `/usr/local` directory, I must use root user (`su` command). But because I copy by root user this directory belongs to root, so I cannot run it under normal user. It makes my headache. How can I run it under normal user, as other application that I list above. Or, is there another way to install it?


Flashing rootfs on Embedded Linux with Limited RAM

I'm fairly new to the embedded world, so forgive me if this seems obvious. I'm working on a board based off of the AT91SAM9260. I have 256MB of flash and 64MB of RAM. The current setup flashes two uImages. The first if a RAMDISK only recovery image, and the second is the main uImage. The first is used to flash rootfs.ubifs onto /dev/mtd1 for the main uImage. One of the problems I'm encountering is running out of memory while flashing the rootfs from the recovery image. Depending on the size of the rootfs, it runs out of memory while flashing. I'm using TFTP to pull the image over onto the device and flash it. So, it must reside in memory along with the recovery uImage. Is there a more efficient way of doing this perhaps? While the goal is to keep our rootfs small, obviously, given it's going onto an embedded device, some of our customers have different needs and don't mind some more of the flash being taken up by the OS.


How to enable vim addon packages?

I have installed `vim-nox` as well as `vim-latexsuite` and `vim-outliner` on Ubuntu 12.10. There's nothing wrong with Vim but neither of the add-on packages does anything. What do I have to do to in order to enable them?


Arch Linux slow shutdown

I'm suffering from a very slow shutdown/reboot with Arch Linux, so I followed the instructions given here to enable logging. So here is the log generated during (slow) reboot that unfortunatelly I can't analyze by myself. Can someone help me please to understand where the problem is? PS: According to that article I've also tried rebooting with `sync && reboot -f` and it goes super fast.


Error launching Safari with PlayOnLinux

I've installed PlayOnLinux with the following commands:               wget -q -O- http://deb.playonlinux.com/public.gpg | sudo apt-key add -     sudo wget http://deb.playonlinux.com/playonlinux_precise.list -O /etc/apt/sources.list.d/playonlinux.list     sudo apt-get update          # useful dependencies     sudo apt-get install -y curl p7zip-full          # install playonlinux          sudo apt-get install -y playonlinux      and then I've installed Safari from inside PlayOnLinux. It is correctly installed, but when I try to launch it I get the next errors:               [01/23/14 12:15:35] - Running wine-1.4.1 Safari.exe (Working directory : /home/manolo/.PlayOnLinux/wineprefix/Safari/drive_c/Program Files (x86)/Safari)     p11-kit: couldn't load module: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: no se puede abrir el archivo del objeto compartido: No exApplication tried to create a window, but no driver could be loaded.     Unknown error (127).     [01/23/14 12:15:47] - Running wine-1.4.1 Safari.exe (Working directory : /home/manolo/.PlayOnLinux/wineprefix/Safari/drive_c/Program Files (x86)/Safari)     err:module:load_builtin_dll failed to load .so lib for builtin L"winex11.drv": libSM.so.6: no se puede abrir el archivo del objeto compartido: No existe el archivo o el directorio     err:module:load_builtin_dll failed to load .so lib for builtin L"winex11.drv": libSM.so.6: no se puede abrir el archivo del objeto compartido: No existe el archivo o el directorio     fixme:heap:HeapSetInformation (nil) 1 (nil) 0     err:module:load_builtin_dll failed to load .so lib for builtin L"winemp3.acm": libmpg123.so.0: clase ELF errónea: ELFCLASS64     fixme:process:SetProcessDEPPolicy (1): stub     fixme:shell:SetCurrentProcessExplicitAppUserModelID L"Apple.Safari": stub     fixme:advapi:GetCurrentHwProfileA (0x32f9ec) semi-stub     fixme:dwmapi:DwmIsCompositionEnabled 0x32fb48     fixme:win:DisableProcessWindowsGhosting : stub     fixme:service:EnumServicesStatusW resume handle not supported     fixme:service:EnumServicesStatusW resume handle not supported     p11-kit: couldn't load module: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: no se puede abrir el archivo del objeto compartido: No exApplication tried to create a window, but no driver could be loaded.     Unknown error (127).     fixme:ntdll:NtLockFile I/O completion on lock not implemented yet     fixme:msg:pack_message msg 14 (WM_ERASEBKGND) not supported yet     err:ole:RegisterDragDrop invalid hwnd (nil)     err:ole:RegisterDragDrop invalid hwnd (nil)     err:ole:RegisterDragDrop invalid hwnd (nil)     err:ole:RegisterDragDrop invalid hwnd (nil)     err:ole:RegisterDragDrop invalid hwnd (nil)      Any idea of what I am missing?


how to add command line calculator to bash that uses comma as decimal mark?

How can I add a command line calculator to my bash? I have found some, but all of them use the full stop as decimal mark, but I want to have it to use the **comma as decimal mark** as most of the world does, see picture: ![map of the world showing the use of decimal marks](http://i.stack.imgur.com/D4BqZ.png) (source wikipedia)   * blue: Full stop/Period (.)   * green: Comma (,)   * red: Momayyez (٫)   * gray: Data unavailable * * * The ones that I have found (all with full stop as decimal mark) are the following, where these lines have to be put into your `~/.bashrc` file:   1. Using bc, which has the advantage, that you can calculate ridiculously large numbers:              calc () {       bc -l <<< "$@"     }        2. With awk, where you have mnemonic names for trigonometric and other functions and you can use fractional exponents and you can give the exponent by the two chars `**` instead of the, on some keyboards difficult to type `^`:              calc () {       awk "BEGIN { print $* ; }"     }


Where can I find Aptana error logs?

Where are Aptana error logs stored in fedora?I want them to see why Aptana crashes. Edit: According to Mat's answer I checked the .log file in .metadata directory but this is what Is added to file after crash, which doesn't contain any helpful information to find what's causing the crash.                    !SESSION 2011-10-07 15:03:51.721 -----------------------------------------------     eclipse.buildId=unknown     java.version=1.6.0_22     java.vendor=Sun Microsystems Inc.     BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US     Command-line arguments:  -os linux -ws gtk -arch x86          !ENTRY org.eclipse.core.resources 2 10035 2011-10-07 15:03:52.870     !MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.


Avoid a trailing slash in bash when completing a directory name (like zsh)

I'm on a Mac and the cp and mv commands are killing me due to them copying the contents of a directory if a trailing slash is present. It has bitten me more than once when I use tab completion to specify the directory I want to copy. I have noticed zsh has a neat feature that removes the trailing slash if it's not needed after a space or enter key is pressed. Is there any way to have bash mimic this behavior?


Disable "Recently used" in GTK file/directory selector

Can I completely disable "Recently Used" feature in GTK's file / directory selector? ![Recently Used](http://i.imgur.com/AuRhZon.png) Sometimes programs default to this but since it's not useful in my work-flow and with the way I organize my files, it only adds confusion:   * I usually just expect to start from my `$HOME`, so I get surprised by the list of folders   * Also in case of file saving, I'm annoyed by the fact that you can't just type in the name and hit Enter--you have to type a path or select one I'm using Xfce 4.8 on Debian Wheezy and this feature was not available in older Xfce (in Squeeze). I found a post on Xfce-users' mailing list regarding this feature, but without any useful output. Is it possible to simply turn this off and default to `$HOME`?


Mint 15 on Lenovo G700: wired internet not working (Atheros QCA8172)

Mint 15 doesn't see internet after installing it in dualboot with windows 8 (in Windows internet works well). My network card is Qualcomm Atheros QCA8172 Fast Ethernet (rev 10). What I did:   1. Install drivers from http://www.linuxfoundation.org/collaborate/workgroups/networking/alx   2. Update kernel to 3.11.6 But it didn't fix the problem. * * * Here some additional information. ### ifconfig               $ ifconfig     eth0      Link encap:Ethernet  HWaddr 00:11:d8:0c:73:68                 inet6 addr: fe80::211:d8ff:fe0c:7368/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)               Interrupt:18           lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:65536  Metric:1               RX packets:25 errors:0 dropped:0 overruns:0 frame:0               TX packets:25 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:2951 (2.9 KB)  TX bytes:2951 (2.9 KB)      ### interfaces               $ cat /etc/network/interfaces     # interfaces(5) file used by ifup(8) and ifdown(8)     auto lo     iface lo inet loopback      ### ip               $ ip link     1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000         link/ether 00:11:d8:0c:73:68 brd ff:ff:ff:ff:ff:ff      ### iptables               $ sudo iptables -L -nv          Chain INPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination               ### iwconfig               $ iwconfig          eth0      no wireless extensions.     lo        no wireless extensions.      ### lsmod               $ lsmod          Module                  Size  Used by     iptable_filter         12810  0      ip_tables              27716  1 iptable_filter     x_tables               34194  2 ip_tables,iptable_filter     bnep                   23966  2      parport_pc             32866  0      rfcomm                 74589  0      bluetooth             391564  10 bnep,rfcomm     ppdev                  17711  0      binfmt_misc            17508  1      nls_iso8859_1          12713  1      ext2                   73792  1      joydev                 17613  0      snd_hda_codec_hdmi     41736  1      snd_hda_codec_idt      55053  1      snd_hda_intel          53038  3      snd_hda_codec         194727  3 snd_hda_codec_hdmi,snd_hda_codec_idt,snd_hda_intel     snd_hwdep              13613  1 snd_hda_codec     snd_pcm               107140  3 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel     snd_page_alloc         18798  2 snd_pcm,snd_hda_intel     snd_seq_midi           13324  0      snd_seq_midi_event     14899  1 snd_seq_midi     snd_rawmidi            30416  1 snd_seq_midi     snd_seq                66061  2 snd_seq_midi_event,snd_seq_midi     lpc_ich                21163  0      snd_seq_device         14497  3 snd_seq,snd_rawmidi,snd_seq_midi     snd_timer              29989  2 snd_pcm,snd_seq     uvcvideo               82247  0      snd                    69657  17 snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_hda_codec_idt,snd_pcm,snd_seq,snd_rawmidi,snd_hda_codec,snd_hda_intel,snd_seq_device,snd_seq_midi     psmouse               104064  0      soundcore              12680  1 snd     ideapad_laptop         18596  0      videobuf2_vmalloc      13216  1 uvcvideo     sparse_keymap          13890  1 ideapad_laptop     videobuf2_memops       13362  1 videobuf2_vmalloc     videobuf2_core         40785  1 uvcvideo     mac_hid                13253  0      serio_raw              13413  0      dm_multipath           27371  0      lp                     17799  0      mei_me                 18418  0      scsi_dh                14873  1 dm_multipath     mei                    78448  1 mei_me     videodev              138443  2 uvcvideo,videobuf2_core     bcma                   47065  0      parport                42466  3 lp,ppdev,parport_pc     btrfs                 847481  0      xor                    21411  1 btrfs     zlib_deflate           27110  1 btrfs     raid6_pq               97812  1 btrfs     libcrc32c              12615  1 btrfs     hid_generic            12548  0      dm_mirror              22277  0      usbhid                 53329  0      dm_region_hash         20932  1 dm_mirror     dm_log                 18527  2 dm_region_hash,dm_mirror     hid                   106004  2 hid_generic,usbhid     usb_storage            66567  0      nouveau               979463  0      i915                  682899  3      mxm_wmi                13021  1 nouveau     video                  19574  2 i915,nouveau     i2c_algo_bit           13564  2 i915,nouveau     ttm                    84705  1 nouveau     drm_kms_helper         53178  2 i915,nouveau     alx                    32792  0      mdio                   13807  1 alx     wmi                    19256  2 mxm_wmi,nouveau     drm                   302332  6 ttm,i915,drm_kms_helper,nouveau     ahci                   30063  6      libahci                32088  1 ahci      ### lspci               $ lspci -v          00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09)         Subsystem: Lenovo Device 3977         Flags: bus master, fast devsel, latency 0         Capabilities: <access denied>          00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09) (prog-if 00 [Normal decode])         Flags: bus master, fast devsel, latency 0         Bus: primary=00, secondary=01, subordinate=06, sec-latency=0         I/O behind bridge: 00003000-00003fff         Memory behind bridge: d0000000-d0ffffff         Prefetchable memory behind bridge: 00000000a0000000-00000000bfffffff         Capabilities: <access denied>         Kernel driver in use: pcieport          00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) (prog-if 00 [VGA controller])         Subsystem: Lenovo Device 3977         Flags: bus master, fast devsel, latency 0, IRQ 43         Memory at d1000000 (64-bit, non-prefetchable) [size=4M]         Memory at c0000000 (64-bit, prefetchable) [size=256M]         I/O ports at 4000 [size=64]         Expansion ROM at <unassigned> [disabled]         Capabilities: <access denied>         Kernel driver in use: i915          00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04) (prog-if 30 [XHCI])         Subsystem: Lenovo Device 3977         Flags: bus master, medium devsel, latency 0, IRQ 41         Memory at d1600000 (64-bit, non-prefetchable) [size=64K]         Capabilities: <access denied>         Kernel driver in use: xhci_hcd          00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)         Subsystem: Lenovo Device 3977         Flags: bus master, fast devsel, latency 0, IRQ 44         Memory at d1614000 (64-bit, non-prefetchable) [size=16]         Capabilities: <access denied>         Kernel driver in use: mei_me          00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04) (prog-if 20 [EHCI])         Subsystem: Lenovo Device 3977         Flags: bus master, medium devsel, latency 0, IRQ 16         Memory at d1619000 (32-bit, non-prefetchable) [size=1K]         Capabilities: <access denied>         Kernel driver in use: ehci-pci          00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)         Subsystem: Lenovo Device 3977         Flags: bus master, fast devsel, latency 0, IRQ 45         Memory at d1610000 (64-bit, non-prefetchable) [size=16K]         Capabilities: <access denied>         Kernel driver in use: snd_hda_intel          00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4) (prog-if 00 [Normal decode])         Flags: bus master, fast devsel, latency 0         Bus: primary=00, secondary=07, subordinate=07, sec-latency=0         Capabilities: <access denied>         Kernel driver in use: pcieport          00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4) (prog-if 00 [Normal decode])         Flags: bus master, fast devsel, latency 0         Bus: primary=00, secondary=08, subordinate=08, sec-latency=0         Memory behind bridge: d1500000-d15fffff         Capabilities: <access denied>         Kernel driver in use: pcieport          00:1c.2 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 3 (rev c4) (prog-if 00 [Normal decode])         Flags: bus master, fast devsel, latency 0         Bus: primary=00, secondary=09, subordinate=09, sec-latency=0         I/O behind bridge: 00002000-00002fff         Memory behind bridge: d1400000-d14fffff         Capabilities: <access denied>         Kernel driver in use: pcieport          00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04) (prog-if 20 [EHCI])         Subsystem: Lenovo Device 3977         Flags: bus master, medium devsel, latency 0, IRQ 23         Memory at d1618000 (32-bit, non-prefetchable) [size=1K]         Capabilities: <access denied>         Kernel driver in use: ehci-pci          00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04)         Subsystem: Lenovo Device 3977         Flags: bus master, medium devsel, latency 0         Capabilities: <access denied>         Kernel driver in use: lpc_ich          00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04) (prog-if 01 [AHCI 1.0])         Subsystem: Lenovo Device 3977         Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 42         I/O ports at 4088 [size=8]         I/O ports at 4094 [size=4]         I/O ports at 4080 [size=8]         I/O ports at 4090 [size=4]         I/O ports at 4060 [size=32]         Memory at d1617000 (32-bit, non-prefetchable) [size=2K]         Capabilities: <access denied>         Kernel driver in use: ahci          00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)         Subsystem: Lenovo Device 3977         Flags: medium devsel, IRQ 10         Memory at d1615000 (64-bit, non-prefetchable) [size=256]         I/O ports at 4040 [size=32]          01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M / GT 620M/625M/630M/720M] (rev a1)         Subsystem: Lenovo Device 3910         Flags: fast devsel, IRQ 16         Memory at d0000000 (32-bit, non-prefetchable) [size=16M]         Memory at a0000000 (64-bit, prefetchable) [size=256M]         Memory at b0000000 (64-bit, prefetchable) [size=32M]         I/O ports at 3000 [size=128]         Expansion ROM at b2000000 [disabled] [size=512K]         Capabilities: <access denied>          08:00.0 Network controller: Broadcom Corporation BCM43142 802.11b/g/n (rev 01)         Subsystem: Lenovo Device 0611         Flags: bus master, fast devsel, latency 0, IRQ 17         Memory at d1500000 (64-bit, non-prefetchable) [size=32K]         Capabilities: <access denied>         Kernel driver in use: bcma-pci-bridge          09:00.0 Ethernet controller: Qualcomm Atheros QCA8172 Fast Ethernet (rev 10)         Subsystem: Lenovo Device 3803         Flags: bus master, fast devsel, latency 0, IRQ 46         Memory at d1400000 (64-bit, non-prefetchable) [size=256K]         I/O ports at 2000 [size=128]         Capabilities: <access denied>         Kernel driver in use: alx      ### rfkill               $ rfkill list all          0: ideapad_3g: Wireless WAN         Soft blocked: no         Hard blocked: no      ### dmesg https://docs.google.com/file/d/0Bz7Myw57yQvoVlZCLTNrUjdhNmc/edit?usp=sharing&pli=1


Specify identity file (id_rsa) with rsync

I need to make periodic backups of a directory on a remote server which is a virtual machine hosted by a research organisation. They mandate that access to VMs is through ssh keys, which is all good, except that I can't figure out how to point rsync to the ssh key for this server. Rsync has no problem if the key file is `~/.ssh/id_rsa`, but when it is something else I get `Permission denied (publickey)`. With ssh I can specify the identity file with `-i`, but rsync appears to have no such option. I have also tried temporarily moving the key on the local machine to `~/.ssh/id_rsa`, but that similarly does not work. **tl;dr** Can you specify an identity file with rsync?


Multiple GUI windows in one (GUI applications windows multiplexer/wrapper)

I was wandering if there are some programs or methods, where I can do something similar like Terminal multiplexer - Wikipedia, the free encyclopedia \- except where each region of the "multiplexer" application is a GUI window of an application all its own. Here is an imaginary example - I'd, basically, like to write in terminal something like this (pseudocode):               $ gui-multiplexer-application --width 600 --height 600 \       --command "scite" --heightratio 60       --command "gnome-terminal -e 'PS1=\"$\"'" --heightratio rest      ... which would, in turn, start up something like this (that image I montaged manually in Gimp): ![gui-mplex](http://i.stack.imgur.com/bBPgz.png) I don't need any methods to specifically connect these applications (if a command can be started with arguments, then I could use that) - what I would like is that both windows are moved in sync when you drag the master ("gui- multiplexer-application") window title bar; and hopefully, that the horizontal separator line is draggable, so one can readjust the height that the inner windows take up respectively (readjusting the width through the master bounds goes without saying, I guess). Anything like this out there? (I'm on Ubuntu 11.04 with Gnome2; however, I imagine this kind of application would work on an X11 level, thus being hopefully portable between different DE/WM. ) EDIT: This is somewhat like a tiling window manager - however, a proper tiling window manager replaces the entire desktop; I instead would like a tiling window manager inside a window with a titlebar (which can appear in any other WM I may otherwise be using). In fact, one could use scripts like `awesome_test` in Using Xephyr - awesome, but they start a whole new X session, so there are interaction problems like grabbing keyboard inputs, and not being able to find the "regular" desktop environment styling. Which is why I'm looking for a similar functionality, but which works within a single application window. (Also possibly related: sticking stickies to windows - Unix & Linux Stack Exchange) (Backround: I like writing Latex in Scite; and while Scite does have a terminal window, on my version it is non-interactive - so if `latex` ends up with an error, I cannot issue a Ctrl-C or X or anything to have the process terminate; so I have to use a proper terminal anyways. Now, there is `geany` which actually does have a proper terminal, but I don't want to change text editors for this application (Latex writing). I'm sure there could the other situations where this "GUI window multiplexing" would be useful, though. )


Change cursor theme with immediate effect

Is there a way to change the cursor theme with immediate effect in X, after it starts up? I've tried `xrdb -merge` which doesn't work (nothing happens).


How to use sudo in Fedora?

I use to be a fans of Ubuntu, when I want to execute a command as root user, I do this `sudo blah_blah_blah`. But in Fedora 16, it doesn't seem recognize this command. Any clue on this?


Courier-imap with sendmail setup: why is my IMAP inbox empty?

I've successfully installed sendmail, but when I connect to the Courier IMAP server via Outlook, the Inbox is listed as empty. When I check the inbox with Alpine locally on the server, it has content though. Why? I do see files with content in /var/mail . Is that not where Courier-imap checks for mail? The setup is pretty clean - I run Ubuntu 12.04 on AWS, have installed sendmail and courier-imap. sendmail was configured with `sendmailconfigure` and it works well to both send and receive mail. The problem is with courier.


Replace yum with apt

I have used Ubuntu for like two years now. I am very comfortable with the aptitude package manager. I recently switched to Fedora(16)[I still have ubuntu on my other drive :) ] I am behind a university firewall (with all kind of data restrictions). In these circumstances I realized apt is better suited and effective when compared to yum. How can I replace yum with apt??


How can I reformat tabular data using AWK?

I have a file contain following output.               ora.abc.db           1        ONLINE  ONLINE       serverA              Open           2        ONLINE  ONLINE       serverB              Open     ora.xyz.db           1        ONLINE  ONLINE       serverA              Open           2        ONLINE  ONLINE       serverB              Open           2        ONLINE  ONLINE       serverC              Open      I want to format this file in following way, but i want to use `shell script` only, I believe we can use awk but i don't have logic               abc  abc1  ONLINE serverA     abc  abc2  ONLINE serverB     xyz  xyz1  ONLINE serverA     xyz  xyz2  ONLINE serverB     xyz  xyz3  ONLINE serverC


Cursor keys in bash in dtterm don't work as expected

I am trying to remap some of my keyboard shortcuts in bash. The problem is that when I try to display key code using `Ctrl-V`, not all keys work. For example, Typing `Ctrl-V`, then `Home` moves the terminal to the top, just as usual. Typing `Ctrl-V`, then `Ctrl` shows nothing. Typing `Ctrl-V`, then `left arrow` shows `^[OD`, typing `Ctrl-V`, then `Ctrl-left arrow` shows the same thing. I am trying to remap Home and End to move cursor to the beginning or end of line, and Ctrl-arrows to jump words. I am in Solaris, using DtTerm. SOLUTION: .Xdefaults:               Dtterm*DtTerm*Translations: #override \n\     <KeyPress>osfBeginLine: string("0x1B")string("[1~") \n\     <KeyPress>osfEndLine:   string("0x1B")string("[4~") \n\     Ctrl<KeyPress>osfLeft:  string("0x1B")string("OC") \n\     Ctrl<KeyPress>osfRight: string("0x1B")string("OD")      .inputrc:               "\e[1~": beginning-of-line     "\e[4~": end-of-line     "\eOD": forward-word     "\eOC": backward-word


Using cp to replace a directory of the same name

How can I make `cp` replace a directory of the same name without removing the existing directory first? `cp`'s default behaviour is to copy the source directory into the destination rather than replace it:               mkdir -p test/a     mkdir a     cp -a test/a a      `a` is now within `a`, it didn't replace `a`. How can I make `cp` replace directories? I want it to work the same way it does with files. I could of course delete the target first, but I don't want to have to run more than one command :)


Port fowarding and load balancer in ubuntu server 12.04

I am looking to create a load balancing server. Essentially here is what I want to do: I have a public IP address, lets say 1.1.1.1 I have a second public IP address, lets say 2.2.2.2. I have a website, www.f.com point to 1.1.1.1 via an A record. I want that Ubuntu server to forward traffic like this:   * Port 80 traffic is forwarded to 2.2.2.2 on port 60,000 and port 60,001.    * Port 443 traffic is forwaded to 2.2.2.2 on port 60,010 and port 60,011.    * Port 25 traffic is forwared to 2.2.2.2 on port 60,020 and port 60,021 The port forwarding is more important then being able to load balance. I look forward to some responses. Both server 1.1.1.1 and 2.2.2.2 are both running Ubuntu 12.04 server edition.


I need Control loop help -

this is what I figured out in sorting an Array that has already had it's elements declared type int               #!/bin/bash     #sorting an "predeclared" array            typeset -i store BigNum      let store=0 BigNum=0           number=([0]=11140344 [1]=3 [2]=0 [3]=2 [4]=11140345 )            for (( a=0; a <= 5 ; a++ ));        do         if (( number[a+1] < number[a] )); then                    store=number[$a]               number[$a]=number[$a+1]               number[$a+1]=$store               BigNum=$store           fi               # I think BIGNUM can be passed back in a function by writing       # return $BIGNUM its passing an array that is the BIG PROBLEM!!!!           echo $BigNum " BIG NUM always returns the biggest number"      done      this is the FOR LOOP I am working with, it is going way out of bounds.               x=0     while [[ $x -lt 1 ]]; do            # my main loop I am working with        # to get that greatest number       # out of the odd ball numbered       # element put it in order then        # get it LOOP       ########     for(( a=0; a<${#lostsongs[@]}; a++ ));     do                   if [[ ${lostsongs[a+1]}<${lostsongs[a]} ]]; then                  store="${lostsongs[a]}"             lostsongs[a]="${lostsongs[a+1]}"             lostsongs[a+1]=store             echo "$store val in if 1st for loop larger val"        fi            # echo $store " Larger Bigger number post if statement"        let x++        done      #################            let x++       done      this is the output from the good code from my first loop (with set -x).                echo 3 4 1 2 ' all of the array elements filled are in this order'      that is all I am wroking with four(4) elements. the out put from that loop is this                + echo 'store val in if 1st for loop larger val'      store val in if 1st for loop larger val      + let x++      + (( a++  ))      + (( a<1134 ))      + [[ '' < store ]]      + store=store      + lostsongs[a]=      + lostsongs[a+1]=store      + echo 'store val in if 1st for loop larger val'        store val in if 1st for loop larger val      my logical assumption is that               (( a<1134 ))      is my array.length when it should be 4, that BASH is seeing causing my for loop to over run and go crazy mad. All I would like is for someone to help me and write me a control loop to stop my FOR LOOP at the count of 4 as writing all these different types of loops in all the different ways they can be written to try and figure out how to control my FOR LOOP and stop it at 4 is doing noting by driving me loopy. it would be a great help so I can't quit practicing my arrow up last command Enter then Ctrl C reflexes, and writing every kind of loop known to mankind and get to more important things like learning how to write this BASH syntax in getting that FOR LOOP work too and all that. if that is not out of the question, hopefully it is not. ............................ ADDED DO TO A PERSON ASKING FOR MORE INFORMATION SO THIS IS EVERYTHING-- NOT yelling just caps so one will take notice with out having to add the word SEX. this first script works what I am working on I want to add it to this script up update the lostsongs array in the               #!/bin/bash     #     ########################################################################     ########################################################################     # for GNU/Linux                                                        #     # BASH Script                                                          #     #                                                                      #     # converts all the mp3 files in a directory from whatever bitrate to   #     # 128k bitrate.                                                        #     # Then adds an underscore between the artist_name_TITLE_ALBUM from the #     # metadata creates a new file of the same, and Directory and           #     # subdirectory in the same manner eleminating the need to use quotes to#     # malnipulate the data and directiories. then moves the new file into  #      # same directories and subdirectories. Then deletes the old file.      #     # ffmpeg only takes it to 192k.                                        #          # You can change it to any bitrate you want (WITHIN_SPECS) and even    #     # add the other -args to include the other features included           #     # with ffmpeg  --    works with version ffmpeg 0.8.9-6:0.8.9-1                         #     # put it in any directory then give it the path  you are working on then run it.     #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$                          #     #&  Written By: Mikie Heras Dec. 04, 2013                              #      #& FINISHED DEC. 5, 2013                    &                          #     #&##########################################&###########################     #&##########################################&###########################          typeset -i xf mf sn bn hn          let xf=1 mf=0 bn=5 hn=6          lostsongs[0]=4               #get MAX NUMBER -- mp3 files in folder     #MAXNUM="$(ls $PWD/*.mp3 | wc -l)"          #so it can sit in the home dir and search what ever folder     # I want            MAXNUM="$(find ~/music/ -type f -name *.mp3 | wc -l )"           mf=MAXNUM #set the count down number          echo ; echo ; echo ; echo ; echo     #inform the user how many files are in the folder          echo $MAXNUM " mp3's in folder MUSIC"     sleep 3     echo ; echo ; echo ; echo ; echo          #search out all the mp3 files in the directory     # set how many I want to convert at a time            find ~/music/ -type f -name "*.mp3" | while [ $xf  -le 100  ] ;      do read FILENAME;          #############################################################     #get the metadata tags off the mp3's using exiftool-perl     #################          ARTIST="`exiftool -Artist "$FILENAME" -p '$Artist'`"      TITLE="`exiftool -Title  "$FILENAME" -p '$Title'`"      ALBUM="`exiftool -Album  "$FILENAME" -p '$Album'`"           #replaces all the crap and the spaces       #between the names with an underscore      #"${x// /_}" meaning "${varName//search pattern/replace with}"          newArt="${ARTIST// /_}"     newTit="${TITLE// /_}"     newAlb="${ALBUM// /_}"          echo $newArt     echo $newTit         echo $newAlb         #just for good mesure let me see what's going         echo $FILENAME " before set stipping down.."         sleep 2              #strip the old file name off the path from FILENAME         #over kill but in good measure          c=$FILENAME         xpath=${c%/*}          xbase=${c##*/}         xfext=${xbase##*.}         xpref=${xbase%.*}         path=${xpath}         pref=${xpref}         ext=${xfext}              ##############################################################         # assign the file a new name         # if LOSTSONG no metadata then add a number to the array[0]          # 1st element [zero] then incurment hn by one 1 for checking to         # be sure that it is the right file in the MOVING FILES section         #          ######              if [[ ! -n "$newArt" && ! -n "$newTit" && ! -n "$newAlb" ]] ; then             echo "${lostsogns[0]} that is Lsogn num.. before going to sogn"           newFile="I_HAVE_NO_IDEA-WHO-I-AM-(Lost-Song-Number-("${lostsongs[0]}"))-192k.mp3"         (( lostsongs[0]++ ))              let hn++                  elif [[ -n "$newArt" && -n "newTit" && ! -n "$newAlb" ]] ; then                 newFile="Artist-${newArt}_Title-${newTit}_192k.mp3"               else                 newFile="Artist-${newArt}_Title-${newTit}_Album-${newAlb}_192k.mp3"       fi         echo $newFile "new file name ..."         sleep 3          ##############################################################     # convert the file to 128k using ffmpeg version 0.8.9-6:0.8.9-1      ###            ffmpeg  -b 128k -vol 425 -i "$FILENAME" "$newFile"          ##############################################################     # MAKE DIRs     #############          if [[ ! -d ~/music2 ]] ;then               mkdir ~/music2/     fi          if [[ ! -d ~/music2/"${newArt}" ]]; then              echo "making newDir $newArt  ..."             mkdir ~/music2/"${newArt}"/     fi          if  [[ -d ~/music2/"${newArt}" && \     ! -d ~/music2/"${newArt}"/"${newAlb}" ]] ; then         echo "making dir/sub $newArt / $newAlb .."         mkdir ~/music2/"${newArt}"/"${newAlb}"/     fi          if [[ ! -d ~/music2/lostsongs/ ]] ; then         mkdir ~/music2/lostsongs/         echo "making Lost Dir .."     fi              ##################################################################     #     ## MOVE THE FILES      #this siganls out the newfile uneekly     #if no counter movement then no lost song was found     #to insure that the $newFile is one that has a place in a diffetent     #folder named lostsongs "${foo[0]}" < c && a -gt b          ###################################################################              if [[ ! -n "$ARTIST" && ! -n "$TITLE" && ! -n "$ALBUM" ]] ; then       if [[ "${lostsongs[0]}" < bn && hn > bn   ]] ;        then         echo "Found a Lost Sogn Yo! .."          mv "${newFile}" ~/music2/lostsongs/         let bn++        fi             fi                         ## if the newAlb is asigned and not empty      # what to do to check it          if [[ -n "$newArt" && -n "${newAlb}" ]] ; then         echo "-n newAlb true -- moving file \          to $newAlb -- newAlnum $newArt "          mv -f "${newFile}" ~/music2/"${newArt}"/"${newAlb}"/     fi          if [[ ! -n "${newAlb}" ]] ; then         echo " -n $newAlb  newAlbum not present moveing to $newArt \          new artist.."         mv -f "${newFile}" ~/music2/"${newArt}"/     fi          ###############################################################     # getrid of the old file     ###############################          killfile="${pref}.${ext}"     mv "${path}/$killfile" "${killfile//*/killme}"      rm "killme"          ############     #     #Used for MAXNUM or checksum in loop to tell script how many files to convert      # in the run      #############     let xf++     let mf--    # lets the user know how many files left to do               echo ; echo ; echo ; echo ; echo ; echo "$mf ..... mp3/s left to do ..."     echo ; echo ; echo ; echo ; echo     done               # with this new code I am working on to update that lostsongs[0]     # I am having problems with this global asignment too. I googled how to     # make an array global and it seems I am not the only one that has this      # problem - I have yet to find the solution it seems that bash ver has     # a lot to do with it too.      # GNU bash, version 4.2.37(1)-release (i486-pc-linux-gnu)     #     # it is a string val 1 2 3 4 5 6 7 8 9 10 ......      #      # with this a=0 ; a < $num or ${array[@ ' num'] being a int? ; a++      #     # in C++ it easier all I got a do is, for ( int a ; a < whatever int ; a++ )     #     # if I write it ( $a ; .. to get to the valule inside that variable I get      # an error too then there is the adding inside the element itself [a+1]     # that I am not  sure if bash can do that even.      #      # when I check this array after I have filled it with just 4 elements      # (for test purposes) outside that first loop I get 0      # BASH don't have a strToint() and IntTostr() that I can find     # to make it easier      #                #!/bin/bash          set -x          typeset -i xf mf sn bn hn n  snewnum d  store          let xf=1 mf=0 bn=3 hn=4 n=1 snewnum=0  store=0 n=0          declare -gA lostsongs  # this does not even work          # declare -a lostsongs # this does not work       # no globalization of array achieved yet          lostnum="$(find /home/userx/testscripts/ -type f -name "*.mp3" | wc -l)"          ###################################################     #     # FOR updating the lost song files so as not to      # over write any     ####################################          find /home/userx/testscripts/ -type f -name "*.mp3" | while [[ $n -lt lostnum ]] ; do     read FILE;          #echo $FILE  "<-- that is file"     nstring=${FILE##*/} #gets just the file name     lstring=${nstring##I*"("} #chops off Lside to the ( leaving num     rstring=${lstring%%")"*} #chops off Rside to the ) leaving the num          snewnum=$rstring #holds the char of type num                lostsongs[$n]=$snewnum         echo "lostsongs[$n] = ${lostsongs[n]}  fill array"         echo ${lostsongs[*]} " all the shit"          let n++     done          echo     echo          echo ${#lostsongs[@]}     echo     echo     echo     echo ${lostsongs[*]}          #get the hightest number then pass it     #needs to be  array[0]=greatest number then reset count     #####################                    #for(( a=0; a<${#lostsongs[@]}; a++ ));     #this for does not work because of the -lt synax     #for (( a=0 ; a -lt ${#lostsongs[@]}; a++ ));          for (( a=0 ; a < 4 ; a++ )) ;       do           ## Move Larger Values to the right.      # this one don't work      # because there are no spaces around "<", [[ only sees one,       #non-empty, argument, and returns true every time.     # if [[ ${lostsongs[a+1]}<${lostsongs[a]} ]]; then           # this one works        if [[ ${lostsongs[$a+1]} -lt ${lostsongs[$a]} ]]; then          # if (( lostsongs[a+1] < lostsongs[a] )); then         store="${lostsongs[a]}"         lostsongs[a]="${lostsongs[$a+1]}"       echo ${lostsongs[a+1]}       echo "${lostsongs[a+1]}"          lostsongs[a+1]=$store          echo "$store val in if 1st for loop larger val"      fi      # echo $store " Larger Biger number post if statment"               done          ##     #with the way that the last "test script is written in this writting this      #is the out put      #     ###          userx@bw-crunchbang:~/testscripts$ ./testnum     + typeset -i xf mf a sn bn hn n snewnum d store     + store=0     + let xf=1 mf=0 bn=3 hn=4 n=1 snewnum=0     + n=0     + declare -gA lostsongs     ++ wc -l     ++ find /home/userx/testscripts/ -type f -name '*.mp3'     + lostnum=4     + [[ 0 -lt lostnum ]]     + read FILE     + find /home/userx/testscripts/ -type f -name '*.mp3'     + nstring='I_HAVE_NO_IDEA-WHO-I-AM-(Lost-Song-Number-(3))-192k.mp3'     + lstring='3))-192k.mp3'     + rstring=3     + snewnum=3     + lostsongs[$n]=3     + echo 'lostsongs[0] =   fill array'       lostsongs[0] =   fill array     + echo 3 ' all the shit'       3  all the shit     + let n++       ..............     + echo 'lostsongs[3] =   fill array'       lostsongs[3] =   fill array     + echo 3 4 1 2 ' all the shit'        3 4 1 2  all the shit     + let n++     + [[ 4 -lt lostnum ]]     + echo     + echo 0       0     + echo          + (( a=0  ))     + (( a < 4  ))     + [[ '' -lt '' ]]     + (( a++  ))     + (( a < 4  ))     + [[ '' -lt '' ]]     + (( a++  ))     + (( a < 4  ))     + [[ '' -lt '' ]]     + (( a++  ))     + (( a < 4  ))     + [[ '' -lt '' ]]     + (( a++  ))     + (( a < 4  ))     userx@bw-crunchbang:~/testscripts$       therefore the first problem is to make that array Global somehow. as I have said Google is full of how do I make an array global with so far I have not found an answer to even the others that asked that question. the second is turning Char into Int values to work with 'I think that is the two problems I have other then does BASH allow Math in side the element? [a+1] [a*1] (times, x 1) [a/1] div and [a-1] even?


How can I check whether I have installed non-free software?

I'm thinking of a program which would scan packages and report some statistics about them - and report all packages that contain non-free software. It would of course have to include kernel modules, drivers and other binary blobs that are often allowed in distributions. The wider the scope of the search - the better. I'd like this functionality on Fedora, but something that works on most distributions would be preferred.


Pipe the output of a command if it is successful

INPUT_FILE=`ls -rt $MY_DIR/FILE.*.xml | head -1 | xargs basename`      I wanted to execute the second command (`head -1`) only if the first command is successful. How do I improve this command?


Are time interrupts always followed by a scheduler call?

When a timer interrupt occurred the ISR is called to service the interrupt. Is it okay to assume that every timer interrupt ends with a call to the scheduler on which process should continue running next? Can that be generalized and say that every interrupt must end in a scheduler call?


spinlock sharing between process and interrupt context

If a spinlock is held in a process context, what will happen if the same spinlock is required in an interrupt context? Either the interrupt handler will wait until the spinlock is released by the process or it will schedule on another processor. Which one actually happens? Also, if local interrupts are disabled on the current processor will the interrupt handler still wait for the spinlock to be released?


How to remove a package for the current user?

How can I remove a package for a given user but leave it installed so that other users can still access it? I'm using Ubuntu 12.10.


KDE toolbar background messed up

At one day (it has been for a while now) the background of KDE main toolbar started looking really strange: screenshot (it looks to me as the alpha channel of the background image is missing). Debugging I've done:   * When I change the workspace theme in KDE System Preferences to something else than "Air" and back again, the problem disappears.   * When I choose any some other theme than the default "Air" there is no problem, except that I don't like these other themes as much.   * I created a new clean user account and logged in with KDE - the same problem appeared - so it's not that I have some outdated files in my .kde4 config directory.   * I have tried reinstalling several components of KDE that could effect this, but without success - might have not been the right ones, haven't done a complete reinstall of KDE. It probably happened after some update of my Gentoo system, but I may not remember correctly, as I have looked for a solution to this for quite some time now. If only I knew were to look for to find this particular image file and see if there is something wrong with it... but I've grepped and located and finded in /usr/share quite a bit and I don't seem to understand where are those KDE workspace theme files located. Using KDE 4.4.5 with the default "Air" theme.


Why is NetworkManager package name upper case?

All other software packages are lower case, so why NetworkManager upper case?


Setting up the superuser password for the first time

How can I set up the super user password for the first time in Zorin OS, since the installer didn't ask me to provide one. I have experience with Fedora and openSUSE, but they asked me for the superuser's password during the installation process.


“crash” when switching users in Linux Mint 12

I have a clean Linux Mint 12 install on a Lenovo R61i laptop. I have multiple users configured - one for myself, my wife, and my daughter. My account is the only sudoer. Two or three times a week the machine "crashes" when switching users, seemingly only when both users are already logged in. Once the user has requested a switch, typed their password, and hit enter, they are presented with a black screen with a flashing white cursor in the top-left. No matter how long one waits, this screen does not change. The only way I've found out of this situation is to hold down the power button until the machine shuts off, then start her up again. I should point out that we switch users often, most of the time without any issue at all. So it's difficult to reproduce. I've had a search around but haven't been able to determine whether this is a known issue or not. Can anyone offer any advice on how to rectify this? UPDATE: I just had the "crash" again, and tried various key combinations to see if I could get any response whatsoever. Turns out that Ctrl+Alt+Del briefly printed out some standard shutdown messages (too fast for me to relay, I'm afraid) and then restarted the machine. Still eager for a solution to this issue.


How do I add an entry to my crontab?

I am using crontab for the first time. Want to write a few very simple test cron tasks, and run them.               $crontab * * * * * echo "Hi"      doesn't produce anything.               crontab */1 * * * * echo "hi"      says `*/1: No such file or directory`. Also, how do I list the currently running cron tasks (not just the ones I own, but ones started by other users such as root as well). And how do I delete a particular cron task?


CentOS GUI problem using Gnome

For some reason lately when I try to set the date using the interface, or simply install a .rpm by double clicking the dialog that should prompt me to input my passowrd just shakes like it has a bug. The dialog window that shakes has the title               "Authenticate"     Privileges are required to change the system time/install software/etc          Ann application is attempting to perform an action that requires privileges.      Authentication as the super user is required to perform this action          Authenticat Failure      And I have to options: `Cancel` and `Authenticate`. The problem is this windows just shakes and disappears so I can't actually press the Authenticate button. And after this window disappears I get a new one that says:               Failed to set the system time:     Not Authorized for action org.gnome.clockapplet.mechanism.settime      Why is this happening? A few days ago I was able to input my password and install software now this happens.


Why is the current device size bigger that the current volume size after resizing an ntfs partition?

I'm resizing an ntfs partition using `ntfsresize` (ntfs-3g) and `fdisk`. I used the following command in order to change the filesystem size:               # ntfsresize -f -s 10G /dev/sdb1     ntfsresize v2013.1.13AR.1 (libntfs-3g)     Device name        : /dev/sdb1     NTFS volume version: 3.1     Cluster size       : 4096 bytes     Current volume size: 31457276416 bytes (31458 MB)     Current device size: 31457280000 bytes (31458 MB)     New volume size    : 9999995392 bytes (10000 MB)     Checking filesystem consistency ...     100.00 percent completed     Accounting clusters ...     Space in use       : 538 MB (1.7%)     Collecting resizing constraints ...     Needed relocations : 23717 (98 MB)     WARNING: Every sanity check passed and only the dangerous operations left.     Make sure that important data has been backed up! Power outage or computer     crash may result major data loss!     Are you sure you want to proceed (y/[n])? y     Schedule chkdsk for NTFS consistency check at Windows boot time ...     Resetting $LogFile ... (this might take a while)     Relocating needed data ...     100.00 percent completed     Updating $BadClust file ...     Updating $Bitmap file ...     Updating Boot record ...     Syncing device ...     Successfully resized NTFS on device '/dev/sdb1'.      The second step is to change the size of the partition, so I divided the new size (`9999995392`) by 512, and I got 19531241 sectors. So, I ran `fdisk` and deleted the first partition, and I created it anew:               # fdisk /dev/sdb     Command (m for help): d     Partition number (1-4): 1          Command (m for help): n     Partition type:        p   primary (1 primary, 0 extended, 3 free)        e   extended     Select (default p): p     Partition number (1-4, default 1):     Using default value 1     First sector (2048-156299374, default 2048):     Using default value 2048     Last sector, +sectors or +size{K,M,G} (2048-61442047, default 61442047): +19531241          Command (m for help): t     Partition number (1-4): 1     Hex code (type L to list codes): 7     Changed system type of partition 1 to 7 (HPFS/NTFS/exFAT)      Everything seems to work, gparted shows no errors: ![screen](http://i.stack.imgur.com/5T7tM.png) But the size of the new partition is bigger compared to its filesystem:               # ntfsresize -i -f /dev/sdb1     ntfsresize v2013.1.13AR.1 (libntfs-3g)     Device name        : /dev/sdb1     NTFS volume version: 3.1     Cluster size       : 4096 bytes     Current volume size: 9999995392 bytes (10000 MB)     Current device size: 9999995904 bytes (10000 MB)     Checking filesystem consistency ...     100.00 percent completed     Accounting clusters ...     Space in use       : 538 MB (5.4%)     Collecting resizing constraints ...     You might resize at 537047040 bytes or 538 MB (freeing 9462 MB).     Please make a test run using both the -n and -s options before real resizing!      It's just one sector (512b). Does anyone know where this extra sector came from?


I need kernel headers for 2.6.21.5

Preferably in slackware module format(lzm). Can't seem to find it. Can anyone help me?


Processing two files using awk

I read Comparing two files using Unix and Awk. It is really interesting. I read and tested it, but I can't understand it completely and use it in other cases. I have two files. `file1` has one field and the other one has 16 fields. I want to read elements of `file`1 and compare them with 3rd field of `file2`. If there was a match for each element, I sum value of field 5 in `file2`. As an example: ### file 1               1     2     3      ### file 2               2 2 2 1 2     3 6 1 2 4      4 1 1 2 3     6 3 3 3 4       For element 1 in `file1` I want to add values in field 5 of `file2` where value of field 3 is 1. And do the same for element 2 and 3 in `file1`. The output for 1 is (3+4=7) and for 2 is 2 and for 3 is 4. I don't know how I should write it with awk.


How to retrieve lost aliases?

Let me start by saying I know this was dumb. Time and Linux make fools of us all. I made an echo command to my .bash_aliases file and erased all of my aliases, except the test alias. However, I still have a session open that has the aliases loaded (into the tcl?). Can I retrieve them from this session?