title: unexpected apache redirection

text: I'm trying to make all http versions of my pages redirect to the https version, however I am having some problems with redirection. I want `http://stackexchange.com/path/` to go `https://stackexchange.com/path/` but instead it is redirecting to https://stackexchange.compath Here is my configuration for the virtual hosts:               <VirtualHost *:80>     ServerName stackexchange.com     ServerAlias www.stackexchange.com        Redirect / https://stackexchange.com/     </VirtualHost>          <VirtualHost *:443>     ServerName stackexchange.com     ServerAlias www.stackexchange.com     SSLEngine on     ...


title: convert pdf to image [jpeg|png]

text: I need to convert pdf files into image files (like: png (prefer), jpeg). I used `convert` (from the ImageMagick package) but it takes more than 4 seconds for a 2 page pdf file with only tables (something like an invoice), so this pdf is really light. I found out that `convert` uses `gs` to do it. If I do this with `gs`, the result can be of better quality, and rendered faster. So I have 3 questions:   1. Should I use some specific flags in ghostscript package compilation process to make it work faster?    2. What options for `gs` can help me get png or jpg files faster and with better quality?   3. Where can I find documentation about conversion from pdf to image formats?


title: Add a user to the system *only if it doesn't exist*

text: I've been running the `useradd {user}` command to add users to my system, though I plan on running this in an automated environment, and it might end up being run again, even though the user already exists. Is there a way that I can run this, only if it doesn't already exist? The user doesn't have a home folder. Thanks! Tom.


title: Using Metasploit with 3G USB modem

text: I have a computer with Linux BackTrack 5 as host and Windows XP as guest on virtual box. I am using Host-Only-Adapter to create virtual LAN and to share USB modem internet as well so that both host and guest are simultaneously connected to internet via single USB modem. Since my WAN IP address dynamically changes, I am using a host-name from no- ip.com to identify my dynamic WAN IP address. With this settings I am able to get meterpreter session using `windows/meterpreter/reverse_tcp_dns` payload (and port 80) every time I execute `payload.exe` from Windows XP guest. However, when I execute `payload.exe` from other Windows XP computer that is on a real LAN, outside my computer, I never get meterpreter sessions. What makes me confused is that the connection is established from `netstat` on target computer. In this state, if I leave target computer and back to Linux server and scan it with nmap to check port 80 then it said that the port is closed (even though session was not created). Thus: 1) Why weren't the meterpreter sessions created on Linux server while target machine (temporarily) said that connection was established and port 80 on Linux computer is closed as well? (I said temporarily because after several minutes if I check again the netstat on target computer the connection is disappear but port 80 on Linux is still closed.) 2) If server on real-LAN was block the port then why netstat on target computer said that connection was established? if ISP block the port then why I can do it from virtual box? 3) Is it port-forwarding issue? but I doubt since I only use USB dongle and I can do it on virtual box without port-forwarding. 4) Is my 3G USB broadband connection speed not fast enaugh? has anybody success using Metasploit with USB modem?


title: Downloading file through SSH with a "proxy" machine inbetween

text: I need to download a file from machine C to machine A. To do that, I need to login to machine B (I am doing this using `scp`), as I cannot access C directly from A. Would it be possible to download a file from C to A with a single command or a script?


title: Why does this syntax not work for declaring associative array

text: Can i use a variable inside () syntax               #!/bin/bash     declare -A c     declare -A b     a="[a]=0 [b]=1 [c]=2 [d]=3"     b=($a) # or b=($(echo "$a"))     echo "***********${b[@]}*********"  #********************          c=([a]=0 [b]=1 [c]=2 [d]=3)     echo "---------${c[@]}----------"  #---------0 1 2 3----------


title: Align text to center with padding on both sides

text: Is there an easy way to align text to the center with padding on both sides, with the column width being the longest line from the input? For example, this:               aaa     bbbb     c     ddddd     ee      will turn into this (the dots represent spaces):               .aaa.     bbbb.     ..c..     ddddd     .ee..      Any tool is fine. Be it `sed` or `awk` or a bunch of `coreutils` tools. **Edit** : I think some of you misunderstood the output. The output is padded with _spaces_ , not dots. I've used dots here just to make it more clear.


title: Help improving my AWK skills

text: This program works as I intended but I feel like I used some clumsy methods to get the out put I desired(especially with my use of print commands and variable declarations)      Could some one improve this script so I can see where I could improve?   Does some one want to show me some crazy bummed version of this?   Is setting variables in the BEGIN block which "runs every line !@#!#@!" how you are supposed to set a variable in AWK?                 #!/usr/bin/awk -f     BEGIN{     FS=",";     recordsCursor=1;     number=0;     #spacer="_";     #copies=3;     }     {         while(number++ <=copies){             while(recordsCursor <= NF){                 if(recordsCursor==1){                 printf($recordsCursor);                 printf(spacer);                 printf("%.3d,",number);                 }else if(NF != recordsCursor){                     printf("%s," , $recordsCursor);                     }else{                     printf("%s" , $recordsCursor);                     }             recordsCursor++;             }         recordsCursor=1;         print "";         }     print "";     number=0;     }      > >     Command: ./test.awk -v copies=3 -v spacer=_ input >   Given input:               madison_Leaderboard_728x90,728x90,Leaderboard ads for Madison,no,,,,,,,_blank,image,web     madison_Bullseye_300x250,300x250,Bullseye ads for Madison,no,,,,,,Bullseye,_blank,image,web     madison_Button_155x155,155x155,Button ads for Madison,no,,,,,,,_blank,image,web      Correct output:               madison_Leaderboard_728x90_001,728x90,Leaderboard ads for Madison,no,,,,,,,_blank,image,web     madison_Leaderboard_728x90_002,728x90,Leaderboard ads for Madison,no,,,,,,,_blank,image,web     madison_Leaderboard_728x90_003,728x90,Leaderboard ads for Madison,no,,,,,,,_blank,image,web     madison_Leaderboard_728x90_004,728x90,Leaderboard ads for Madison,no,,,,,,,_blank,image,web          madison_Bullseye_300x250_001,300x250,Bullseye ads for Madison,no,,,,,,Bullseye,_blank,image,web     madison_Bullseye_300x250_002,300x250,Bullseye ads for Madison,no,,,,,,Bullseye,_blank,image,web     madison_Bullseye_300x250_003,300x250,Bullseye ads for Madison,no,,,,,,Bullseye,_blank,image,web     madison_Bullseye_300x250_004,300x250,Bullseye ads for Madison,no,,,,,,Bullseye,_blank,image,web          madison_Button_155x155_001,155x155,Button ads for Madison,no,,,,,,,_blank,image,web     madison_Button_155x155_002,155x155,Button ads for Madison,no,,,,,,,_blank,image,web     madison_Button_155x155_003,155x155,Button ads for Madison,no,,,,,,,_blank,image,web     madison_Button_155x155_004,155x155,Button ads for Madison,no,,,,,,,_blank,image,web


title: Avoid mutt sending mail with too many entries in To: or Cc: fields

text: Frequently, I use `mutt`'s alias functionality, to send a message to larger groups of people (legitimate, not spam!). Normally, I put the alias into the `Bcc:` field, to cancel out spam harvesters, and for privacy reasons (not all recipient know each other). By accident, I sometimes put the alias into the `To:` or `Cc:` field, where it is expanded, revealing all addresses do all recipients. This is very bad, since once sent, the information is leaked, and there's no way back.   * How can I make `mutt` refuse to send a mail, if there is more than, say, 1 entry in the `To:` or 5 entries in the `Cc:` field?   * Improvement: How can I make `mutt` send the mail anyways, if I add a user-defined header, e.g., `X-limit-cc: 50`? Setting up a separate mailing list service is not what I'm asking for, this would rather be a separate solution to the problem.


title: Emacs ansi-term and term not working well when I ssh into a remote machine

text: I have the exact same Emacs configuration on a local and remote machine, and when I run `M-x ansi-term` or `M-x term` on each of them individually everything works great. However, if I run any of these term emulators on Emacs on the local machine, and then I ssh into the remote machine, the prompt is not displayed correctly and my input doesn't work well either. Any ideas what may be causing this?


title: Unable to connect to host via ssh

text: I have problem connecting to host via ssh. It prompts me this error :               debianbox@debian:~$ssh cdcharles@hephaistos.rsr.lip6.fr     ssh_exchange_identification : Connection closed by remote host      The problem is that I used to connect to that machine before with the same account, but now I don't know what happen I just get this error. I try to warn the admin but he says that everything works fine. Can somebody tells me what is the problem?


title: CentOS boot problem

text: We're using VMware Server which is running on CentOS in our company environment. As you can see,now the only thing holding this up is the CentOS can't boot. Also, I am guessing it sounds like a superblock corrupt. What might be the problem? ![sreenshot](http://i.stack.imgur.com/vCsq1.jpg)


title: iptables not starting up

text: I have inherited a custom built Linux kernel 2.6.30.9 and am just upgrading the underlying OS from RHEL 5.4 to 5.8 (kernels 2.6.18.164 and 2.6.18.308 respectively). When booting, the following is displayed:               unloading iptables modules                   [  OK  ]     Applying iptables firewall rules: modprobe: FATAL: module ip-tables not found.          iptables-restore v1.3.5: iptables-restore unable to initialize 'filter'          Error occurred at line 3     try 'iptables-restore -h' or 'iptables-restore --help' for more information     .                                             [FAILED]      the `/etc/iptables` file looks like:               # Firewall configuration written by system-config-securitylevel     # Manual customization of this file is not recommended.     *filter     :INPUT ACCEPT [0:0]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [0:0]     :RH-Firewall-1-INPUT - [0:0]     -A INPUT -j RH-Firewall-1-INPUT     -A FORWARD -j RH-Firewall-1-INPUT     -A RH-Firewall-1-INPUT -i lo -j ACCEPT     -A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT     -A RH-Firewall-1-INPUT -p 50 -j ACCEPT     -A RH-Firewall-1-INPUT -p 51 -j ACCEPT     -A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT     -A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT     -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT     -A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT     -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited     COMMIT      the section of `kernel_config`               #     # IP: Netfilter Configuration     #     # CONFIG_NF_DEFRAG_IPV4 is not set     # CONFIG_IP_NF_QUEUE is not set     CONFIG_IP_NF_IPTABLES=y     # CONFIG_IP_NF_MATCH_ADDRTYPE is not set     # CONFIG_IP_NF_MATCH_AH is not set     # CONFIG_IP_NF_MATCH_ECN is not set     # CONFIG_IP_NF_MATCH_TTL is not set     # CONFIG_IP_NF_FILTER is not set     # CONFIG_IP_NF_TARGET_LOG is not set     # CONFIG_IP_NF_TARGET_ULOG is not set     # CONFIG_IP_NF_MANGLE is not set     # CONFIG_IP_NF_TARGET_TTL is not set     # CONFIG_IP_NF_RAW is not set     # CONFIG_IP_NF_SECURITY is not set     # CONFIG_IP_NF_ARPTABLES is not set     # CONFIG_IP_DCCP is not set     # CONFIG_IP_SCTP is not set     # CONFIG_TIPC is not set     # CONFIG_ATM is not set     # CONFIG_BRIDGE is not set     # CONFIG_NET_DSA is not set     # CONFIG_VLAN_8021Q is not set     # CONFIG_DECNET is not set     # CONFIG_LLC2 is not set     # CONFIG_IPX is not set     # CONFIG_ATALK is not set     # CONFIG_X25 is not set     # CONFIG_LAPB is not set     # CONFIG_ECONET is not set     # CONFIG_WAN_ROUTER is not set     # CONFIG_PHONET is not set     CONFIG_NET_SCHED=y      and this is matched in `/proc/config.gz` Is there a simple way to bring this to life? Do iptables behave differently when compiled into the kernel compares to compiled as module objects?


title: Get rights for specific user on file/dir

text: I'm searching for a command that essentially would do the following: check which rights a user has on a file/dir (including ACL) and return it. E.g. say you have the following directory:               -rw-r--r-- 1 user1 group1 [snip] file1     -rw-rw-r-- 1 user2 group1 [snip] file2     drwxrwx--- 1 user2 group2 [snip] dir1      Then the commands & output should be (if user1 is a member of only group1):               rights user1 file1 => r-- or 4     rights user1 file2 => rw- or 6     rights user1 dir1 => --- or 0      Is there such a command available or which tools/commands can't be used to construct a script which would do it?


title: Apostrophe appearing as space

text: I am trying to insert the following message:               friend's mobile number      from a file over redhat server into sql server 2005.   this message is appearing in the sql server as below:               friend s mobile number      where the apostrophe is appearing as a space, I tried different escape characters but still didn't work. How can I fix this?


title: How to make data-recovery very-very hard or impossible for Unix -computer before reselling?

text: I resell my Thinkpad and I want to make sure its old content in the harddrive is not readable. The Thinkpad has now Debian -installed but I sell it as-is so no OS needed. How can I can rewrite the harddrive so many times that it becomes unreadable with any recovery -program?


title: I am trying to open port 19132 on my Ubuntu server, but not working

text: I am trying to set up a server for my son to play `Pocketmine`. This is a `PHP` server and it is running on port 19132. I have opened this port on my router and if I run another server, like a Rails server, then everything is fine. When I try to run `Pocketmine`, the port is never open. I have the server running now. Here is my `netstat` output. ![Netstat output](http://i.stack.imgur.com/p8lMr.png) You can see the server, it is the first line that is a `udp port`. I see that it does not have a state of `LISTEN`. Here is the output from my server.   ![Server Output](http://i.stack.imgur.com/TpLkB.png) What could be the problem? Why does the `udp` server not it a state of `LISTEN`? Does it need to be in a state of `LISTEN`? What else could be the problem to stop the port from being open? What do I do to trouble shoot this?


title: network interface counters not working?

text: I just built a router and installed it with Ubuntu Server 14.04 LTS. The system has two NICs, one for the internal network and one for the external (`p3p1`) network. I'd like to monitor external interface usage, but the `ifconfig` counters are always at 0. `ip -s link ls p3p1` shows zero for all counters as does `cat /proc/net/dev`. The internal interface (`em1`) counters work fine. According to `lspci`, the external interface is a Qualcomm Atheros AR8161 Gigabit Ethernet (rev 10). Other than the counters, it works fine. How do I get the counters working on this device?


title: Kill wifi connection

text: I am trying to debug my wifi which does not work so I want to stop wpa_suppliciant and apply the -d option If I first               kill -9 <pid>      Then               ps -A | grep wpa      returns a new pid I am on               Linux r4 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:12 UTC 2014 i686 i686 i686 GNU/Linux


title: Escape closing parentheses from URL with firefox -remote

text: I have this command (for detailed info see Shortcut to google selected text): `sh -c 'firefox -remote "openURL(http://www.google.com/search?q=$(xsel),new- tab)"'` But when I select a text which ends with `)` it parses it as a closing parenthesis. Is there a workaround this? (like escaping it somehow?)


title: How to unlock admin account

text: By mistake I locked my admin account on Debian with passwd -l. I'm trying with live CD to unlock my account with no sucess. I've tried editing passwd file by removing x, but that didn't work.               /etc/passwd     root:x:0:0:root:/root:/bin/bash      any ideas?


title: Show a sliding window of output from a program

text: I want to run a command (`rsync -av`) and only display 10 lines of output at any time. I have found a similar post, but I don't want to redirect it to a file. I want the output to be displayed simultaneously, but only 10 lines at most should be visible. For example: The output has 100 lines, when its finished. At the beginning, it shows the line 1-10. Then 2-11 --> 3-12 --> 4-13 until 91-100 I tried it with:               rsync -av /source /destination | tail -f -n 10      It's something like this:               rsync -av /source /destination | while read i; do echo -en "\r$i"; done      but with 10 lines instead of 1.


title: Transferring Operating System from VM to Physical System

text: I have Ubuntu 13.04 running in a VM in VirtualBox. Originally, I was just trying it out, but now I've started using it a lot, and I have many of my programs and files in it. Is it possible to transfer this to a partition on my hard drive? Also, (this would be much more preferable), is it possible for me to transfer it to a bootable USB? My System: Ubuntu 13.04 64 bit running in VirtualBox Windows 8.1 Pro 64 Bit


title: How to achieve higher display resolution for Ubuntu under VirtualBox?

text: In this setup, Ubuntu under VM only achieves low resolution at 640 * 480 while host is 1920 * 1024. How to, (I believe is to configure X server), achieve higher resolution? I have set in VirtualBox 3D acceleration ON. VirtualBox installed with all default setting. Ubuntu 14.04 Desktop installed as the only VM. Intel i5, 2.8GHz, 4 cores, 4G RAM, Windows 7.


title: ACPI problem with recent kernels

text: In recent versions of popular Linux distributions (Ubuntu, Fedora, Mint, Debian) I always have to put `acpi=off` into the kernel parameter list before I want to boot the computer. This happens to both the live CDs and the installed version. I have been unable to find information on fixing this. I guess I have to change some settings in the kernel and compile my own (my Gentoo installation doesn't have this problem). How should I go forward in fixing this ACPI thing? Update 1: Screenshot ![enter image description here](http://i.stack.imgur.com/BHhDY.jpg) Update 2: kernel config diffs (I grep'ed for ACPI so it's relatively short). If you want, also have a look at my Gentoo kernel config (working), and Mint's bundled kernel config (not working). Update 3: I used the kernel config of Mint to compile a kernel for Gentoo and got the same error, which is a good sign that the problem is with the kernel config.


title: How to get information about word, address size, address bus size, data bus size and instruction bus size?

text: I was wondering how to get information about the following things from the command line in Linux:   * word (i.e. the size that the CPU can process at one time, which may not be the OS bit-depth),   * address size (i.e. the number of bits in an actual address),   * address bus size (not sure if it is the same as address size by definition, but I think they are different and may not agree),   * data bus size,   * instruction size?


title: How to add the RPM Fusion and livna repositories to Fedora?

text: RPM Fusion and Livna.org are common third party package repositories for Fedora. You need them if you want to install media players, codecs and/or DVD playback libraries that are not part of the primary Fedora repository because of assumed issues like distribution licensing or similar. Thus my question how to enable them in Fedora (>= 17)?


title: How to find out if Ubuntu is using DHCP (Ubuntu 12.04 LTS GUI)

text: How can I find out if my IP address is DHCP, Fixed or Dynamic? I need to tell my network administrator what the IP address is, that my Virtual Machine is using. I know the numbers, but I don't know if it is fixed or not. I have tried: `ifconfig` and that returned my IP address.


title: Force usage of DNS server provided by DHCP?

text: I got a preconfigured debian image that gets it's network configuration by DHCP, however the DNS server is/was fixed to 8.8.8.8. This was configured using /etc/resolv.conf, so I deleted all the entries there. /etc/dhcpc/resolv.conf contains the DNS server I would like to use, however this DNS server isn't used by the system. How do I activate the usage of the DNS server provided by DHCP? Thanks!


title: Where can I get Debian initial version ISOs?

text: I am interested in installing initial versions of Debian on VirtualBox. Can anybody tell me where I can find these ISOs?


title: Source code of original Netscape Navigator

text: Where is it possible to download the source code of the first _open source_ browser _Netscape Navigator_ released in about 1998? I already searched for it and wasn't able to find the original version of this browser from 1998.


title: Logging only transferred files with rsync

text: I've created a backup script with rsync and I have it running every 10 minutes. I have it logging using --progress but to make reading the log easier I only want to include files that are transferred. I.e. at the end of a run I would like to see something in the log like:               Started transfer at 2012-07-31 11:03:45          /some/file/that/was/changed.txt     /another/file/that/was/added.jpg          Number of files: 35184     Number of files transferred: 2      I can't find anything after a bit of googling. Is there a way to do this? Thanks.


title: write file to NFS speed issue

text: I have a big data file need to write to NFS directory which is mapped under a Windows system. I had 2 different approaches to achieve this. I wrote (using the “save as” command) from the app directly to NFS. I first wrote to a local drive, then copied the file to NFS directory. I didn't do accurate statics, but it occurs to me approach is definitely faster, and seems I cannot find a reasonable explain for this phenomenon, anyone got any ideas? Say I have a big file (600 MB), if I directly save it to NFS, it will be slower compared to I first save it to local drive then move the file to NFS, why is that?


title: How to make unix service see environment variables?

text: I have set my environment variable using `/etc/profile`:               export VAR=/home/userhome      Then if I do `echo $VAR` it shows `/home/userhome` But when I put reference to this variable into the `/etc/init.d/servicename` file, it cannot find this variable. When I run `service servicename status` using `/etc/init.d/servicename` file with following content:               case "$1" in     status)             cd $VAR/dir         ;;     esac      it says `/dir: No such file or directory` But it works if I run `/etc/init.d/servicename status` instead of `service servicename status` How can I make unix service see environment variables?


title: Kernel Panic - Can't find root filesystem / error mounting /dev/root

text: From here: http://fedoraproject.org/wiki/Common_kernel_problems#Can.27t_find_root_filesystem_.2F_error_mounting_.2Fdev.2Froot > A lot of these bugs end up being a broken initrd due to bugs in mkinitrd. > > Get the user to attach their initrd for their kernel to the bz, and also > their /etc/modprobe.conf, or have them examine the contents themselves if > they are capable of that. > > Picking apart the initrd of a working and failing kernel and doing a diff of > the init script can reveal clues. To take apart an initrd, do the following > ..               mkdir initrd         cd initrd/         gzip -dc /boot/initrd-2.6.23-0.104.rc3.fc8.img | cpio -id       I wish to understand what exactly is being done here.   What has `initrd` to do with anything?   Where are we supposed to create the directory `initrd`?


title: Displaying week's number in certain format using ncal or cal

text: Don't you just love it when two commands each do one thing you want but neither do both? This is what `cal` does. Nice formatting. Lacks week numbers though.               $ cal         January 2012           Su Mo Tu We Th Fr Sa        1  2  3  4  5  6  7        8  9 10 11 12 13 14       15 16 17 18 19 20 21       22 23 24 25 26 27 28       29 30 31                    This is what `ncal` does. Weird formatting, but with week numbers.               $ ncal -w         January 2012           Su  1  8 15 22 29        Mo  2  9 16 23 30        Tu  3 10 17 24 31        We  4 11 18 25           Th  5 12 19 26           Fr  6 13 20 27           Sa  7 14 21 28               1  2  3  4  5         The kind of output I want, actually a crossbreed between `cal` and `ncal -w`:               $ cal --magik-calendar-week-option         January 2012             Su Mo Tu We Th Fr Sa       1   1  2  3  4  5  6  7       2   8  9 10 11 12 13 14       3  15 16 17 18 19 20 21       4  22 23 24 25 26 27 28       5  29 30 31


title: Faking rsnapshot initial backup

text: I'm currently using plain and flat `rsync` to backup my files, meaning I have no incremental backups. A few days ago I became aware of the existence of `rsnapshot` and after looking at the man page I came to the conclusion that this is a great tool and I'd like to use it. My 'problem' now is that I'd like to use my already existing backups as a base for the first `rsnapshot` backup.   After looking at the man page I'm thinking I should be able to move my existing backups to the `hourly.0` directory, `rsnapshot` would create upon the first `rsnapshot hourly` invocation. Am I correct on this? Unfortunatly I don't have enough storage to make a backup of my backups for playing around.


title: How can I set Dolphin to be the default file manager in KDE?

text: After one of the recent upgrades of my Debian Testing the default file manager in KDE switched from Dolphin to Konqueror for some reason. How can I switch it back?


title: Battery monitor always at 100%

text: I have Linux Mint 15 KDE and my battery monitor always shows full energy, even when it's about to be exhausted. Any ideas why is this happening? acpi output:               Battery 0: Discharging, 0%, 02:27:21 remaining


title: Difference between maximum resident set size as reported by /usr/bin/time vs. getrusage?

text: I ran the command `a.out` like this:               $ /usr/bin/time -f"%M" ./a.out      `a.out` also uses the function `getrusage()` and prints:                 printf("%ld",ru.ru_maxrss);      where the first `ru` is the struct. When I run it, it gives me:               1228      1632      What is the difference between maximum resident set size as reported by `/usr/bin/time %M` and `getrusage`?


title: Run a script via cron every other week

text: I've done quite a bit of research in how to do this, and I see there's no direct way in cron to run a job, say, every other Thursday. Right now, I'm leaning toward making a script that will just run _every_ week, and will touch a "flag" file when it runs, and if it runs and the file is already there, to remove the file (and not perform the bi-weekly action). My question is, is there any other more elegant or simpler way to accomplish this goal of a bash script of actions running every other week automatically? Thanks!


title: Can shell variable include - character?

text: I am not able to use `-` in variables in shell. Is there a way to be able to use it, because I have one script which depends on such named variables:               $export a-b=c     -bash: export: `a-b=c': not a valid identifier          $export a_b=c      First throws the given error and second works fine.


title: How to create a new partition in Ubuntu

text: I want to build my own Linux as "Linux From Scratch". I need to get a new partition from my hard disk. I checked and saw I have sda1. (I have about 20G empty) When I use the `fdisk` command `n`, I can only get about 500M space (according to the first and last cylinder `fdisk` provided me). Why? Could anyone help me? How can I do this correctly? Screen shots of my operation: ![fdisk output](http://i.stack.imgur.com/PnYX3.png) ![df output](http://i.stack.imgur.com/OuzwE.png)


title: Is it possible to have two different volume level?

text: I am playing background music on audacious player. At the same time I am watching youtube videos. The problem is that the volume on Audacious is the Master volume, so it is impossible to have volume down on audacious and high volume whilst I am watching youtube videos. Is there a way to have a different volume for Audacious?


title: How to recover a SD card?

text: I accidentally deleted my SD card photos. I purchased a software call wondershare photo recovery and card recovery. I am able to recover back 50% of my photos. But I got some strange issues here. Actually I am able to recovered all photos. But only old photo (mean 1 or 2 years back) are recovered in full size (3-5MB), the latest photos (all 2013) were recovered in 30-100KB only. From thumbnail and the mega tag, I am able to see the image and information. But when I open the image file. Its look like fragments. Since the day I accidentally deleted the photos, I had never use this SD card anymore to avoid data overlap. But I really dont understand why I can recovered those old photos, the latest photos all is fragments?


title: Text-based mail client with usability

text: I have fond memories to using `pine` and `emacs/rmail` for reading mail in the 90's. At some point I switched over to Gmail plain HTML, but I recently realized I really miss navigating mail with cursor keys, replying with R, etc. And that QUICK, QUICK response to every action that did not involve an HTTP request to some far-off server. With this in mind, I tried `alpine` and `mutt` a year ago, and they were extremely complex things. A million settings, and they insisted on downloading my 100.000 emails from Gmail, which of course took forever, and searching was dead slow, and there were so many ways to get lost. What I suspect, is that UNIX mailers are super-complex, historical beasts trying to cater for every UNIX guru's possible need, with configuration files that require a Ph. D. in astrophysics. What I'm wondering is, has someone who has taken the following approach: Make a lightweight, text-based email client for UNIX terminals, but with great simplicity and usability for everyday tasks such as replying/deleting/forwarding mail, threading, super-fast searches even for huge mailboxes, and simply for getting quickly through your inbox. And yeah, some brilliant, seamless way of viewing attachments (this being a text-based environment). Sort of a "take the best from the minimalism from UNIX and combine it with the usability of the modern Web" kind of approach. I think I would start crying if someone had actually made this.


title: How to use expandos in backtick shell command

text: In my `.muttrc` I have `attribution` set to emulate Outlook-style message quoting like this:               set attribution="\n\n-----Original Message-----\nFrom: %f\nSent: %d\n%t\nSubject: %s\n"      However, the `%t` expando evaluates to "To Persons_Name" with no colon after the "To" so I'd like to run it through a shell command to add the colon. I can use backticks to run a shell command but I can't figure out how to get the value of the `%t` expando in the shell command. I've tried this but it doesn't work:               set attribution="\n\n-----Original Message-----\nFrom: %f\nSent: %d\n`echo %t | sed s/^To/To:/`\nSubject: %s\n"


title: Tool to compare 2 excel sheets in linux

text: I want to be able to compare 2 excel sheets in linux. I am not interested in converting them to `csv` format as they have a complicated formating that is not supported in `csv`. I would like to be able to have a graphical comparison (some sort of `kompare` way). The tool should be available in linux platform. Any ideas ?


title: log freeradius ip address with username

text: i configured a mikrotik with linux(freeradius+rsyslog+mysql) to authenticate and log users activity. now i want to log users visited urls, but only ip addresses of users and visited urls are logged. what should i do if i want to log usernames + visited urls in my database? users ----------> mikrotik -----> Linux_Box (freeradius + rsyslog + mysql) **is there another way rather than assigning ip addresses to usernames?**


title: how to subtract a constant value from a data file?

text: I want to subtract a constant number from my data to get new data file. For example, I want to subtract 10 from my data. data.txt               Id  a   b   c   d   e     1   1   2   3   4   5     2   2   3   4   5   6     3   3   4   5   6   7     4   4   5   6   7   8     5   5   6   7   8   9     6   6   7   8   9   10     7   7   8   9   10  11     8   8   9   10  11  12     9   9   10  11  12  13     10  10  11  12  13  14     11  11  12  13  14  15     12  12  13  14  15  16     13  13  14  15  16  17     14  14  15  16  17  18      Required output: out.txt               Id  a   b   c   d   e     1   -9  -8  -7  -6  -5     2   -8  -7  -6  -5  -4     3   -7  -6  -5  -4  -3     4   -6  -5  -4  -3  -2     5   -5  -4  -3  -2  -1     6   -4  -3  -2  -1  0     7   -3  -2  -1  0   1     8   -2  -1  0   1   2     9   -1  0   1   2   3     10  0   1   2   3   4     11  1   2   3   4   5     12  2   3   4   5   6     13  3   4   5   6   7     14  4   5   6   7   8


title: PPTP VPN client connectivity not working

text: I am trying to connect to my VPN from my `tonidoplug`. I followed the steps found in PPTP Client. But I am getting the below error now:               $ sudo pon codeme debug dump logfd 2 nodetach     Couldn't open the /dev/ppp device: No such device or address /usr/sbin/pppd: Please load the ppp_generic kernel module.      From what I found somewhere in the Internet I tried adding the line `alias char-major-108 ppp_generic` to my `/etc/modprobe.d/modules.conf` file and rebooted the device. Still am not able to connect to VPN.


title: pam.d password hardening: nullok

text: In most all pam.d documentation or linux distributions that I saw, the recommend "secure" configuration for password is the following:               password    required    pam_unix.so sha512 shadow nullok rounds=65536      looking up the documentation for "nullok", i found the following:               The default action of this module is to not permit the user access to a service if their official password is blank. The nullok argument overrides this default.      So IMO, it should be disabled, **null passwords aren't ok**. So the question are:   * will it break something?    * maybe system accounts (however, they are normally disabled) won't work anymore?    * Any known issue?


title: Difference between the terminal file and the terminal screen

text: I recently posted a question about terminals and this seemed like it deserved its own question. If the **tty** which would be **synonymous with terminal** , is just the device driver/device file itself, _what provides the actual interface to the terminal, and what is it called?_ I don't mean the gui in any way, I mean the actual area (either in a virtual terminal or a possibly a psuedo-terminal) where text is being printed and read. _Is this considered a part of the terminal? Are these in some way controlled by the kernel? Basically if someone wanted to write a console program, like gnome-terminal (or even with virtual terminals), is there some sort of kernel based widget/interface that takes input and output? **Basically is the tty (itself i.e. /dev/tty) just a file or does it include the code needed to display output (in various colors and weights), and read from the keyboard._** Is this correct: I found here What is the exact difference between a 'terminal', a 'shell', a 'tty' and a 'console'? that is says tty is synonymous with terminal. This is what is confusing me. I would think that to emulate a terminal or to provide a terminal, would require the terminal driver (tty) and the terminal display and interactive part (something like xterm). So by itself the tty is simply a driver for input and output, and what displays and reads the text from and to the tty is something like xterm? Would be calling the "/dev/tty a terminal driver" also be correct? Also when I say xterm I mean the value of the $TERM var. Another thought (let me know about this one): The tty file is synonymous with the connection between the terminal or these day terminal emulator, and the shell. Now they are all in the same box, but the original terminals would be the terminal emulators of today (clearly), but the tty or tty files would sort of act like the serial connection between the terminal and the shell/operating system. These days it seems like to me the terminal emulator is an environment/window for interacting with the /dev/tty... files and the shell sits at the other side? So writing to the /dev/tty file would be like writing to or reading form the serial port? I'm assuming this is not exactly how it works, any help would be greatly appreciated :-(.


title: MongoDB "service" on clean Redhat can not be started

text: I just bring up `Redhat 6.5 64-bit` from AWS and did the below things:   * Disabled SELinux   * Disabled Iptables   * All ports opened in Security Group   * Rebooted Then i just followed, both of the below instructions:   * http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux/   * http://docs.mongodb.org/manual/tutorial/install-mongodb-enterprise-on-red-hat-or-centos/ I tried the both Links separately after clean installations again.   Here is the version:               [root@www.example.com ~]# mongod --version     db version v2.6.4     2014-08-19T04:35:58.234-0400 git version: 3a830be0eb92d772aa855ebb711ac91d658ee910      **THEN HERE IS THE PROBLEM** :               [root@www.example.com ~]# service mongod start     Starting mongod:                          [FAILED]      And here are the logs:               [root@www.example.com ~]# tail /var/log/mongodb/mongod.log     2014-08-19T04:30:07.669-0400 [initandlisten] shutdown: going to close sockets...     2014-08-19T04:30:07.669-0400 [initandlisten] shutdown: waiting for fs preallocator...     2014-08-19T04:30:07.669-0400 [initandlisten] shutdown: lock for final commit...     2014-08-19T04:30:07.669-0400 [initandlisten] shutdown: final commit...     2014-08-19T04:30:07.669-0400 [initandlisten] shutdown: closing all files...     2014-08-19T04:30:07.669-0400 [initandlisten] closeAllFiles() finished     2014-08-19T04:30:07.669-0400 [initandlisten] journalCleanup...     2014-08-19T04:30:07.669-0400 [initandlisten] removeJournalFiles     2014-08-19T04:30:07.671-0400 [initandlisten] shutdown: removing fs lock...     2014-08-19T04:30:07.671-0400 [initandlisten] dbexit: really exiting now      This is quite a very clean installation.   What is happening please. Note:               [root@www.example.com ~]# ll /var/lib/mongo/mongod.lock      -rwxr-xr-x. 1 mongod mongod 0 Aug 19 04:32 /var/lib/mongo/mongod.lock


title: Multiple Command List After Shell Conditionals, &&, ||. Shell Script, Dash

text: I'm trying to do multiple commands after a condition, so for example...               [ $VAR ] || echo "Error msg" ; echo "exit"      and the Inverse               [ -z $VAR ] &&  echo "Error msg" ; echo "exit"      I know that won't work as intended, I actually knew how previously and forgot how to do this. I'm fully aware of the many alternatives, such as using `if`'s or bracketing via `()` and `{}` . Using `()` will create a sub process which wouldn't exit a running script. Using `{}` will work, but I know a more readable alternative exists. I have done this with a `:`, and it was perfect!!! I just can't remember now for the life of me, and I lost that previously written script. If anyone knows how to write this with the `:`'s, I would really appreciate any help!


title: Why use a pts for xterm or anything

text: I keep reading on multiple sites that pts device files are used for pseudo- terminals which are "not directly connected to the hardware" (ssh, telnet). _Since xterm running on you machine is directly connected the output on your keyboard and the display on your screen, why does this use a pseudo-terminal device file?_ I read the other question regarding ttys pts, ... and it didn't seem to cover this.. _Also, what is the need for a "pseudo terminal," if it's ultimately a device file with input and output why does it matter what it's coming from?_ Thanks in advance


title: Dell XPS 15 runs hot on linux

text: I'm worried about my Dell XPS notebook. When I'm on Linux, its temperature is always higher than on Windows. I was facing some pretty ugly slowdowns earlier today and it shut itself down the first time today too (then I noticed it was really hot). I'm on openSuse 12.1 currently, but on Ubuntu (10.10, 11) and Mint (Lisa, I think) I got worried about the notebook being too hot too. I know there's the Optimus stuff but I'm thinking this is not the answer I need, I'm on linux most of the time because I'm working and browsing and I switch to Windows only when I'll play something so I'm not worried about running Minecraft or anything too graphical on linux. I'm worried about it overheating, slowing down, shutting down and eventually breaking. Lets go to the numbers. `sensors` in openSuse 12.1 running gnome-shell (probably was higher when I had slow downs/shut down)               temp1: +84.0°C (crit = +100.0°C)     temp2: +84.0°C (crit = +100.0°C)          nouveau(GPU)          temp1: +73.0°C (high = +100.0°C, crit = +110.0C      `sensors` in openSuse 12.1 with iceWM (lighter graphical interface)               temp1: +74.0°C (crit = +100.0°C)     temp2: +74.0°C (crit = +100.0°C)          nouveau          temp1: +68.0°C (high = +100.0°C, crit = +110.0°C)      On Windows, CPU stays between 40°C-50°C and GPU in the mid 50°C. I'm guessing 84°C is too high. `lspci`               00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)     00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)     00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)     00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)     00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)     00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)     00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)     00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b5)     00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b5)     0    0:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b5)     00:1c.5 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 6 (rev b5)     00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)     00:1f.0 ISA bridge: Intel Corporation HM67 Express Chipset Family LPC Controller (rev 05)     00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 05)     00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)     01:00.0 VGA compatible controller: nVidia Corporation Device 0df5 (rev a1)     03:00.0 Network controller: Intel Corporation Centrino Wireless-N 1000     04:00.0 USB Controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04)     06:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)      So what to do? Is the GeForce card always running here (Linux) while on Windows it's on the Intel GPU?   If so, can I make it so it will only always on the Intel card? Can this help? Will I lose graphics acceleration (and gnome-shell) in this case? Edit: I had uninstalled Nouveau Nvidia driver in hopes that it would turn the Nvidia card off to see if I had a better luck. I don't know if this is related but just now my notebook was idle, I was watching a movie, and then came back to my laptop to check on it on imdb. I had a terminal open and 2 or 3 tabs of chrome, on gnome-shell, and when I ran `sensor` CPU was at 98.0°C, and GPU at 92.0°C... Edit: @Icarus I'd guess it's the second option, before when it was slowing down I was running top and the 'offending' processes were Chrome and Gnome- shell, but really it was probably the CPU/GPU getting too hot and lagging, it doesn't make much sense because this is a potent notebook, I play Battlefield 3 on 64 person maps without any problems Edit-part-two: I've switched the Nouveau driver to the proprietary Nvidia one, Ive lost graphic acceleration(this has always happened when using Nvidia driver on this notebook) but 'sensors' now is constant on 74.0°C and I can at least feel confortable enough to work here... I'm intrigued because there's got to be more people on this new Dell XPS running linux, but it's being way hard to find any useful info on this...


title: What Linux distro is good for music and well supported?

text: I'm pretty disappointed with Ubuntu. It's never been easy to sort out the mess that is Alsa / Jack / whatever and have it work with Pd, Supercollider, Ardour, Lillypad. I've upgraded to the latest and a) it immediately broke some audio software I was writing in openFrameworks (just stopped compiling, complaining about rtaudio), b) there seems to be no real-time kernel any more, and c) the audio I did get working is noisy. Does anyone out there make and support a good Linux distro that "just works" (ie. sets up whatever needs to be set up in terms of Alsa / Jack / etc.) that ensures that my (in principle) fast computer can actually generate clean sound? If not, what's the impediment? Is there some reason that audio can't be brought under control the way that different GUIs were in the past?


title: How to Install Oracle Java7 in Ubuntu13.04

text: I am trying to install Java 7 in Ubuntu 13.04 using this tutorial. > ## Preparing your system > > First you need to remove openjdk for this run the following command from > your terminal   >  `sudo apt-get purge openjdk*` > > If you installed java 7 from any other PPA and you are having problem with > java then you have to do following steps before installing the PPA > menctioned here   >  ` sudo rm /var/lib/dpkg/info/oracle-java7-installer* sudo apt-get purge > oracle-java7-installer* sudo rm /etc/apt/sources.list.d/*java* sudo apt-get > update` > > ## Install Oracle Java 7 in Ubuntu 13.04/12.10/12.04 > > Open the terminal and run the following commands > > ` sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt- > get install oracle-java7-installer` All goes well until I reach the point:               sudo apt-get install oracle-java7-installer      Then I just get the error message               E: Unable to locate package oracle-java7-installer      What is the problem that is causing this?


title: Checking video card load via command line

text: Is there a command like `cpustat` or `iostat` or `memstat`, but for the video card? Or some indication in `/proc` or `/sys`?


title: match just one row in two files and return the whole column from file 2

text: If I have two files file1:               Reference Position     905894     1197693     3703749     92108275     114940633     114940633      file2:               Mapping  Reference Position Type    Length  Reference   Allele  Linkage Zygosity    Count     1 mapping   877831  SNV 1   T   C       Homozygous  48     1 mapping   883625  SNV 1   A   G       Homozygous  23     1 mapping   905894  SNV 1   C   T       Heterozygous    41     1 mapping   909768  SNV 1   A   G       Homozygous  85     1 mapping   1153944 SNV 1   T   G       Heterozygous    65     1 mapping   1197693 SNV 1   G   A       Heterozygous    23     1 mapping   1276973 SNV 1   G   C       Heterozygous    4     1 mapping   1276974 Insertion   4   -   ACAC        Heterozygous    52     1 mapping   1277533 SNV 1   T   C       Homozygous  73      I want the reference positions in both files to match and return the whole column in file 2 that matches with file 1.


title: Move and resize partitions proportionally

text: I have a clonezilla image from a disk with GPT, and I want to clone to a larger disk and then resize the partitions proportionally. By example if I have a 100 Gb disk and two partitions of 40 an 60 Gb, I want to make a clone to another disk of 200 Gb with the result of a 80 and a 120 Gb partitions. With clonezilla the only way that you can do this is with the -k1 option but only works with MBR disks, is there any other posibility to do this? Maybe the only option is to do a script to:   * View partitions and its porcentages (parted -l?)   * Calculate the new space   * Move the partitions (parted move?)   * Resize the partitions (parted resize?)   * Rebuild the filesystem (e2fsck -f && resize2fs /dev/sdaX)


title: Segmentation faults during compilation - where to begin?

text: I have a particular problem I need solved right now, but I'd really like to know a good strategy for approaching this type of problem - segmentation faults when compiling other people's code, so I'm happy for either particular or general type answers. ### The particulars I'm trying to install OpenSSL 1.0.1g on a Synology DS412+. The version of GCC I've got (v4.2.1) doesn't have 64bit compiled in, which OpenSSL complains about:               $ ./config --prefix=/opt         \                --openssldir=/etc/ssl \                --libdir=lib          \                shared                \                zlib-dynamic     $ make      snip!               cryptlib.c:1: sorry, unimplemented: 64-bit mode not compiled in     cryptlib.c: In function 'OPENSSL_ia32cap_loc':     cryptlib.c:677: warning: dereferencing type-punned pointer will break strict-ali     asing rules     make[1]: *** [cryptlib.o] Error 1      _So_ , I'm trying to install GCC 4.8.2 (I've tried several versions now) and each time it appears to fail in the GMP portion of the `make`. It's happened so much I decided to download GMP and try compiling that:               $ ./configure --prefix=/opt --build=i386-pc-linux-gnu     $ make          ./gen-fac 32 0 >fac_table.h || (rm -f fac_table.h; exit 1)     /opt/bin/bash: line 1: 20507 Segmentation fault      (core dumped) ./gen-fac 32     0 > fac_table.h     make: *** [fac_table.h] Error 1      I'm not a C programmer, and this isn't even my code so the likelihood of me whipping out Valgrind to inspect the core is low. I've had this happen plenty of times compiling libraries, and learning C isn't something that's on my priority list. Are there alternatives to...?   * learning C   * asking on a forum/mailing list The only package manager I have got access to is ipkg, and it provided the GCC that's not up to full muster. Could I set up a VM, build a binary for ipkg and put it on the DS412? Having not done something like that before, I don't know how feasible it is. Any help or insight is much appreciated.


title: How do I configure syslinux to boot immediately

text: I'm tweaking a Debian live system (built with live-build), and I want it to boot straight into the system from syslinux — no menu, no timeout. According to the syslinux documentation, a timeout value of 0 means that the timeout is disabled, ie. it won't boot at all without user intervention, which is the opposite of what I want. It might be nice to be able to hold down a key for those rare occasions where I **do** need to tweak the kernel line, but that's not essential. Really I just want an immediate boot. How do I get it? The current syslinux configuration is this: **syslinux.cfg** :               include menu.cfg     default vesamenu.c32     prompt 0     timeout 0      **menu.cfg** :               menu hshift 0     menu width 82          menu title Boot menu     include stdmenu.cfg     include live.cfg     include install.cfg     menu end      **stdmenu.cfg** :               menu background splash.png     menu color title    * #FFFFFFFF *     menu color border   * #00000000 #00000000 none     menu color sel      * #ffffffff #76a1d0ff *     menu color hotsel   1;7;37;40 #ffffffff #76a1d0ff *     menu color tabmsg   * #ffffffff #00000000 *     menu color help     37;40 #ffdddd00 #00000000 none     menu vshift 17     menu rows 10     menu helpmsgrow 15     # The command line must be at least one line from the bottom.     menu cmdlinerow 16     menu timeoutrow 16     menu tabmsgrow 18     menu tabmsg Press ENTER to boot or TAB to edit a menu entry      **live.cfg** :               label live-         menu label ^Live ()         menu default         kernel /live/vmlinuz         append initrd=/live/initrd.img boot=live config quiet ipv6.disable=1 console=tty0 console=ttyS0,115200n8      **install.cfg** : empty


title: Make a USB drive bootable for Windows 7 setup

text: What is the equivalent of `bootsect` command available in Windows, on a *nix system? **Usage:** In order to make a USB drive bootable for Windows 7 setup I have to boot-up VMWare and run `bootsect.exe /nt60 e: /force` (`e:` being the USB drive). So was wondering if I could perform that particular operation natively.


title: Not able to install internet explorer!

text: I followed this link for installing Internet explorer. A GUI opens when I run the following command:               ravbholua@ravbholua-Aspire-5315:~/ies4linux-2.99.0.1$ pwd     /home/ravbholua/ies4linux-2.99.0.1     ravbholua@ravbholua-Aspire-5315:~/ies4linux-2.99.0.1$ ./ies4linux     IEs4Linux 2 is developed to be used with recent Wine versions (0.9.x). It seems that you are using an old version. It's recommended that you update your wine to the latest version (Go to: winehq.com).      Please note the message after running the above command. But I don't think mine is old version as mentioned above. Please see below to know my version:               ravbholua@ravbholua-Aspire-5315:~/ies4linux-2.99.0.1$ wine --version     wine-1.7.4      Mine is latest version. Now in the GUI, I select IE6 to install. But it fails to install and I get the below error:               An error ocurred when downloading. Please run IEs4Linux again. Corrupted file: ie6/EN-US/VGX.CAB      Please say how to then install IE?


title: what is the zsh equivalent of bash's export -f

text: So I started using `zsh`. I like it all right. It seems very cool and slick, and the fact that the current working directory and actual command line are on different lines is nice, but at the same time, I'm noticing that `zsh` can be a bit slower than `bash`, especially when printing text to the screen. The thing I liked best was the fact that `zsh` was 'backward compatible' with all of the functions I defined in my `.bashrc`. One gripe though. The functions all work perfectly, but I can't figure out how the exporting system works. I had some of those `.bashrc` functions exported so that I could use them elsewhere, such as in scripts and external programs, with `export -f`. In zsh, exporting doesn't seem to even be talked about. Is it autoloading? Are those two things the same? I'm having a seriously hard time figuring that out.


title: Is there a tool to view and edit ,iso files like PowerISO?

text: I am looking for a archive manager that will allow me to look into the contents without needing to mount it and also to add or remove contents by drag and drop style. The Windows' equivalent would be PowerISO, MagicISO or even 7-zip. Many people suggested mounting and then copying into another directory, add/remove files, and make image again. Is that the only way?


title: Is there any solution Like SharePoint in Linux?

text: We have three server SharePoint , Project Server and CRM and we want to change them and migrate to Linux solutions. Now we have to change SharePoint by Linux solution ? we want to have a solution for **collaboration management** and **document management**


title: how to use grep for specific files?

text: for example I type               ls -altr | grep "23 Dec"      so it will show files for 23 Dec only and I want to use grep for them, like               ls -altr | grep "23 Dec" | xargs grep -l "some_string"      but this doesn't work) How to do that?


title: Access the Shift-Insert clipboard from script

text: How do I access the Shift-Insert (paste) clipboard from a script? You can see what I use here. **Edit** : A demonstration how it works, with `xclip`:               echo hello | xclip -selection secondary     xclip -o -selection secondary      **Edit 2** : Just implemented the solution below. This will make my life so much easier so I thought I'd share it. First, the script `pst`:               #!/bin/zsh          echo -n `xclip -d ":0" -o -selection clipboard`      then, in `.emacs`:               (defun pst ()      "Inserts the X clipboard (xclip -d :0 -o -selection clipboard) at     point. `M-1' (the '(1)) to insert in the current buffer."       (interactive)       (shell-command "pst" '(1))       (end-of-line) )      Now, in any tty, paste with `pst`, in Emacs (anywhere, but specifically in a tty, as in X, you already have Shift-Insert) `M-x pst`.


title: Setting up a minimal apt-get environment

text: I would like to set up a minimal environment with `apt-get` then selectively install packages one at a time. My understanding is that this is basically what the Debian installer does. Is this understanding accurate? If so, is it possible to have the installer (or some other program the installer uses) install only the bare minimum necessary to run apt-get? If not, how difficult would it be to build such an environment? Some notes:   * Some software I presume I will end up installing include:      * a standard file system with commonly required directories (e.g. `/dev`, `/bin` etc.)     * a boot-loader (e.g. Grub2)     * shell and minimum utilities to get around including init (e.g. coreutils or busybox, udev, and other utils that I imagine might be hard to get, or necessary for using apt-get)     * dpkg and other tools closely related to apt-get   * In particular, I don't necessarily need:      * network drivers (If necessary, I am hoping I can use a USB drive to move .deb packages and the necessary drivers around)     * logging daemons (I am hoping I can install these through apt-get)     * In general, anything that isn't required for running apt-get (or running the system), and can be easily installed through apt-get.   * In a previous adventure, I have had some success with creating a bootable environment running with busybox (with a lot of great help from unix.SE). However, due to my computer incompetency, it ended up with many rough edges (e.g. Grub wasn't installed properly so I have to enter grub prompt to boot properly; I never got a proper build environment installed; all installed programs are static; etc.).   * This time, I am hoping to obtain something that can easily evolve into something similar to a typical Debian, Ubuntu, or other full blown apt-get based distro through repository settings and a sequence of apt-get commands. As wimpy as it sounds, I would prefer to have as much automated, or prepackaged as possible (i.e. not LFS if it can be helped), as I would like to focus on roughly which packages are installed, rather than on how they are installed.


title: Any other distro offer like Ubuntu Software Centre?

text: I want to know does any other linux disto offer anything close to Ubuntu Software Centre? Some of the features I like about it is A) Sandboxing B) Ability to search any of the libs/apps with screenshot(if any) and description. [ Been a while since using Ubuntu - I remember _this_ description form when I was launched. And please DO NOT recommend Ubuntu :) ] I am ok with using yum and apt-get. But for graphical package kit I am not that impressed with what Fedora/Opensuse have in PackageKit. Half of the time it updates and when you search for anything you hardly find them. Finally have to resort to yum. So has any other linux distro got it better than Fedora and Opensuse?


title: Fast and Small C++ https proxy

text: I'm looking for a small, fast, and reliable https proxy that I can extend to do the following:   1. Look for https handshake requests.   2. Run a regular expression against the host name being requested.   3. If the expression matches the host name then don't send the request on but respond with a 302 redirect to a different site. So, I guess I have the following questions about this:   1. Is this possible? (I'm pretty sure the handshake request is not encrypted, I know I can do some pattern matching, the real question is...would I be able to send a fake 302 redirect to the client without it complaining about not having completed the handshake?)   2. If it is possible, is there a linux app out there that does some or all of this? (I found this: http://www.kubat.nl/pages/microproxy) I was considering trying to build the remaining features into it but didn't want to try that if something else already does it.   3. Do you have suggestions for other C++ Linux proxies I might be able to build this into? Thanks in advance for your feedback. EV


title: Get process list with logical intersection of selectors?

text: The Linux `ps` command allows multiple selectors, such as user and command name, but always returns the logical OR of those selectors (more than I want). Does anyone know of a method or tool already made that can get the intersection (AND) of process selectors?


title: Which Linux distro supports GNOME 3 by default?

text: I was planning on installing a new Linux distribution and I am thinking of trying GNOME 3 interface. Other than Fedora 16 (which has GNOME 3 as default) which other distro supports it? I know it can be installed from the repository, but I tried the GNOME 3 on OpenSuse and had hard time running it; it never really integrated fully. So would be good to know what distro supports GNOME 3 seamlessly. Any other distro than Fedora and Mint linux? (Not so keen on Mint so looking for others)


title: download only first few bytes of a source page

text: I am downloading the HTML source page of a website using `cURL` command. The problem is, I do not want most of the contents in the page. I just need the first 100 lines of the source page. Is there a way to stop the download of the page after first few lines? Currently, I have the below command working but it does not seem to be time effective.               curl -r[0-1] "http://www.freebase.com/m/045c7b" > foo.txt      I tried changing the value from `1` to `.5` and `.05` and still the entire web page is getting downloaded. I am looking at time less than a second to execute the above command. **EDIT** From the man page of `cURL`, I see that " _You should also be aware that many HTTP/1.1 servers do not have this feature enabled, so that when you attempt to get a range, you'll instead get the whole document._ " So if the server is not supporting the range querying, is there some other command in `nix` environment which will help me accomplishing what am trying to do?


title: Debugging bash functions

text: So here I have a simple function that I wish to debug. However, I am unable to debug the desired function even with `set -o functrace` enabled. Before resorting to asking this question, I had managed to find a possible solution that did not produce the desired results, which is located here. How can I get bash debug my functions?               #!/bin/bash     echo "Hello World"     hello() {         echo "Hello world"     }      output:               user@mac11:53:29~/desktop bash -x debug.sh      + echo 'Hello World'     Hello World     user@mac11:54:55~/desktop


title: Lost ls directory highlighting after a crash

text: Normally commands such as `ls` and `grep` offer nice syntax highlighting for me. But my system crashed (running an ubuntu VM) and after I restarted, I no longer have this highlighting, it's all a dreary grey. Nano, however, notably does do it's normal highlighting. I don't know where to start looking for why I don't have directory highlighting any more, or why grep doesn't highlight matched lines any more.


title: /opt/nvidia-smi from nvidia-drivers pack outputs "failed to load nvidia kernel module"

text: Actually I have nouveau string in make.conf. "Nvidia-smi has failed because it couldn't communicate with NVIDIA driver. Make sure that latest NVIDIA driver is installed and running."


title: How to mount a disk from destroyed raid system?

text: I have a horrible situation where I have to restore data from damaged raid system in a rescue Debian Linux. I just want to mount them all to /mnt/rescue in read only modus to be able to copy VMWare GSX images to another machine and migrate them to ESXi later on. The output for relevant commands is as follows.               fdisk -l          Disk /dev/sda: 1500.3 GB, 1500301910016 bytes     255 heads, 63 sectors/track, 182401 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x0005e687             Device Boot      Start         End      Blocks   Id  System     /dev/sda1               1         523     4200997   fd  Linux raid autodetect     /dev/sda2             524         785     2104515   fd  Linux raid autodetect     /dev/sda3             786      182401  1458830520   fd  Linux raid autodetect          Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes     255 heads, 63 sectors/track, 182401 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00014fc7             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1               1         523     4200997   fd  Linux raid autodetect     /dev/sdb2             524         785     2104515   fd  Linux raid autodetect     /dev/sdb3             786      182401  1458830520   fd  Linux raid autodetect          Disk /dev/md0: 4301 MB, 4301717504 bytes     2 heads, 4 sectors/track, 1050224 cylinders     Units = cylinders of 8 * 512 = 4096 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000          Disk /dev/md0 doesn't contain a valid partition table          Disk /dev/md1: 2154 MB, 2154954752 bytes     2 heads, 4 sectors/track, 526112 cylinders     Units = cylinders of 8 * 512 = 4096 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000          Disk /dev/md1 doesn't contain a valid partition table      I was trying to mount the disks as follows.               mount -o ro /dev/sda1 /mnt/rescue      Then I get following error.               mount: unknown filesystem type 'linux_raid_member'      Guessing file system is not going well either.               mount -o ro -t ext3 /dev/sda1 /mnt/rescue/     mount: /dev/sda1 already mounted or /mnt/rescue/ busy      So I tried to create a virtual device as follows.               mdadm -A -R /dev/md9 /dev/sda1      This results in the following message.               mdadm: cannot open device /dev/sda1: Device or resource busy     mdadm: /dev/sda1 has no superblock - assembly aborted      Now I am lost, I have no idea how to recover the disks and get the data back. The following is the output of mda --examine for all 3 disks (I think it should be 3x raid1 disks). /dev/sda1:                         Magic : a92b4efc             Version : 0.90.00                UUID : 6708215c:6bfe075b:776c2c25:004bd7b2 (local to host rescue)       Creation Time : Mon Aug 31 17:18:11 2009          Raid Level : raid1       Used Dev Size : 4200896 (4.01 GiB 4.30 GB)          Array Size : 4200896 (4.01 GiB 4.30 GB)        Raid Devices : 3       Total Devices : 2     Preferred Minor : 0              Update Time : Sun Jun  2 00:58:05 2013               State : clean      Active Devices : 2     Working Devices : 2      Failed Devices : 0       Spare Devices : 0            Checksum : 9070963e - correct              Events : 19720                     Number   Major   Minor   RaidDevice State     this     1       8        1        1      active sync   /dev/sda1             0     0       0        0        0      removed        1     1       8        1        1      active sync   /dev/sda1        2     2       8       17        2      active sync   /dev/sdb1      /dev/sda2:                         Magic : a92b4efc             Version : 0.90.00                UUID : e8f7960f:6bbea0c7:776c2c25:004bd7b2 (local to host rescue)       Creation Time : Mon Aug 31 17:18:11 2009          Raid Level : raid1       Used Dev Size : 2104448 (2.01 GiB 2.15 GB)          Array Size : 2104448 (2.01 GiB 2.15 GB)        Raid Devices : 3       Total Devices : 2     Preferred Minor : 1              Update Time : Sat Jun  8 07:14:24 2013               State : clean      Active Devices : 2     Working Devices : 2      Failed Devices : 0       Spare Devices : 0            Checksum : 120869e1 - correct              Events : 3534                     Number   Major   Minor   RaidDevice State     this     1       8        2        1      active sync   /dev/sda2             0     0       0        0        0      removed        1     1       8        2        1      active sync   /dev/sda2        2     2       8       18        2      active sync   /dev/sdb2      /dev/sda3:                         Magic : a92b4efc             Version : 0.90.00                UUID : 4f2b3b67:c3837044:776c2c25:004bd7b2 (local to host rescue)       Creation Time : Mon Aug 31 17:18:11 2009          Raid Level : raid5       Used Dev Size : 1458830400 (1391.25 GiB 1493.84 GB)          Array Size : 2917660800 (2782.50 GiB 2987.68 GB)        Raid Devices : 3       Total Devices : 2     Preferred Minor : 2              Update Time : Sat Jun  8 14:47:00 2013               State : clean      Active Devices : 1     Working Devices : 1      Failed Devices : 1       Spare Devices : 0            Checksum : 2b2b2dad - correct              Events : 36343894                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this     1       8        3        1      active sync   /dev/sda3             0     0       0        0        0      removed        1     1       8        3        1      active sync   /dev/sda3        2     2       0        0        2      faulty removed          cat /proc/mdstat     Personalities : [raid1]     md2 : inactive sda3[1](S) sdb3[2](S)           2917660800 blocks          md1 : active raid1 sda2[1] sdb2[2]           2104448 blocks [3/2] [_UU]          md0 : active raid1 sda1[1] sdb1[2]           4200896 blocks [3/2] [_UU]      md2 seems to be damaged and it is probably the raid with my VMWare images. I would like to access the data from md2 (the data on the active and not damaged disk, that is /dev/sda3) by mounting it outside of the raid. Is it a good idea to just execute               mdadm --manage /dev/md2 --remove /dev/sda3       (would it even work as md2 is not seen by fdisk)? Should I re-assamble the other raids md0 and md1 by running               mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb1      ? UPDATE 0: I am not able to assemble md0 and md2.               root@rescue ~ # mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb1     mdadm: cannot open device /dev/sda1: Device or resource busy     mdadm: /dev/sda1 has no superblock - assembly aborted     root@rescue ~ # mdadm --assemble /dev/md2 /dev/sda3 /dev/sdb3     mdadm: cannot open device /dev/sda3: Device or resource busy     mdadm: /dev/sda3 has no superblock - assembly aborted      Mounting with mount -t auto is not possible.               root@rescue ~ # mount -t auto -o ro /dev/md0 /mnt/rescue/     /dev/md0 looks like swapspace - not mounted     mount: you must specify the filesystem type     root@rescue ~ # mount -t auto -o ro /dev/md2 /mnt/rescue/     mount: you must specify the filesystem type      Mounting /dev/md1 works but no VMWare data on it.               root@rescue /mnt/rescue # ll     total 139M     -rw-r--r-- 1 root root 513K May 27  2010 abi-2.6.28-19-server     -rw-r--r-- 1 root root 631K Sep 16  2010 abi-2.6.32-24-server     -rw-r--r-- 1 root root 632K Oct 16  2010 abi-2.6.32-25-server     -rw-r--r-- 1 root root 632K Nov 24  2010 abi-2.6.32-26-server     -rw-r--r-- 1 root root 632K Dec  2  2010 abi-2.6.32-27-server     -rw-r--r-- 1 root root 632K Jan 11  2011 abi-2.6.32-28-server     -rw-r--r-- 1 root root 632K Feb 11  2011 abi-2.6.32-29-server     -rw-r--r-- 1 root root 632K Mar  2  2011 abi-2.6.32-30-server     -rw-r--r-- 1 root root 632K Jul 30  2011 abi-2.6.32-33-server     lrwxrwxrwx 1 root root    1 Aug 31  2009 boot -> .     -rw-r--r-- 1 root root 302K Aug  4  2010 coffee.bmp     -rw-r--r-- 1 root root  89K May 27  2010 config-2.6.28-19-server     ...      UPDATE 1: I tried to stop md2 and md0 and assemble once again.               mdadm -S /dev/md0          root@rescue ~ # mount -t auto -o ro /dev/md0 /mnt/rescue/     /dev/md0 looks like swapspace - not mounted     mount: you must specify the filesystem type          mdadm -S /dev/md2          root@rescue ~ # mount -t auto -o ro /dev/md2 /mnt/rescue/     mount: you must specify the filesystem type      Any ideas? UPDATE 2: Assembling from one disk is not working due to following error message.               root@rescue ~ # mdadm -S /dev/md2     root@rescue ~ # mdadm --assemble /dev/md2 /dev/sda3     mdadm: /dev/md2 assembled from 1 drive - not enough to start the array.          root@rescue ~ # mdadm -S /dev/md2     mdadm: stopped /dev/md2     root@rescue ~ # mdadm --assemble /dev/md2 /dev/sdb3     mdadm: /dev/md2 assembled from 1 drive - not enough to start the array.      Even new raid fails.               root@rescue ~ # mdadm -S /dev/md9     mdadm: stopped /dev/md9     root@rescue ~ # mdadm --assemble /dev/md9 /dev/sda3     mdadm: /dev/md9 assembled from 1 drive - not enough to start the array.          root@rescue ~ # mdadm -S /dev/md9     mdadm: stopped /dev/md9     root@rescue ~ # mdadm --assemble /dev/md9 /dev/sdb3     mdadm: /dev/md9 assembled from 1 drive - not enough to start the array.      Creating new md disk fails too.               root@rescue ~ # cat /proc/mdstat     Personalities : [raid1]     md0 : active raid1 sda1[1] sdb1[2]           4200896 blocks [3/2] [_UU]          md1 : active raid1 sda2[1] sdb2[2]           2104448 blocks [3/2] [_UU]          unused devices: <none>     root@rescue ~ # mdadm -A -R /dev/md9 /dev/sda3     mdadm: failed to RUN_ARRAY /dev/md9: Input/output error     mdadm: Not enough devices to start the array.     root@rescue ~ # cat /proc/mdstat     Personalities : [raid1] [raid6] [raid5] [raid4]     md9 : inactive sda3[1]           1458830400 blocks          md0 : active raid1 sda1[1] sdb1[2]           4200896 blocks [3/2] [_UU]          md1 : active raid1 sda2[1] sdb2[2]           2104448 blocks [3/2] [_UU]          unused devices: <none>     root@rescue ~ # mdadm -S /dev/md9     mdadm: stopped /dev/md9     root@rescue ~ # mdadm -A -R /dev/md9 /dev/sdb3     mdadm: failed to RUN_ARRAY /dev/md9: Input/output error     mdadm: Not enough devices to start the array.      UPDATE 3: Removing disks from md2 is not working.               mdadm --remove /dev/md2 /dev/sda3     mdadm: cannot get array info for /dev/md2      UPDATE 4: Finally, running assemble with `\--force` hopefully did it. I am now copying files to another server.


title: scribus , in design and alternative application

text: We want to publish a electronic magazine according to `freesoftware applications` such as `gimp`, `inkscape`, `GNU\Linux` and so on.We need a magazine or book design application such as `In Design` of windows world, we found `scribus`, But `scribus` doesn't support `RTL` and our language has `RTL direction`. Do you have any suggesstion?


title: Easiest way to manage users for two machines

text: I'm administrating two ubuntu desktops and one debian server. There are abount ~20 active users on the desktops. A few (5-10) user accounts are added each year and about the same amount become inactive. I would like to share the user accounts and their respective homes between the two pcs. So far, my plan was to set up some kind of nfs + kerberos (+ldap/nis?), but I think kerberos is overly complicated for this simple purpose. In addition to that, the admin changes every ~2-3 years and I fear that complicated solutions will become unmaintainable for my successors (we are no professionals...). Is there a way to split up /etc/passwd etc. in different files, so I could store these on the server and copy them to the desktops? Or is there some PAM- module that provides a similar type of "modular" authentication ? (well, except pam_krb5). What would be the simplest way to achieve that?


title: Will formatting my drive TRIM my SSD?

text: Will a standard fresh linux (Ubuntu 11.10 to be exact) install and drive re- format (full) successfully TRIM my SSD, or do I need to do something extra? I know that ext4 will TRIM blocks on erase when I specify the `discard` option, but I want to start with a completely TRIMmed drive if possible.


title: Running a program automatically?

text: There is a Linux program I like which is Conky, when I run `conky -c mycustomconf.txt` it runs fine. I want this program to run automatically when I start my computer, without having to type in the command again to start it. How can I do this? I am using Ubuntu with Xfce4.


title: PXE boot with NFS: /sbin/init: No such file or directory

text: I'm trying to set up PXE boot with an ubuntu client.   * Created the dhcp-boot on my tomato router   * Added a tftp daemon on my FreeNas box   * Added a NFS mount on my FreeNas box   * Debootstrapped Ubuntu 11.10 to the NFS mount   * I've generated the vmlinuz and initrd from the debootstrap image and copied them to the tftp root.   * Created a pxelinux.cfg/default file in the tftp root pxelinux.cfg/default contains:               DEFAULT ubuntu-11.10          LABEL ubuntu-11.10     KERNEL vmlinuz-3.0.0-16-generic     APPEND root=/dev/nfs initrd=initrd.img-3.0.0-16-generic netboot=nfs nfsroot=192.168.1.160:/mnt/media/thinclient/base,nolock,ro ip=dhcp init=/linuxrc     ipappend 2      While booting my node/client it loads the vmlinux and initrd but "panics" while trying to load /sbin/init: ![Kernel panic](http://i.stack.imgur.com/XR9qS.jpg) I looked with tcpdump if the process is accessing my nfs server and I see data passing. Also, if I remove /proc or /dev from the image on my nfs server the node complains that it's missing the /dev and/or /proc directory. I've also tried passing init=/bin/bash but that threw the same kind of error. Why is my node throwing the `run-init: /sbin/init: no such file or directory` error?


title: Securely Deleting A File In Ram

text: I'm running a live distro in ram. I need to write a password to a file. Later, I need to delete it securely. I don't know how live file systems work, so I'm unsure if I open the file for writing, then write over it with data the length of the password, if it actually will write over that exact memory location or not. The goal is to securely delete the file by writing over it. I don't know if journaling happens in Live Linux distos. If so, is it possible to create a virtual file system in ram? I could then just write the password there and dd will securely write from beginnig to end of the volume. What are my options?


title: Excluding some of the commands from being getting stored in bash history

text: Is there any way to exclude commands like `rm -rf`, `svn revert` from being getting stored in bash history? Actually I, by mistake, have issued them a number of times even though I have no intent to do, just because I am doing things quickly and it happened. Hence results in lost of lots of work I have did so far.


title: Ubuntu install spanning multiple disks

text: Having to reinstall the operative system from scratch on an EeePC 901, which has two SSD disks, 4GB and 16GB, is it possible to install it using both disks as if they were one?


title: Lock on IBM DB2 database on Linux server

text: My db2 database is running on Linux server, Some time database table got lock by some of db user due to uncommiting the session. My question is that how we can find out through which machine/dbuser/ip database table got lock. if anyone have any idea abt same please help me


title: Is there an analog of apt-pinning in Fedora?

text: Apt pinning is a feature that allows to set install priority for a group of packages, determined by a number of attributes, such as package version, repository, distro version, etc. See man apt_preferences for more (http://linux.die.net/man/5/apt_preferences) Quote: > APT then applies the following rules, listed in order of precedence, to > determine which version of a package to install. > >   * Never downgrade unless the priority of an available version exceeds > 1000. ("Downgrading" is installing a less recent version of a package in > place of a more recent version. Note that none of APT's default priorities > exceeds 1000; such high priorities can only be set in the preferences file. > Note also that downgrading a package can be risky.) >   * Install the highest priority version. >   * If two or more versions have the same priority, install the most recent > one (that is, the one with the higher version number). >   * If two or more versions have the same priority and version number but > either the packages differ in some of their metadata or the --reinstall > option is given, install the uninstalled one. > Is there anything like that for Fedora? In other rpm-based distros?


title: Why do we need so many terminal emulator packages and what is their use?

text: This is something that has been so confusing to me for a long time.   I am using Linux but I have gaps in my understanding of certain aspects and one is about the terminal.   As I came to understand it what we mean with the console is an emulator of old terminals.   But I can not understand what is the deal with this.   As I read the best old terminals were the VT series and the vector graphics type (Tektronix).   So I assume that the current emulators emulate these.   Now my needs in Linux concerning display presentation has reached as far as using a colorscheme for vim and appreciating colors when doing diff in files.   But when I have issues I usually find advice to set `xterm-256` or `screen-256` etc.   Additionally when I do: `ls /lib/terminfo/` I see about a dozen of directories with configuration for (I assume) different kind of emulator types. So my question is, how does these `xterm-256` or `screen-256` and the rest fit in the idea of emulating just the top terminals in the past decades?   What is the need to have so many terminal types? Is it something I should look into more?   And why today with the modern technology need to emulate these old terminals like VT and not have something new? Perhaps my needs are too simple too appreciate the subtleties of this but it is has been something that puzzled me a lot. Since for instance if I have an issue with a colorscheme I just copy paste what I find in google about TERM etc without really understanding what am I doing or what is the problem. If someone helps me undertand this it would be really appreciated


title: How can I use my own snippets by using yasnippet in Emacs?

text: I installed yasnippet and it works fine with default snippets.But I can't add my own snippets. To expand a string `php` to `<?php ?>`, I've done like this. I wrote in my init file like this.               (require 'yasnippet)     (setq yas-snippet-dirs           '("~/.emacs.d/snippets"             "~/.emacs.d/site-lisp/yasnippet/snippets"             ))     (yas-global-mode 1)      I created `~/.emacs.d/snippets/web-mode/php.yasnippet` and wrote               # -*- mode: snippet -*-     # name: php tag     # --     <?php $1 ?>      and call function `yas-reload-all`. But I can't expand the string `php` in the web-mode. What am I doing wrong? What should I do something else?


title: How to send a file using xmodem protocol from the command line

text: Want to shell script this and my scripting skills are rather limited so please bear with me. Have scope attached to RX and TX lines of the serial port. If I do:               cat /dev/ttyS0      Get a steady stream of 'C' characters so the remote side is up and sending. If I do:               cat {filename} > /dev/ttyS0      I get a burst on TX line w/o any protocol. If I do the following:               /usr/bin/sx -vv -k -X -b -c send {filename}      TX line remains inactive. File is binary and expecting xmodem 1K protocol. What am I doing wrong? Nevermind. Apparently the magic is:               hello.uart1_divisor_change.xmodem.hex.no_pll0 > /dev/ttyS0 < /dev/ttyS0


title: Can't get kdelibs 4.10.0

text: I am compiling KDE Artikulate and it demanded a newer version of kdelibs. I downloaded kdelibs source and spent a night installing it. And again it is saying that it needs at least kdelibs 4.10.0 Error it shows is:               CMake Error at /usr/share/kde4/apps/cmake/modules/FindKDE4Internal.cmake:1390     (message):         ERROR: the installed kdelibs version 4.9.5 is too old, at least version         4.10.0 is required


title: mv failed halfway through - is source directory intact

text: I ran `mv a-folder /home/me` on a machine and half way through the move the destination device filled up. `a-folder` was made up of folders and files in various subdirectories. Does `mv` leave the source folder intact until the move has successfully completed? **The source and destination folders were on different filesystems.** The reason I ask is that I ran this command on the wrong machine, so if the source folder is intact then that makes my life a lot easier :)


title: Fedora 20: Anyway to install the default tools which comes with Fedora-Gnome on Cinnamon?

text: I just did a fresh install of Fedora 20 and chose Cinnamon as my desktop. To my surprise, Gnome was not install at all.. and thus I feel am I missing a bunch of "stuff" that's normally included in a default Fedora install (w. Gnome). Is there any way I can "fill the gaps" without actually installing the Gnome desktop itself? If so, how? If not, will installing the Gnome desktop itself give me what I am looking for; ie. all the stuff (apps, programs, options, etc) you would get in a default Fedora install? If so, then what's the best way to install the Gnome desktop in my situation?


title: iptables-restore just says “FAILED”

text: I am not sure what's wrong with my rule in the Iptables. I am actually trying to build a SSH server and following a cyberciti tutorial. My Iptables configuration looks like this:               # Firewall configuration written by system-config-firewall     # Manual customization of this file is not recommended.     *filter     :INPUT ACCEPT [0:0]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [0:0]     -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT     -A INPUT -p icmp -j ACCEPT     -A INPUT -i lo -j ACCEPT     -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT     -A INPUT -j REJECT --reject-with icmp-host-prohibited     -A FORWARD -j REJECT --reject-with icmp-host-prohibited     COMMIT     -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT      When I restart of iptables, this is the transcript:               [root@localhost raja]# service iptables restart     iptables: Setting chains to policy ACCEPT: filter          [  OK  ]     iptables: Flushing firewall rules:                         [  OK  ]     iptables: Unloading modules:                               [  OK  ]     iptables: Applying firewall rules: iptables-restore: line 14 failed                                                                [FAILED]     [root@localhost raja]#      I tried placing COMMIT at the end, but it didn't help:               [root@localhost raja]# cat /etc/sysconfig/iptables     # Firewall configuration written by system-config-firewall     # Manual customization of this file is not recommended.     *filter     :INPUT ACCEPT [0:0]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [0:0]     -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT     -A INPUT -p icmp -j ACCEPT     -A INPUT -i lo -j ACCEPT     -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT     -A INPUT -j REJECT --reject-with icmp-host-prohibited     -A FORWARD -j REJECT --reject-with icmp-host-prohibited     -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT     COMMIT     [root@localhost raja]# service iptables restart     iptables: Setting chains to policy ACCEPT: filter          [  OK  ]     iptables: Flushing firewall rules:                         [  OK  ]     iptables: Unloading modules:                               [  OK  ]     iptables: Applying firewall rules: iptables-restore: line 13 failed                                                                [FAILED]     [root@localhost raja]#      What's wrong? I am using CentOS 32-bit.


title: stdin/stdout names in BASH?

text: I have a program that takes a `-o log_file` option, which writes extra data to `log_file`. Is there any way for me to redirect that to stdout? i.e. is there a "special name" for stdout that can be used as a file name, like `CONOUT$` on Windows?


title: Find out what command I last ran that starts a certain way?

text: On bash commandline environment, you can do `!!` to rerun your last command. And you can press up arrow to see the the last command you ran. But what if you want to only **see** but not **run** the last command you ran that began in a certain way?


title: rsync dry-run not writing all information to log file

text: I am trying to get a log file for a dry-run of an rsync, but the actual file transfers are not showing up in the log file. My command is               rsync -aruzv --delete src/ usr@me.com:dest/ --log-file=rsyncLog.txt      My Log file looks like this:               2013/12/08 13:08:59 [30210] building file list     2013/12/08 13:09:14 [30210] 331080 files to consider     2013/12/08 13:09:32 [30210] .d..t.... Users/home/Dropbox/.     2013/12/08 13:09:37 [30210] .d..t.... Users/home/Dropbox      but my output in terminal also has lines like this which do NOT show up in the log file:               <f.st.... SystemFiles/rsync/rsyncLog.txt      How would I get lines like the above added to the log file for a dry-run (these lines appear on a regular run).


title: Cannot SSH after switching to Netgear router

text: I have Comcast Xfinity internet. When I was sent their Wifi router/Cable modem combo box, I was able to use SSH perfectly. However, since the Wifi from the box was weak, I decided to buy my own router: a Netgear WNR2500. I then called Comcast to put their router into "Bridge mode" so I can use the wifi from the netgear router. However, after that switch I can no longer SSH into my Amazon AWS instance. Here's the last lines of the log after running: ssh -vvv -i mypermissions.pem ec2-user@ec2- ***********.us-west-2.compute.amazonaws.com               debug1: channel 0: new [client-session]     debug3: ssh_session2_open: channel_new: 0     debug2: channel 0: send open     debug1: Requesting no-more-sessions@openssh.com     debug1: Entering interactive session.     debug2: callback start     debug2: fd 3 setting TCP_NODELAY     debug3: packet_set_tos: set IP_TOS 0x10     debug2: client_session2_setup: id 0     debug2: channel 0: request pty-req confirm 1     debug2: channel 0: request shell confirm 1     debug2: callback done     debug2: channel 0: open confirm rwindow 0 rmax 32768      This is on a Macbook Air, which worked before the router switch. However, using a Windows computer with PuTTY, everything works great, even now after the router switch. I'm really stuck and have been fighting with this problem for several days, so any help is tremendously appreciated!


title: Using dircolors, how do I change the color of my subversion folders

text: Below is a sample of my dircolors file, I want subversion folders (.svn) to be colored, but i guess the extension section only applies to file names. How do i set colors for directories with certain names?               NORMAL 00   # global default, although everything should be something.     FILE   00   # normal file     DIR    35   # directory     LINK   01;36    # symbolic link     FIFO   40;33    # pipe     SOCK   01;35    # socket     BLK    40;33;01 # block device driver     CHR    40;33;01 # character device driver          # This is for files with execute permission:     EXEC 01;32          # List any file extensions like '.gz' or '.tar' that you would like ls     # to colorize below. Put the extension, a space, and the color init string.     # (and any comments you want to add after a '#')     *~    01;33;41 # stuff we hate to find laying around (flashing red)     .svn  37     .cmd  01;32 # executables (bright green)     .exe  01;32     .com  01;32     .btm  01;32