title: How can I enable fail2ban and mod_secure logs to appear in logwatch on centos 6.4?

text: I have `logwatch` working fine but I don't see the `fail2ban` and `mod_secure` logs appearing in my `logwatch` logs. How do I enable this? What do I need to do to logwatch's configuration file? Below is the logwatch.conf file.               ########################################################     # This was written and is maintained by:     #    Kirk Bauer <kirk@kaybee.org>     #     # Please send all comments, suggestions, bug reports,     #    etc, to kirk@kaybee.org.     #     ########################################################          # NOTE:     #   All these options are the defaults if you run logwatch with no     #   command-line arguments.  You can override all of these on the     #   command-line.           # You can put comments anywhere you want to.  They are effective for the     # rest of the line.          # this is in the format of <name> = <value>.  Whitespace at the beginning     # and end of the lines is removed.  Whitespace before and after the = sign     # is removed.  Everything is case *insensitive*.          # Yes = True  = On  = 1     # No  = False = Off = 0          # Default Log Directory     # All log-files are assumed to be given relative to this directory.     LogDir = /var/log          # You can override the default temp directory (/tmp) here     TmpDir = /var/cache/logwatch          # Default person to mail reports to.  Can be a local account or a     # complete email address.  Variable Print should be set to No to     # enable mail feature.     MailTo = root     # WHen using option --multiemail, it is possible to specify a different     # email recipient per host processed.  For example, to send the report     # for hostname host1 to user@example.com, use:     #Mailto_host1 = user@example.com     # Multiple recipients can be specified by separating them with a space.          # Default person to mail reports from.  Can be a local account or a     # complete email address.     MailFrom = Logwatch          # If set to 'Yes', the report will be sent to stdout instead of being     # mailed to above person.     Print = Yes          # if set, the results will be saved in <filename> instead of mailed     # or displayed.     #Save = /tmp/logwatch          # Use archives?  If set to 'Yes', the archives of logfiles     # (i.e. /var/log/messages.1 or /var/log/messages.1.gz) will     # be searched in addition to the /var/log/messages file.     # This usually will not do much if your range is set to just     # 'Yesterday' or 'Today'... it is probably best used with     # By default this is now set to Yes. To turn off Archives uncomment this.     #Archives = No     # Range = All          # The default time range for the report...     # The current choices are All, Today, Yesterday     Range = yesterday          # The default detail level for the report.     # This can either be Low, Med, High or a number.     # Low = 0     # Med = 5     # High = 10     Detail = Low                # The 'Service' option expects either the name of a filter     # (in /usr/share/logwatch/scripts/services/*) or 'All'.     # The default service(s) to report on.  This should be left as All for     # most people.       Service = All     # You can also disable certain services (when specifying all)     Service = "-zz-network"     # Prevents execution of zz-network service, which                                 # prints useful network configuration info.     Service = "-zz-sys"         # Prevents execution of zz-sys service, which                                 # prints useful system configuration info.     Service = "-eximstats"      # Prevents execution of eximstats service, which                                 # is a wrapper for the eximstats program.     # If you only cared about FTP messages, you could use these 2 lines     # instead of the above:     #Service = ftpd-messages   # Processes ftpd messages in /var/log/messages     #Service = ftpd-xferlog    # Processes ftpd messages in /var/log/xferlog     # Maybe you only wanted reports on PAM messages, then you would use:     #Service = pam_pwdb        # PAM_pwdb messages - usually quite a bit     #Service = pam             # General PAM messages... usually not many          # You can also choose to use the 'LogFile' option.  This will cause     # logwatch to only analyze that one logfile.. for example:     #LogFile = messages     # will process /var/log/messages.  This will run all the filters that      # process that logfile.  This option is probably not too useful to     # most people.  Setting 'Service' to 'All' above analyizes all LogFiles     # anyways...          #     # By default we assume that all Unix systems have sendmail or a sendmail-like system.     # The mailer code Prints a header with To: From: and Subject:.     # At this point you can change the mailer to any thing else that can handle that output     # stream. TODO test variables in the mailer string to see if the To/From/Subject can be set     # From here with out breaking anything. This would allow mail/mailx/nail etc..... -mgt      mailer = "sendmail -t"          #     # With this option set to 'Yes', only log entries for this particular host     # (as returned by 'hostname' command) will be processed.  The hostname     # can also be overridden on the commandline (with --hostname option).  This     # can allow a log host to process only its own logs, or Logwatch can be     # run once per host included in the logfiles.      #     # The default is to report on all log entries, regardless of its source host.     # Note that some logfiles do not include host information and will not be     # influenced by this setting.     #     #HostLimit = Yes          # By default the cron daemon generates daily logwatch report     # if you want to switch it off uncomment DailyReport tag.      # The implicit value is Yes     #     # DailyReport = No          # vi: shiftwidth=3 tabstop=3 et      Output from the command sudo logwatch --debug High | grep -T100 'LogFiles that will be processed:'               000-*expandrepeats =         001-*onlyhost =         002-*applystddate =         Logfile = /var/log/maillog        Archive = /var/log/maillog.9.gz        Archive = /var/log/maillog.8.gz        Archive = /var/log/maillog.7.gz        Archive = /var/log/maillog.6.gz        Archive = /var/log/maillog.5.gz        Archive = /var/log/maillog.4.gz        Archive = /var/log/maillog.3.gz        Archive = /var/log/maillog.29.gz        Archive = /var/log/maillog.28.gz        Archive = /var/log/maillog.27.gz        Archive = /var/log/maillog.26.gz        Archive = /var/log/maillog.25.gz        Archive = /var/log/maillog.24.gz        Archive = /var/log/maillog.23.gz        Archive = /var/log/maillog.22.gz        Archive = /var/log/maillog.21.gz        Archive = /var/log/maillog.20.gz        Archive = /var/log/maillog.2.gz        Archive = /var/log/maillog.19.gz        Archive = /var/log/maillog.18.gz        Archive = /var/log/maillog.17.gz        Archive = /var/log/maillog.16.gz        Archive = /var/log/maillog.15.gz        Archive = /var/log/maillog.14.gz        Archive = /var/log/maillog.13.gz        Archive = /var/log/maillog.12.gz        Archive = /var/log/maillog.11.gz        Archive = /var/log/maillog.10.gz        Archive = /var/log/maillog.1.gz        Archive = /var/log/maillog-20121230          Logfile Name: up2date          Logfile Name: cisco          Logfile Name: cron        001-*removeservice = anacron        000-*onlyhost =         Logfile = /var/log/cron        Archive = /var/log/cron.9.gz        Archive = /var/log/cron.8.gz        Archive = /var/log/cron.7.gz        Archive = /var/log/cron.6.gz        Archive = /var/log/cron.5.gz        Archive = /var/log/cron.4.gz        Archive = /var/log/cron.3.gz        Archive = /var/log/cron.29.gz        Archive = /var/log/cron.28.gz        Archive = /var/log/cron.27.gz        Archive = /var/log/cron.26.gz        Archive = /var/log/cron.25.gz        Archive = /var/log/cron.24.gz        Archive = /var/log/cron.23.gz        Archive = /var/log/cron.22.gz        Archive = /var/log/cron.21.gz        Archive = /var/log/cron.20.gz        Archive = /var/log/cron.2.gz        Archive = /var/log/cron.19.gz        Archive = /var/log/cron.18.gz        Archive = /var/log/cron.17.gz        Archive = /var/log/cron.16.gz        Archive = /var/log/cron.15.gz        Archive = /var/log/cron.14.gz        Archive = /var/log/cron.13.gz        Archive = /var/log/cron.12.gz        Archive = /var/log/cron.11.gz        Archive = /var/log/cron.10.gz        Archive = /var/log/cron.1.gz        Archive = /var/log/cron-20121230          Logfile Name: yum        Logfile = /var/log/yum.log          Logfile Name: tac_acc        000-*applystddate =           Logfile Name: exim          Logfile Name: syslog        001-*removeservice = talkd,telnetd,inetd,nfsd,/sbin/mingetty        000-*expandrepeats =         003-*applystddate =         002-*onlyhost =           Logfile Name: dnssec        000-*expandrepeats =         001-*applybinddate =           Logfile Name: netscreen        000-*applystddate =           Logfile Name: autorpm          Logfile Name: dpkg        000-*applyeurodate =           LogFiles that will be processed:     [0] = maillog     [1] = qmail-pop3d-current     [2] = denyhosts     [3] = secure     [4] = messages     [5] = eventlog     [6] = qmail-send-current     [7] = none     [8] = samba     [9] = clam-update     [10] = extreme-networks     [11] = resolver     [12] = qmail-pop3ds-current     [13] = netopia     [14] = fail2ban     [15] = pix     [16] = xferlog     [17] = cisco     [18] = cron     [19] = netscreen     [20] = dnssec     [21] = qmail-smtpd-current     [22] = windows     [23] = vsftpd     [24] = php     [25] = emerge     [26] = http     [27] = bfd     [28] = sonicwall     [29] = iptables     [30] = pureftp     [31] = rt314     [32] = up2date     [33] = yum     [34] = tac_acc     [35] = exim     [36] = autorpm     [37] = dpkg                    Made Temp Dir: /var/cache/logwatch/logwatch.tOKLrjds with tempdir     export LOGWATCH_DATE_RANGE='yesterday'     export LOGWATCH_OUTPUT_TYPE='unformatted'     export LOGWATCH_TEMP_DIR='/var/cache/logwatch/logwatch.tOKLrjds/'     export LOGWATCH_DEBUG='10'          Preprocessing LogFile: maillog     '/var/cache/logwatch/logwatch.tOKLrjds/maillog-archive' '/var/log/maillog'  | /usr/bin/perl /usr/share/logwatch/scripts/shared/expandrepeats ''| /usr/bin/perl /usr/share/logwatch/scripts/shared/onlyhost ''| /usr/bin/perl /usr/share/logwatch/scripts/shared/applystddate ''>/var/cache/logwatch/logwatch.tOKLrjds/maillog          Preprocessing LogFile: secure     '/var/cache/logwatch/logwatch.tOKLrjds/secure-archive' '/var/log/secure'  | /usr/bin/perl /usr/share/logwatch/scripts/shared/expandrepeats ''| /usr/bin/perl /usr/share/logwatch/scripts/shared/onlyhost ''| /usr/bin/perl /usr/share/logwatch/scripts/shared/applystddate ''>/var/cache/logwatch/logwatch.tOKLrjds/secure          Preprocessing LogFile: messages     '/var/cache/logwatch/logwatch.tOKLrjds/messages-archive' '/var/log/messages'  | /usr/bin/perl /usr/share/logwatch/scripts/shared/expandrepeats ''| /usr/bin/perl /usr/share/logwatch/scripts/shared/removeservice 'talkd,telnetd,inetd,nfsd,/sbin/mingetty,netscreen,netscreen'| /usr/bin/perl /usr/share/logwatch/scripts/shared/onlyhost ''| /usr/bin/perl /usr/share/logwatch/scripts/shared/applystddate ''>/var/cache/logwatch/logwatch.tOKLrjds/messages          Preprocessing LogFile: cron     '/var/cache/logwatch/logwatch.tOKLrjds/cron-archive' '/var/log/cron'  | /usr/bin/perl /usr/share/logwatch/scripts/shared/onlyhost ''| /usr/bin/perl /usr/share/logwatch/scripts/shared/removeservice 'anacron'| /usr/bin/perl /usr/share/logwatch/scripts/logfiles/cron/applydate>/var/cache/logwatch/logwatch.tOKLrjds/cron          Preprocessing LogFile: http     '/var/cache/logwatch/logwatch.tOKLrjds/http-archive' '/var/log/httpd/access_log'  | /usr/bin/perl /usr/share/logwatch/scripts/shared/expandrepeats ''| /usr/bin/perl /usr/share/logwatch/scripts/shared/applyhttpdate ''>/var/cache/logwatch/logwatch.tOKLrjds/http          Preprocessing LogFile: yum     '/var/log/yum.log'  | /usr/bin/perl /usr/share/logwatch/scripts/logfiles/yum/applydate>/var/cache/logwatch/logwatch.tOKLrjds/yum          Processing Service: amavis      ( cat /var/cache/logwatch/logwatch.tOKLrjds/maillog  |  /usr/bin/perl /usr/share/logwatch/scripts/shared/onlyservice '(amavis|dccproc)' |/usr/bin/perl /usr/share/logwatch/scripts/shared/removeheaders '' |/usr/bin/perl /usr/share/logwatch/scripts/services/amavis) 2>&1      export clamav_ignoreunmatched='0'     export clamav_ignoreunmatched='0'          Processing Service: clamav-milter      ( cat /var/cache/logwatch/logwatch.tOKLrjds/maillog  |  /usr/bin/perl /usr/share/logwatch/scripts/shared/onlyservice 'clamav-milter' |/usr/bin/perl /usr/share/logwatch/scripts/shared/removeheaders '' |/usr/bin/perl /usr/share/logwatch/scripts/services/clamav-milter) 2>&1      export courier_enable='1'     export courier_ip_lookup='0'     export courier_printmailqueue='0'     export courier_tables='0'          Processing Service: courier      ( cat /var/cache/logwatch/logwatch.tOKLrjds/maillog  |  /usr/bin/perl /usr/share/logwatch/scripts/services/courier) 2>&1           Processing Service: cron      ( cat /var/cache/logwatch/logwatch.tOKLrjds/cron  |  /usr/bin/perl /usr/share/logwatch/scripts/services/cron) 2>&1           Processing Service: dovecot      ( cat /var/cache/logwatch/logwatch.tOKLrjds/maillog  |  /usr/bin/perl /usr/share/logwatch/scripts/shared/onlyservice '(imap-login|pop3-login|dovecot)' |/usr/bin/perl /usr/share/logwatch/scripts/services/dovecot) 2>&1      export ftpd_ignore_unmatched='0'     export detail_transfer='1'     export http_ignore_error_hacks='0'     export http_user_display='0'          Processing Service: http      ( cat /var/cache/logwatch/logwatch.tOKLrjds/http  |  /usr/bin/perl /usr/share/logwatch/scripts/services/http) 2>&1           Processing Service: imapd      ( cat /var/cache/logwatch/logwatch.tOKLrjds/maillog  |  /usr/bin/perl /usr/share/logwatch/scripts/shared/onlyservice '(imapd|imapd-ssl|imapsd)' |/usr/bin/perl /usr/share/logwatch/scripts/shared/removeheaders '' |/usr/bin/perl /usr/share/logwatch/scripts/services/imapd) 2>&1           Processing Service: in.qpopper      ( cat /var/cache/logwatch/logwatch.tOKLrjds/maillog  |  /usr/bin/perl /usr/share/logwatch/scripts/shared/multiservice 'in.qpopper,qpopper' |/usr/bin/perl /usr/share/logwatch/scripts/shared/removeheaders '' |/usr/bin/perl /usr/share/logwatch/scripts/services/in.qpopper) 2>&1           Processing Service: ipop3d


title: How to reduce the volume of a background music stream when a different audio source is playing?

text: With PulseAudio it is possible to manage volume on an application basis, but I find it hardly useful to do it manually. What I'd rather have is the following: I'm usually listening to music but sometimes I want to watch a YouTube video - then I have to manually pause or reduce the volume of the music, often I forget to turn it back on when the video is over. What would I need to do to automatically reduce the volume of a audio stream (the background music) when another application plays sound?


title: Couldn't perform atomic initialization SQLite error with Subversion on Eclipse

text: I'm trying to check out some code from my company's svn repository and I get this message on the console:               checkout https://svn.[company]/[repo]/Trunk/[project] -r HEAD \        --depth=infinity --force     Couldn't perform atomic initialization     svn: Couldn't perform atomic initialization SQLite error     svn: SQLite compiled for 3.7.14.1, but running with 3.7.4      But, on the terminal, I can checkout the project without problems. Has anyone been able to solve this problem as well? I'm running Slackware64-current. Subversion is 1.7.8. SQLite is 3.7.14.1. On Eclipse I installed Subclipse from Eclipse Market, which (I believe) is currently at version 1.8.18, here's its about page: ![about eclipse - subversion client](http://i.stack.imgur.com/Fubo0.png)


title: Can conky monitor other Linux computers on the network?

text: I know conky can monitor my personal computer, but can it monitor the other Linux servers I have on the network? I'd like to see data on CPU and memory usage and some critical processes each server uses. For instance, one server is our MySQL server, so I'd like to display the CPU and memory usage for this server, how much resources the mysqld processes consumes and the network consumption. For another server, some other information should be display according to its use.


title: How to cause memory fragmentation on a Linux based embedded device?

text: **Hardware** ARM **What am I trying to do:** Answer: I am trying to create memory fragmentation on a Linux 2.6.31 based swapless embedded device. **Why:** Answer:I am trying to port some patches to Linux 2.6.31 that will defragment the fragmented memory. In order to test if those patches are working correctly I'd like to try to fragment the memory first. I learnt that continuous allocation and deallocation of memory by apps can lead to fragmentation. Therefore I wrote these simple C programs.               #include <stdio.h>     #include <stdlib.h>          int main(void) {              srand(time(NULL));         int i = 0, j = 0, randnum=0;         while(1) {                  randnum = rand()%10000000;             double *ptr = (double*) malloc(sizeof(*ptr) * randnum);                  for(j = 0 ; j < randnum; j++) {                 *(ptr+j) = (double)j+1;             }                  free(ptr);         }     }      ==========               #include <stdio.h>     #include <stdlib.h>          int main(void) {              srand(time(NULL));         int i = 0, j = 0, randnum=0;         int arr[6] = { 3072, 7168, 15360 , 31744, 64512, 130048};          while(1) {                  for (i = 0; i < 6 ; i++) {                      int *ptr = (int*) malloc(arr[i] * 93);                        for(j = 0 ; j < arr[i] * 93 / sizeof(int); j++) {                     *(ptr+j) = j+1;                 }                      free(ptr);             }         }            }      **How do I measure if memory is fragmented?:** Answer:I look at the o/p of `/proc/buddyinfo` **What do I need:?** Can you suggest a better way to fragment the memory? Because those C programs work but very very slowly.


title: xinitrc: starting xterm with tmux causes all windows to share same geometry

text: I have xterm with tmux open upon startup of X11 with the following line in my xinitrc file: `xterm -e tmux &` However the `-e tmux` causes all windows to assume the geometry of the first -geometry attribute in the file, even if I separately define the geometry of the xterm window. Enclosing in quotes or grave accents does not remedy the situation. If I use tmux before starting X11 (i.e. execute then exit tmux), then the xterm window opens at the default geometry as it should. Restarting X11 causes the problem to return. Suggestions will be greatly appreciated. My entire xinitrc file:   `xsetroot -solid black`   `xstatbar &`   `xconsole -geometry -20-40 &`   `xterm -e tmux &`   `exec cwm`   At the moment all windows are at -20-40. I'm running OpenBSD 5.4 on amd64 hardware.


title: With two interfaces, how can I make one the default route and the other an alternate?

text: I have wired connection to intranet / lan of my work (with proxy) and one wireless without proxy that doesn't have access to the office lan. (Like Guest Wifi) My idea is to route all traffic to eth0 and ONLY some traffic (like ssh) to wlan0. I have an idea on how to do this but not so sure. Well, my problem now is that when both are connected, eth0 and wlan0, traffic seems to be intermitent between the 2, Firefox sometimes tries to go out through wlan0 and can not find the proxy server (because its on the ETH0 lan).               ~$ route -n     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         192.168.100.254 0.0.0.0         UG    0      0        0 eth0     169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlan0     192.168.25.0    0.0.0.0         255.255.255.0   U     2      0        0 wlan0     192.168.100.0   0.0.0.0         255.255.255.0   U     1      0        0 eth0     192.168.200.0   192.168.100.253 255.255.255.0   UG    0      0        0 eth0      How can I fix it, so Firefox doesn't try to go through wlan0 unleast I specify it?               ~$ route     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     default         192.168.100.254 0.0.0.0         UG    0      0        0 eth0     link-local      *               255.255.0.0     U     1000   0        0 wlan0     192.168.25.0    *               255.255.255.0   U     2      0        0 wlan0     192.168.100.0   *               255.255.255.0   U     1      0        0 eth0     192.168.200.0   192.168.100.253 255.255.255.0   UG    0      0        0 eth0


title: Batch mv cronjob leaving some (not all) copies in source

text: I have a cronjob that runs every 5 minutes, looking for wavs and mp3s of the same name in a source directory and if it finds a corresponding pair, it moves both to a destination directory. The script is working very smoothly as far as I can tell, however some MP3s are being left in the source directory as well as appearing in the destination. Both copies are full. The source directory is also the output of another process that churns out wavs and mp3s, and I tested it while writing the script to make sure that it wouldn't take files before they had been fully written. It appears that it holds the progressively written wav in a temp location until it is complete, at which point it moves it to the directory. So the output appears complete at a single instant. The wavs however, are written progressively. I was under the impression that the mp3s are written _before_ the wav, in which case the script would work fine, since it wouldn't proceed until both wav and mp3 were present. [edit: The process is as follows.   1. Audio machine processes audio files and spits out a wav and a corresponding mp3 (with same name).    2. These land in $INPUT although I can't be sure of the relative order in which they appear.   3. My script (below) finds both wav and mp3, generates a hashsum for the wav, and moves both to the $OUTPUT. ] Is it possible – _if_ some mp3s are being written after the wav (entirely possible and unpredictable with our audio software) – that the `mv` command is taking not yet fully written mp3s, dropping them in the destination, but then continuing to update them? I'm just confused as to why both source and destination copies are complete. Here's the relevant bit of my script:               cd "$INPUT"     for x in *.wav     do if [ ! -e $x ]                        then exit 0     else if [ -e ${x%.wav}.mp3 ]                         then    md5sum $x > "$MD5DIR"/$x.md5 &&                      mv $x "$OUTPUT" &&                           mv ${x%.wav}.mp3 "$OUTPUT"               fi     fi      Result (for example):               $ ls $INPUT/     1.mp3     4.mp3          $ ls $OUTPUT/     1.wav    1.mp3     2.wav    2.mp3     3.wav    3.mp3     4.wav    4.mp3      [Edit 2014-03-12: I think I know what is happening. The earlier process that produced the wavs and mp3 files appears to write the id3 metadata tags last, after it has written the entire audio content of the MP3 file. My script then presumably took the MP3 after the audio content had been written but before the ID3 tags had been written. Comparing the files in an audio editor shows no difference, but comparing their id3 tags shows that only the copies left in the input directory had complete tags. I see no way around this, but I discovered that the audio processing machine also produces a result log file for each audio file produced. So as a workaround, the presence of this results file is now the trigger for my script to run. ]


title: Sysctl parameter change after every reboot

text: I have found that the value of `net.netfilter.nf_conntrack_count` variable change every time i reboot the system. Did any one have an explanation for that?


title: Why does this keep wanting to install Java 7? I don't want Java 7, can I somehow stop it from attempting?

text: Why does it keep wanting to install oracle-java7-installer? Is there some way I can prevent it from attempting to do this?               home@home-Vostro-220s-Series:~$ sudo apt-get upgrade     Reading package lists... Done     Building dependency tree            Reading state information... Done     The following packages have been kept back:       printer-driver-postscript-hp     0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.     1 not fully installed or removed.     After this operation, 0 B of additional disk space will be used.     Do you want to continue [Y/n]? Y     Setting up oracle-java7-installer (7u51-0~webupd8~1) ...     Downloading Oracle Java 7...     --2014-07-26 18:26:07--  http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.tar.gz     Resolving download.oracle.com (download.oracle.com)... 219.76.14.26, 219.76.14.9     Connecting to download.oracle.com (download.oracle.com)|219.76.14.26|:80... connected.     HTTP request sent, awaiting response... 302 Moved Temporarily     Location: https://edelivery.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.tar.gz [following]     --2014-07-26 18:26:07--  https://edelivery.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.tar.gz     Resolving edelivery.oracle.com (edelivery.oracle.com)... 23.41.102.140     Connecting to edelivery.oracle.com (edelivery.oracle.com)|23.41.102.140|:443... connected.     HTTP request sent, awaiting response... 302 Moved Temporarily     Location: http://download.oracle.com/errors/download-fail-1505220.html [following]     --2014-07-26 18:26:08--  http://download.oracle.com/errors/download-fail-1505220.html     Connecting to download.oracle.com (download.oracle.com)|219.76.14.26|:80... connected.     HTTP request sent, awaiting response... 200 OK     Length: 5307 (5.2K) [text/html]     Saving to: `jdk-7u51-linux-x64.tar.gz'               0K                                                      100% 38.3M=0s          2014-07-26 18:26:08 (38.3 MB/s) - `jdk-7u51-linux-x64.tar.gz' saved [5307/5307]          Download done.     Removing outdated cached downloads...     sha256sum mismatch jdk-7u51-linux-x64.tar.gz     Oracle JDK 7 is NOT installed.     dpkg: error processing oracle-java7-installer (--configure):      subprocess installed post-installation script returned error exit status 1     No apport report written because MaxReports is reached already                                                                   Errors were encountered while processing:      oracle-java7-installer     E: Sub-process /usr/bin/dpkg returned an error code (1)     home@home-Vostro-220s-Series:~$


title: Monitor setup commands do not work in script

text: I'm running Arch Linux 64-bit on a Samsung RV511. I often connect external monitors using `xrandr`. As I run LXDE with Awesome as a window manager, I need to prepare the xrandr-command by killing certain GUI elements and restarting them afterwards to have them correctly positioned. Here is my script:               #!/bin/sh     # kill conky and lxpanel     killall lxpanel     killall conky          # set monitor     xrandr --output LVDS1 --mode 1366x768 --pos 1680x282 --output VGA1 --mode  1680x1050 --pos 0x0           # restart awesome     killall -HUP awesome          # restart lxpanel and conky     lxpanel -p LXDE &     conky &      Now I'm running into a strange problem. When I run all of the above commands in the same sequence from the command line, I get a neat monitor configuration. However, when I run the script, the GUI crashes, leaving a strange pattern of wallpaper and panel elements. I get the same problem if I launch the `xrandr` command without having killed the `lxpanel` first, which is why i assume the `xrandr` command somehow does not "wait" for the kill commands? Or is there a different reason? Edit: adding `sleep 3` between the code blocks solved the problem, although I still have no idea what the basic problem is. Anyway, here is my current script for future reference:               #!/bin/bash          # kill conky and lxpanel     killall lxpanel     killall conky     sleep 4          # set monitor     xrandr --output LVDS1 --mode 1366x768 --pos 1680x282 --output VGA1 --mode  1680x1050 --pos 0x0      sleep 4          # restart awesome     killall -HUP awesome          # restart lxpanel and conky     sleep 4     lxpanel -p LXDE &     conky &      Post-Edit: The problem cannot be considered completely solved after all. Sometimes I have to `kill xinit` after startup and `startx` again for it to work. There seems to be some uptime-related problem. Needless to say I have no idea what.


title: Resolve nested aliases to their source commands

text: I've made several aliases for my convenience.But now I need to be helpful by sending a useful command and it is full of aliases.I've tried doing `type u` but all it returns is `up && ap upgrade -y --show-progress && r && ap check && ap autoclean` These are all aliases in `u`:               alias a='alias'     a ap='apt-get'     a r='ap autoremove -y'     a up='ap update'


title: To which Debian package does /etc/nsswitch.conf belong?

text: I tried to find out to which package `/etc/nsswitch.conf` belongs on my Debian machine, but `dpkg --search /etc/nsswitch.conf` won't tell me. Does anyone know?


title: Can’t figure out Samba file share permissions as needed.

text: I’m in the final project class for my degree and my group has to have a Linux server that supports a Windows environment. With the files in the file share need to be read only, can be edited and then saved as a new file. I'm also the server guy in my group and the other members are Cisco networking. I'm a new to coding things for Samba. I have an Ubuntu Linux file share running with Samba. Users should be able to see and make files. The files need to be read only. A user should be able open a read only file, edit it as needed and then save it as a new file like a read only file in Windows. With the file share users can see the contents and drag files into it. But they can’t open “Template.doc” from the share to edit and then save as a new file with the changed contents. The error I’m getting is “You don’t have permissions to modify files in this network location. Contact your administrator.” This is the code in the smb.conf file for the share itself in the file system is 777.                   [Share]         path = /share/Share         writeable = yes         ;browseable = yes         guest ok = yes         create mask = 0444         directory mask = 0777      What do I need to add to the smb.conf file to get the share working as needed? For testing at the moment it's just in a generic workgroup with my laptop from not having enough RAM to virtualize the Windows servers and test client. No authentication or crazy domain things will me implemented with this. Thank you for your time! :D


title: Crop SVG drawing to canvas size in command line

text: I have SVG images produced by PlantUML, which has some parts of drawing outside of canvas. It makes it difficult to use such images and I need to crop drawing to canvas size. As I produce UML diagrams with script anyways, it would be really efficient to perform a cropping there as well. So far I've tried two things: a) resize canvas to drawing with Inkscape               inkscape --verb=FitCanvasToDrawing --verb=FileSave --verb=FileClose *.svg      This works fine, but I need to crop drawing to canvas size and this operation seems to be unavailable. b) resize with rsvg-convert               rsvg-convert image.svg -w 1870 -h 1195 -f svg -o image.svg      This does exactly croping to the desired size, but image size increases ~10 times as now there are some binary images embedded into SVG. This is not acceptable for me.


title: How to undo kernel settings?

text: While trying to read some kernel parameters, I think I have mistakenly set some instead:               # sysctl --system -r ^net.*tcp     * Applying /usr/lib/sysctl.d/00-system.conf ...     * Applying /usr/lib/sysctl.d/50-default.conf ...     kernel.sysrq = 16     kernel.core_uses_pid = 1     net.ipv4.conf.default.rp_filter = 1     net.ipv4.conf.default.accept_source_route = 0     fs.protected_hardlinks = 1     fs.protected_symlinks = 1     * Applying /etc/sysctl.d/99-sysctl.conf ...     * Applying /etc/sysctl.conf ...      Now, is there a way to undo those changes?


title: linux command to list details (like PID, VID) of connected devices to the serial port(s) (like RS232) of a computer

text: with USB port we can search Product ID (PID) and Vender ID (VID) of connected devices by using **`lsusb`** command. Is there a similar way to get PID and VID if the same device is connected to **RS232 serial port**


title: Building OpenFOAM 2.2.2 for Xeon Phi

text: I'm trying to build OpenFOAM for Xeon Phi on CentOS 6.5 (Linux 2.6.32-431.11.2.el6.x86_64) Using these steps Install Intel Parallel Studio               tar xvfz parallel_studio_xe_2013_sp1_update2.tgz     cd parallel_studio_xe_2013_sp1_update2     ./install.sh      Compile flex and zlib               echo '     /opt/intel/bin/iccvars.sh intel64     export PATH=/opt/intel/bin:$PATH     ' >> ~/.bashrc     bash     # zlib     wget -c 'http://zlib.net/zlib-1.2.8.tar.gz'     tar xvfz zlib-1.2.8.tar.gz     cd zlib-1.2.8     CC=icc CFLAGS="-mmic" CHOST=x86_64 ./configure --shared     make && make install prefix=/opt/crtdc/micgnu     cd ..     # flex     wget -c 'http://downloads.sourceforge.net/project/flex/flex-2.5.39.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fflex%2Ffiles%2F&ts=1397722559&use_mirror=jaist'     mv flex-2.5.39.tar.gz* flex-2.5.39.tar.gz     tar xvfz flex-2.5.39.tar.gz     cd flex-2.5.39     CC=icc ./configure --prefix=/opt/crtdc/micgnu/ --build=x86_64-k1om-linux     make && make install prefix=/opt/crtdc/micgnu     cd ..      download OpenFOAM and ThirdParty, extract, edit `etc/bashrc` file               export WM_COMPILER=Icc     export WM_MPLIB=INTEL_MPI     source etc/bashrc       clean old compilation if any               wcleanAll ; wcleanLnIncludeAll ; wcleanMachine      add `-mmic` flag               vim wmake/rules/linux64ICC/c     cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC -mmic     vim  wmake/rules/linux64ICC/c++     c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC -mmic      and remove `-xHost` flag (conflict with `-mmic`)               vim wmake/rules/linux64Icc/c++Opt     c++OPT      = -O2 -no-prec-div      build for XeonPhi               source etc/bashrc      ./Allwmake      On the last step, it shows some error:               icpc -std=c++0x -Dlinux64 -DWM_DP -wd327,654,819,1125,1476,1505,1572 -O2 -no-prec-div  -DNoRepository -I/root/OpenFOAM/OpenFOAM-2.2.2/src/finiteVolume/lnInclude -ItractionDisplacementCorrectionStress -I../solidDisplacementFoam -IlnInclude -I. -I/root/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/lnInclude -I/root/OpenFOAM/OpenFOAM-2.2.2/src/OSspecific/POSIX/lnInclude   -fPIC -mmic -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64IccDPOpt/tractionDisplacementCorrectionFvPatchVectorField.o Make/linux64IccDPOpt/solidEquilibriumDisplacementFoam.o -L/root/OpenFOAM/OpenFOAM-2.2.2/platforms/linux64IccDPOpt/lib \                  -lfiniteVolume -lOpenFOAM -ldl   -L/lib -lm -o /root/OpenFOAM/OpenFOAM-2.2.2/platforms/linux64IccDPOpt/bin/solidEquilibriumDisplacementFoam     x86_64-k1om-linux-ld: cannot find -lfiniteVolume     x86_64-k1om-linux-ld: cannot find -lOpenFOAM     make[2]: *** [/root/OpenFOAM/OpenFOAM-2.2.2/platforms/linux64IccDPOpt/bin/solidEquilibriumDisplacementFoam] Error 1     make[2]: Leaving directory `/root/OpenFOAM/OpenFOAM-2.2.2/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam'     make[1]: *** [solidEquilibriumDisplacementFoam] Error 2     make[1]: Target `application' not remade because of errors.     make[1]: Leaving directory `/root/OpenFOAM/OpenFOAM-2.2.2/applications/solvers/stressAnalysis'     make: *** [stressAnalysis] Error 2     make: Target `application' not remade because of errors.      on the first step it also shows:               Note: ignore spurious warnings about missing mpicxx.h headers     wmake libso mpi     SOURCE=UOPwrite.C ;  icpc -std=c++0x -Dlinux64 -DWM_DP -wd327,654,819,1125,1476,1505,1572 -O2 -no-prec-div  -DNoRepository   -IlnInclude -I. -I/root/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/lnInclude -I/root/OpenFOAM/OpenFOAM-2.2.2/src/OSspecific/POSIX/lnInclude   -fPIC -mmic -c $SOURCE -o Make/linux64IccDPOptINTEL_MPI/UOPwrite.o     UOPwrite.C(29): catastrophic error: cannot open source file "mpi.h"       #include "mpi.h"      And I tried to locate the mpi.h file:               $ locate /mpi.h     /home/ccfd/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/Utilities/mpi4py/Library/compat/anympi.h     /home/ccfd/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/Utilities/mpi4py/Library/compat/deinompi.h     /home/ccfd/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/Utilities/mpi4py/Library/compat/lammpi.h     /home/ccfd/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/Utilities/mpi4py/Library/compat/openmpi.h     /home/ccfd/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/Utilities/mpi4py/Library/compat/sgimpi.h     /home/ccfd/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/Utilities/mpi4py/Library/config/deinompi.h     /home/ccfd/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/Utilities/mpi4py/Library/config/lammpi.h     /home/ccfd/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/Utilities/mpi4py/Library/config/openmpi.h     /home/ccfd/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/Utilities/mpi4py/Library/config/sgimpi.h     /home/ccfd/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/VTK/Utilities/mrmpi/mpistubs/mpi.h     /home/ccfd/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/VTK/Utilities/vtkhdf5/src/H5FDmpi.h     /home/ccfd/OpenFOAM/ThirdParty-2.2.2/gcc-4.5.2/libjava/include/jvmpi.h     /home/ccfd/OpenFOAM/ThirdParty-2.2.2/openmpi-1.6.3/ompi/contrib/vt/vt/tools/vtunify/mpi/vt_unify_mpi.h     /home/ccfd/OpenFOAM/ThirdParty-2.2.2/openmpi-1.6.3/ompi/include/mpi.h.in     /home/ccfd/OpenFOAM/ThirdParty-2.2.2/openmpi-1.6.3/ompi/mpi/f77/prototypes_mpi.h     /home/ccfd/OpenFOAM/ThirdParty-2.2.2/platforms/linux64Gcc45/paraview-3.12.0/include/paraview-3.12/mrmpi/mpi.h     /home/ccfd/OpenFOAM/ThirdParty-2.2.2/platforms/linux64Gcc45/paraview-3.12.0/include/paraview-3.12/vtkhdf5/H5FDmpi.h     /opt/intel/composer_xe_2013_sp1.1.106/mkl/benchmarks/mp_linpack/include/hpl_mpi.h     /opt/intel/composer_xe_2013_sp1.1.106/mkl/include/fftw/fftw3-mpi.h     /opt/intel/composer_xe_2013_sp1.1.106/mkl/include/fftw/fftw_mpi.h     /opt/intel/composer_xe_2013_sp1.1.106/mkl/include/fftw/rfftw_mpi.h     /opt/intel/composer_xe_2013_sp1.2.144/mkl/benchmarks/mp_linpack/include/hpl_mpi.h     /opt/intel/composer_xe_2013_sp1.2.144/mkl/include/fftw/fftw3-mpi.h     /opt/intel/composer_xe_2013_sp1.2.144/mkl/include/fftw/fftw_mpi.h     /opt/intel/composer_xe_2013_sp1.2.144/mkl/include/fftw/rfftw_mpi.h     /root/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/Utilities/mpi4py/Library/compat/anympi.h     /root/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/Utilities/mpi4py/Library/compat/deinompi.h     /root/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/Utilities/mpi4py/Library/compat/lammpi.h     /root/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/Utilities/mpi4py/Library/compat/openmpi.h     /root/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/Utilities/mpi4py/Library/compat/sgimpi.h     /root/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/Utilities/mpi4py/Library/config/deinompi.h     /root/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/Utilities/mpi4py/Library/config/lammpi.h     /root/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/Utilities/mpi4py/Library/config/openmpi.h     /root/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/Utilities/mpi4py/Library/config/sgimpi.h     /root/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/VTK/Utilities/mrmpi/mpistubs/mpi.h     /root/OpenFOAM/ThirdParty-2.2.2/ParaView-3.12.0/VTK/Utilities/vtkhdf5/src/H5FDmpi.h     /root/OpenFOAM/ThirdParty-2.2.2/gcc-4.5.2/libjava/include/jvmpi.h     /root/OpenFOAM/ThirdParty-2.2.2/openmpi-1.6.3/ompi/contrib/vt/vt/tools/vtunify/mpi/vt_unify_mpi.h     /root/OpenFOAM/ThirdParty-2.2.2/openmpi-1.6.3/ompi/include/mpi.h.in     /root/OpenFOAM/ThirdParty-2.2.2/openmpi-1.6.3/ompi/mpi/f77/prototypes_mpi.h     /root/OpenFOAM/ThirdParty-2.2.2/platforms/linux64Gcc45/paraview-3.12.0/include/paraview-3.12/mrmpi/mpi.h     /root/OpenFOAM/ThirdParty-2.2.2/platforms/linux64Gcc45/paraview-3.12.0/include/paraview-3.12/vtkhdf5/H5FDmpi.h     /usr/include/openmpi-x86_64/mpi.h     /usr/src/kernels/2.6.32-431.11.2.el6.x86_64/include/config/usb/serial/siemens/mpi.h     /usr/src/kernels/2.6.32-431.11.2.el6.x86_64/include/linux/crypto/mpi.h     /usr/src/kernels/2.6.32-431.3.1.el6.x86_64/include/config/usb/serial/siemens/mpi.h     /usr/src/kernels/2.6.32-431.3.1.el6.x86_64/include/linux/crypto/mpi.h      What's wrong with this? Is it because I don't have Intel MPI? Any way to solve this without Intel MPI?


title: How to modify write permission on current buffer in emacs?

text: Is it possible to change the write permissions on a file from inside emacs, without killing/re-opening the buffer? Sometimes I forget to modify the permissions on a file before opening it. I can modify the permissions from inside emacs (`M-! chmod u+w filename`) but this doesn't update the buffer which remains write protected and refuses to modify the file. Is there a way to update permissions inside the buffer? Bonus point if I can assign this to a shortcut!


title: Implementing a String -> PDF Stamp tool

text: I wrote a little shell function which creates a fixed-size PDF file (A4) from a character string using `gs`:               make_stamp() {     file=$1     string=$2     tmp=${file}-small.pdf     gs -o "$tmp" -sDEVICE=pdfwrite -g500x200 \       -c "/Helvetica findfont 12 scalefont setfont" \       -c "0 1 0 0 setcmykcolor" \       -c "0 5 moveto" \       -c "(${string}) show" \       -c "showpage"     gs -o "$file" -sDEVICE=pdfwrite -g5950x8420 \       -c "<</PageOffset [510 20]>> setpagedevice" \       -f "$tmp"     }      However, there are a few things that I would like to improve:   1. when creating `$tmp`, how do I set a solid background colour?   2. when creating `$tmp`, is it possible to have the size auto-calculated to be tightly around the text, maybe with a few `pt` as padding?   3. is it possible to rewrite this function to only call `gs` once? or   * is there another way to do this which doesn't use `gs` directly? The stamp file must be textual, a rendered image is no good. For anyone who is interested, I use the output of this function `$stamp` in a call to `pdftk` like this:               pdftk original.pdf stamp $stamp output stamped.pdf


title: Stop user being able to access live CD environment or recovery mode?

text: I'm haved created an account on ubuntu that is just a standard user but with no internet access. I have also removed 'recovery mode' from the grub menu so that one cannot just choose this option access root and reverse all my changes (maybe a safer option could have been passwording this rather than removing...), but this still leaves the option of simply booting into the liveCD/USB and being able to access the internet etc... Is there a way to prevent a user being able to boot into liveCD environment?


title: How to setup password-less ssh with RSA keys

text: I am trying to setup a password-less SSH configuration between two machines and am having trouble. There are a ton of howtos out there that I have followed and have had no success. Here are the steps that I've taken   1. Generate the authentication keys on the client. ( _Pressed enter when prompted for a passphrase_ ) `[root@box1:.ssh/$] ssh-keygen -t rsa`   2. Copy the public key to the server. `[root@box1:.ssh/$] scp id_rsa.pub root@box2:.ssh/authorized_keys`   3. Verified the authorized key was created successfully on the server   4. Executed the following command: `[root@box1:.ssh/$] ssh root@box2 ls` And I was still prompted for a password. I read a note on one howto that "depending on the version of SSH that is running..." (although it did not specify which versions needed this), it might require:   * The public key in .ssh/authorized_keys2   * Permissions of .ssh to 700   * Permissions of .ssh/authorized_keys2 to 640 I also followed those steps and had no success. I have verified that the home, root, and .ssh directories are not writable by group (according to http://unix.stackexchange.com/tags/ssh/info). Anyone have any ideas what I'm missing? Thanks EDIT: I also copied the public key to the second box using the ssh-copy-id command and that generated the `.ssh/authorized_keys` file. `[root@box1:.ssh/$] ssh-copy-id -i id_rsa.pub root@box2` EDIT2: Including version information // box1 (system keys were generated on)   * Linux 2.6.34   * OpenSSH_5.5p1 Debian-6, OpenSSL 0.9.8o 01 June 2010 // box2   * Linux 2.6.33   * Dropbear client v0.52 EDIT3: Debug output               [root@box1:.ssh/$] ssh -vvv root@box2 ls     OpenSSH_5.5p1 Debian-6, OpenSSL 0.9.8o 01 Jun 2010     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: Applying options for *     debug2: ssh_connect: needpriv 0     debug1: Connecting to box2 [box2] port 22.     debug1: Connection established.     debug1: permanently_set_uid: 0/0     debug3: Not a RSA1 key file /root/.ssh/id_rsa.     debug2: key_type_from_name: unknown key type '-----BEGIN'     debug3: key_read: missing keytype     debug3: key_read: missing whitespace     debug2: key_type_from_name: unknown key type '-----END'     debug3: key_read: missing keytype     debug1: identity file /root/.ssh/id_rsa type 1     debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048     debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048     debug1: identity file /root/.ssh/id_rsa-cert type -1     debug1: identity file /root/.ssh/id_dsa type -1     debug1: identity file /root/.ssh/id_dsa-cert type -1     debug1: Remote protocol version 2.0, remote software version dropbear_0.52     debug1: no match: dropbear_0.52     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_5.5p1 Debian-6     debug2: fd 3 setting O_NONBLOCK     debug1: SSH2_MSG_KEXINIT sent     debug1: SSH2_MSG_KEXINIT received     debug2: kex_parse_kexinit:     diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-         group14-sha1,diffie-hellman-group1-sha1     debug2: kex_parse_kexinit:     ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-rsa,ssh-dss     debug2: kex_parse_kexinit:     aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-         cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysatoe     debug2: kex_parse_kexinit:     aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-         cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysatoe     debug2: kex_parse_kexinit:     hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-         sha1-96,hmac-md5-96     debug2: kex_parse_kexinit:     hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-     sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib     debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib     debug2: kex_parse_kexinit:     debug2: kex_parse_kexinit:     debug2: kex_parse_kexinit: first_kex_follows 0     debug2: kex_parse_kexinit: reserved 0     debug2: kex_parse_kexinit: diffie-hellman-group1-sha1     debug2: kex_parse_kexinit: ssh-rsa,ssh-dss     debug2: kex_parse_kexinit:     aes128-ctr,3des-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes256-cbc,twofish256-cbc,twofish-     cbc,twofish128-cbc,blowfish-cbc     debug2: kex_parse_kexinit:     aes128-ctr,3des-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes256-cbc,twofish256-cbc,twofish-     cbc,twofish128-cbc,blowfish-cbc     debug2: kex_parse_kexinit: hmac-sha1-96,hmac-sha1,hmac-md5     debug2: kex_parse_kexinit: hmac-sha1-96,hmac-sha1,hmac-md5     debug2: kex_parse_kexinit: zlib,zlib@openssh.com,none     debug2: kex_parse_kexinit: zlib,zlib@openssh.com,none     debug2: kex_parse_kexinit:     debug2: kex_parse_kexinit:     debug2: kex_parse_kexinit: first_kex_follows 0     debug2: kex_parse_kexinit: reserved 0     debug2: mac_setup: found hmac-md5     debug1: kex: server->client aes128-ctr hmac-md5 none     debug2: mac_setup: found hmac-md5     debug1: kex: client->server aes128-ctr hmac-md5 none     debug2: dh_gen_key: priv key bits set: 132/256     debug2: bits set: 515/1024     debug1: sending SSH2_MSG_KEXDH_INIT     debug1: expecting SSH2_MSG_KEXDH_REPLY     debug3: check_host_in_hostfile: host 192.168.20.10 filename     /root/.ssh/known_hosts     debug3: check_host_in_hostfile: host 192.168.20.10 filename     /root/.ssh/known_hosts     debug3: check_host_in_hostfile: match line 3     debug1: Host 'box2' is known and matches the RSA host key.     debug1: Found key in /root/.ssh/known_hosts:3     debug2: bits set: 522/1024     debug1: ssh_rsa_verify: signature correct     debug2: kex_derive_keys     debug2: set_newkeys: mode 1     debug1: SSH2_MSG_NEWKEYS sent     debug1: expecting SSH2_MSG_NEWKEYS     debug2: set_newkeys: mode 0     debug1: SSH2_MSG_NEWKEYS received     debug1: Roaming not allowed by server     debug1: SSH2_MSG_SERVICE_REQUEST sent     debug2: service_accept: ssh-userauth     debug1: SSH2_MSG_SERVICE_ACCEPT received     debug2: key: /root/.ssh/id_rsa (0x54b1c340)     debug2: key: /root/.ssh/id_dsa ((nil))     debug1: Authentications that can continue: publickey,password     debug3: start over, passed a different list publickey,password     debug3: preferred     gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password     debug3: authmethod_lookup publickey     debug3: remaining preferred: keyboard-interactive,password     debug3: authmethod_is_enabled publickey     debug1: Next authentication method: publickey     debug1: Offering public key: /root/.ssh/id_rsa     debug3: send_pubkey_test     debug2: we sent a publickey packet, wait for reply     debug1: Authentications that can continue: publickey,password     debug1: Trying private key: /root/.ssh/id_dsa     debug3: no such identity: /root/.ssh/id_dsa     debug2: we did not send a packet, disable method     debug3: authmethod_lookup password     debug3: remaining preferred: ,password     debug3: authmethod_is_enabled password     debug1: Next authentication method: password      EDIT4: Another interesting development. Instead of generating the keys on box1 (running OpenSSH) and copying them to box2 (running dropbear) I did it in reverse: `[root@box2:.ssh/$] dropbearkey -t rsa -f id_rsa` `[root@box2:.ssh/$] dropbearkey -y -f id_rsa | grep "^ssh-rsa" >> authorized_keys` `[root@box2:.ssh/$] scp authorized_keys root@box1:.ssh/` And with that I am successfully able to issue commands password-less from box2 to box1 ONLY if I specify the ID file: `[root@box2:.ssh/$] ssh -i id_rsa root@box1 ls` Still unable to issue commands from box1 (OpenSSH) to box2 (dropbear).


title: How to list files in a zip without extra information

text: en I use `unzip -l test.zip` I get the output like this:               Archive:  test.zip       Length      Date    Time    Name     ---------  ---------- -----   ----        810000  05-07-2014 15:09   file1.txt        810000  05-07-2014 15:09   file2.txt        810000  05-07-2014 15:09   file3.txt     ---------                     -------       2430000                     3 files      But I am insterested only by the lines containnig the file details. I tried to make filtering using grep like this: `unzip -l test.zip | grep -v Length | grep -v "\-\-\-\-" | g -v Archive | grep -v " files"` But it is long and prone to error (e.g a file name Archive in this list will be dropped) Is there any other options with unzip -l (I checked the unzip man page and did not find any) or another tool to do so? It is important to me not to really unzip the archive but just to look into it.


title: Realtek RTS5209 PCI-E Card Reader only work if card is inserted before boot

text: # Hardware Info   * Laptop Model: Sony Vaio Pro 13   * Problematic Hardware: Bulti-in Realtek Semiconductor Co., Ltd. RTS5209 PCI Express Card Reader # Problem description Here is the problem, if I boot with my SD card inserted into the card reader, my Gentoo correctly load kernel module and detected SD card, assigned it to /dev/mmcblk0 according to dmesg output, XFCE also show an SD icon on desktop so I could mount it without any problem. But if I boot without any SD card in card reader instead, and insert SD card after boot nothing happened. No SD card been detected, dmesg shows nothing. Since SystemRescueCD (which is also based on Gentoo) correctly work as expected (boot without SD card inserted, insert SD card after boot, SystemResuceCD could detected it correctly and assign it to /dev/mmcblock0. So I guess I must miss some configuration on my Gentoo. # What have I tried I tried to compare lsmod output from both configuration, and found if I boot with SD card inserted, the following additional kernel module will be loaded.               rtsx_pci_sdmmc         13679  0     rtsx_pci_ms             7218  0     mmc_core               91689  2 mmc_block,rtsx_pci_sdmmc     memstick                6896  1 rtsx_pci_ms     rtsx_pci               31487  2 rtsx_pci_ms,rtsx_pci_sdmmc       I also confirmed these module been loaded after I insert my SD card into card reader when I using SystemRescueCD. I also tried load these module manually on my Gentoo system, but nothing happens after I load them, no new print out in dmesg, still no SD card been detected. # lspci output               00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 09)     00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)     00:03.0 Audio device: Intel Corporation Haswell-ULT HD Audio Controller (rev 09)     00:14.0 USB controller: Intel Corporation 8 Series USB xHCI HC (rev 04)     00:16.0 Communication controller: Intel Corporation 8 Series HECI #0 (rev 04)     00:1b.0 Audio device: Intel Corporation 8 Series HD Audio Controller (rev 04)     00:1c.0 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 3 (rev e4)     00:1c.3 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 4 (rev e4)     00:1c.4 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 6 (rev e4)     00:1d.0 USB controller: Intel Corporation 8 Series USB EHCI #1 (rev 04)     00:1f.0 ISA bridge: Intel Corporation 8 Series LPC Controller (rev 04)     00:1f.3 SMBus: Intel Corporation 8 Series SMBus Controller (rev 04)     01:00.0 Network controller: Intel Corporation Wireless 7260 (rev 6b)     02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5209 PCI Express Card Reader (rev 01)     03:00.0 SATA controller: Samsung Electronics Co Ltd XP941 PCIe SSD (rev 01)       # Kernel configuration   1. Everything inside MMC/SD/SDIO card support (except MMC debugging / MMC host clock gating / MMC host test driver) is compiled as kernel module.   2. CONFIG_MEMSTICK=m   3. CONFIG_MEMSTICK_REALTEK_PCI=m I'm totally stuck and have no idea what next step should I take to fix this problem, where should I check now?


title: How to validate an SSH public key?

text: I've had issues copying public keys to `authorized_keys` and winding up with an extra linefeed or space or something. Is there a way to simply validate that a key looks like a valid key? I don't have the private key.


title: Semicolon in conditional structures

text: Why put semicolons in one and not in another? The result is the same **Code one**               if [ "a" == "a" ]     then     echo "true"     fi      **Code two**               if [ "a" == "a" ];     then     echo "true";     fi      Semicolons in the second code are unnecessary? When it is necessary to place semicolons?


title: How do I know what decompression algorithms are compiled-in into the linux kernel?

text: If `/proc/config.gz` is unavailable, how do I know what decompression algorithms the running kernel is capable of using on a compressed `cpio` `initramfs`? Is the `gzip` algorithm always available, even when `CONFIG_DECOMPRESS_GZIP` is not `y` when building the kernel?


title: Are remote LUKS volumes mounted locally with sshfs made visible to remote users?

text: I created an encrypted volume with `LUKS` and uploaded it to a remote directory on an untrusted host. I can mount it locally though. I first mount the remote directory locally with `sshfs` and then open my volume with `cryptsetup` as if it were a local file.               $ sshfs user@host: remote/     # cryptsetup luksOpen remote/disk.img disk     $ mount /dev/mapper/disk mount_point/      My question is: do I thereby make whatever is in `mount_point/` visible to users on the remote host? Also, are commands I execute in a directory mounted through `sshfs` transparent to administrators on the remote host?


title: Autokey won't start

text: I installed `autokey-gtk` application but it won't start. When I run it from terminal it will write a message:               Xlib.protocol.request.QueryExtension      but that's all. The application won't start. Do you know what is wrong?


title: Problem installing Debian wheezy from USB stick

text: I try to install Debian wheezy on my IBM ThinkPad X40 2372-CTO via USB stick. First i do `zcat boot.img.gz > /dev/sdb` with this image. After that i do `cp debian-*-netinst.iso /mnt/sdb` with this image. When I try to install debian from the USB stick the following happens. First I get `SYSLINUX .... aborted. boot:`. When I press enter I see the Installer menu. When I choose `Install` the machine reboots. What am I doing wrong here? Are these the wrong images? How can I debug this?


title: Disconnecting drives for dual-boot installation

text: Related to my post about my Arch installation, I'm wondering whether the following procedure would work:   1. Disconnect sda   2. Install Arch normally on sdb as if on a single-drive system   3. Disconnect sdb, reconnect sda   4. Install Win7 on sda as if on a single-drive system   5. Reconnect sdb   6. Tell BIOS to boot sdb   7. In Arch, edit GRUB settings for dual-boot I guess this depends on whether step 7 will work, i.e., boot Arch even though there's another hard drive present that wasn't there during installation. And a related issue: Does anyone know whether Windows 7 needs to be (a) installed first, whether or not there's another hard drive present, and (b) on the first hard drive, i.e., hd0 (if the Linux drive is going to have the bootloader on it, it might as well be first if possible)? I know that installing two systems on the _same_ hard drive requires Windows to be installed first because otherwise it will overwrite the MBR, but what about separate drives?


title: Starting automatically uppercase after dot

text: Is it possible to configure the following automation? Everytime I will type a sentence in which the last character is dot, colon or quotation mark it will change the next letter automatically to uppercase, so that I don't have to press the shift key? The settings should apply to all desktop environement (XFCE, KDE, Gnome) and terminals. Sometimes you need to write lowercase after dot, so there could be some key that will suppress uppercase. I noticed that mobile applications have this possibility.


title: What's the purpose of the first argument to select system call?

text: From `man select`               int select(int nfds, fd_set *readfds, fd_set *writefds,                fd_set *exceptfds, struct timeval *timeout);      > nfds is the highest-numbered file descriptor in any of the three sets, plus > 1. What is the purpose of `nfds`, when we already have `readfds`, `writefds` and `exceptfds`, from which the file descriptors can be determined?


title: Default File Permissions - Ubuntu & VSFTPD

text: I have a server setup with Ubuntu, Apache2 and VSFTPD. We virtual host several sites on this machine. Typically, I use the same process to set up the new sites, but the default permissions for some are different than the others. For some sites, I can upload new files and directories through FTP and they receive 644 and 755 permissions respectively. Just how I want them by default. For other sites, they receive 0 or 600 as the default new file permission. I have to manually change each file to 644. This is slow and a pain to do. I'm by no means an expert, but I've checked the permissions and the ownership and it all seems to be the same. What am I missing? PS - I'm sure I left out some relevant information. Please let me know what else I need to provide. Thank you!


title: Is it possible to su without being prompted for a password?

text: I suspect `su` doesn't have any way to allow passing the password from the shell instead of being prompted for one, for security reasons (couldn't find anything in the MAN). Is this true?


title: automatic capturing top output by cronjob CENTOS 6.5 x86_64

text: I have this command:               top -n 14400 -a -b -d 1 > /toplogfile.txt      I want to make a script which is run by `cron` every day to capture top output, and if it is possible `gzip` the output file after the script finished. How can I implement this?


title: Cannot build sox with FLAC support

text: I'm trying to configure and build `sox` v14.4.1 with FLAC support enabled, on Ubuntu. I have downloaded and installed `flac` and done an `sudo ldconfig` (just in case the libs were wrongly linked), but somehow it's not showing on `sox`: **Output of`./configure`**:                 lame......................no      How should this be fixed?`


title: diff files within dirs listing by date modified

text: I was using MELD but it can't seem to sort by modification time, so I've been looking for a way to achieve something similar in terminal. I found a line of code               find /path/to/dir1  /path/to/dir2 -printf "%TY-%Tm-%Td %TH:%TM %p\n" | sort -r      which seems to output the differences (including new files) between directories. I'm looking for a way to list _only_ the modified files (not new or deleted) across two dirs and list them by most recently modified. I also need to limit output to N lines because my project is massive. I hate asking outright, but I am new to bash scripting and googling about `diff` has revealed surprisingly little...


title: FVWM HowTo Swallow?

text: 1. How could I **swallow** things like `xclock`, `tray` and other stuff to `FvwmButtons`?   2. Is `FvwmButtons` the only option to swallow this type of things?    3. How to swallow `FvwmWinList` to `FvwmButtons`?


title: remove new lines

text: My input is a csv file like this:               10,"Special Projects,bangaram",0,,0     10,"Statutory/ Internal Audit , MO reporting (incl Excel Spreadsheet uploadation)     ",     bangaram,0,,0     10,"Complience with SVCCL",     bangaram,       0,,     0     10,     "Release of incentives / commission to all channel partners.     ",      bangaram,       0,,     0     10,"Timely processing of sales orders to channel partners",     bangaram,       0,,     0     10,"    Balance sheet Reviwe", bangaram,        0,,     0     10,"    Ensuring Critical Reconciliation on monthly basis. (IN-GL)",    bangaram,       0,,     0     10,     "Timely & accurate closure of Accounts.     ",      bangaram,       0,,     0     11,"    Opex Spend on communication activites", bangaram,       0,,     0     11,"    Opex Spend on communication activites", bangaram        ,0,,    0      I need to get output like this:               10,"Special Projects,bangaram",0,,0     10,"Statutory/ Internal Audit , MO reporting (incl Excel Spreadsheet uploadation)",     bangaram,0,,0     10,"Complience with SVCCL",     bangaram,       0,,     0     10,     "Release of incentives / commission to all channel partners.",      bangaram,       0,,     0     10,"Timely processing of sales orders to channel partners",     bangaram,       0,,     0     10,"    Balance sheet Reviwe", bangaram,        0,,     0     10,"    Ensuring Critical Reconciliation on monthly basis. (IN-GL)",    bangaram,       0,,     0     10,     "Timely & accurate closure of Accounts.",      bangaram,       0,,     0     11,"    Opex Spend on communication activites", bangaram,       0,,     0     11,"    Opex Spend on communication activites", bangaram        ,0,,    0      Where ever new line is der that will be delete and then add to previous line. Please write shell script regarding this.


title: How to get ondemand governor on fedora

text: In Ubuntu 13.10 on my _(Dual Core i5 Lenovo G570)_ laptop, I recently discovered the wonders of `indicator-cpufreq`, so I can extend my battery life dramatically by setting it to 'ondemand' or 'powersave' governor \- here is the menu it shows:                                                       ![indicator-cpufreq menu](http://i.stack.imgur.com/sUjwg.png) I was wondering whether I could implement this in the other half other my dual boot on my laptop, Fedora 20. However, after looking at this documentation, and installing the `kernel-tools` package, when I run the command to list the available modes. On Fedora I get:               wilf@whm1:~$ cpupower frequency-info --governors     analyzing CPU 0:     powersave performance      On Ubuntu I get:               wilf@whm2:~$ cpupower frequency-info --governors     analyzing CPU 0:     conservative ondemand userspace powersave performance      So can I get the `conservative`, `ondemand`, & `userspace` modes in Fedora?   Mainly the `ondemand` one * * * ### Fedora System Info _Kernel_ > Linux whm1 3.12.10-300.fc20.i686+PAE #1 SMP Thu Feb 6 22:31:13 UTC 2014 i686 > i686 i386 GNU/Linux _Version_               Fedora release 20 (Heisenbug)     Kernel 3.12.10-300.fc20.i686+PAE on an i686      **`/proc/cpuinfo`, relevant `/etc/default/grub` _(Fedora manages Grub, not Ubuntu)_ :**               #GRUB_CMDLINE_LINUX="acpi_osi=Linux acpi_backlight=vendor pcie_aspm=force"     GRUB_CMDLINE_LINUX="vconsole.font=latarcyrheb-sun16 $([ -x /usr/sbin/rhcrashkernel-param ] && /usr/sbin/rhcrashkernel-param || :) rhgb quiet acpi_osi=Linux acpi_backlight=vendor pcie_aspm=force"      ### Ubuntu System Info _Kernel_ > Linux whm2 3.11.0-15-generic #25-Ubuntu SMP Thu Jan 30 17:25:07 UTC 2014 > i686 i686 i686 GNU/Linux **`/proc/cpuinfo`, relevant `/etc/default/grub` _(I think is loaded by Fedora Grub)_ :**               GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`     GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"     GRUB_CMDLINE_LINUX=""


title: How to append date to backup file

text: I need to make a backup of a file, and I would like to have a timestamp as part of the name to make it easier to differentiate. How would you inject the current date into a copy command?               [root@mongo-test3 ~]# cp foo.txt {,.backup.`date`}     cp: target `2013}' is not a directory          [root@mongo-test3 ~]# cp foo.txt {,.backup. $((date)) }     cp: target `}' is not a directory            [root@mongo-test3 ~]# cp foo.txt foo.backup.`date`     cp: target `2013' is not a directory


title: recursive search for a pattern, then for each match print out the specific SEQUENCE: line number, file name, and no file contents

text: What I am after is almost exactly the same as can be found here, but I want the format "line number, separator, filename, newline" in the results, thus displaying the line number at the beginning of the line, not after the filename, and without displaying the line containing the match. The reason why this format is preferable is that   * **(a)** the filename might be long and cryptic and contain the separator which the tool uses to separate the filename from the line number, making it incredibly difficult to use awk to achieve this, since the pattern inside the file might also contain the same separator. Also, line numbers at the beginning of the line will be aligned better than if they appear after the filename. And the other reason for this desired format is that    * **(b)** the lines matching the pattern may be too long and mess up the one line per row property on the output displayed on standard out (and viewing the output on standard out is better than having to save to a file and use a tool like vi to view one line per row in the output file). How can I recursively search directories for a pattern and just print out file names and line numbers Now that I've set out the requirement, consider this:   1. Ack is not installed on the Linux host I'm using so I cannot use it.   2. If I do the following, the shell executes `find .` and substitutes 'find .` with a list of absolute paths starting at the current working directory and proceeding downwards recursively:              grep -n PATTERN `find .`      then the -n prints the line number, but not where I want it. Also, for some reason I do not understand, if a directory name includes the PATTERN, then grep matches it in addition to the regular files that contain the pattern. This is not what I want, so I use:              grep -n PATTERN `find . -type f`      I also wanted to change this command so that the output of find is passed on to grep dynamically. Rather than having to build the entire list of absolute paths first and then pass the bulk of them to grep, have find pass each line to grep as it builds the list, so I tried:              find . -exec grep -n PATTERN  '{}' \;      which seems like the right syntax according to the `man page` but when I issue this command the Bash shell executes about 100 times slower, so this is not the way to go. In view of what I described, how can I execute something similar to this command and obtain the desired format. I have already listed the problems associated with the related post.


title: When adding a ip via ifcfg how do you have it auto increment the clonenum?

text: I'm writing a script that adds ips to a multihomed machine. I'm not allowed to use network-scripts folder because well that's what they said. They also stated they wanted to clone num to increase. Right now This is all being run in a perl script from bash as root. Is there a way to have ifcfg auto increment the clonenum? If not, what if I just read the last clonenum (is there a way to know that?) and then with ifcfg how would you specify the clonenum as you added it?


title: Run program at lower CPU speed?

text: It would be very useful for me to run specific programs in a Linux environment with a fixed (lower) CPU clock speed (say, `runat 400mhz ./my-program --argument-of="my program"` for getting that clock speed). I need it to generate delays between each assembly instruction of my program, and it wouldn't kill me if the delay isn't exact (say, if it depends on the OS scheduler, as it almost sure will). The goal is to make algorithms efficiency very explicit when programming not- that-heavy applications at school (having a 3GHz CPU makes it difficult to notice slow algorithms that run for little time and could be really optimized). Also, it could be useful for spotting race conditions in real time, maybe. Do you know of any such tool? Is there any kind-of-interpreter that I could hack to achieve this? Can gdb help me in a relatively easy way? I think it's the closest thing to controlling a Linux program execution I know. Running the hole system in a CPU capped VM could be another option, given it provides me that illusion - a lower speed CPU - but or would be best to run single programs.


title: How to password-protect a script on Linux?

text: How do you set a password to execute a command or script in Linux? I need to avoid a script (in which user and password details are included) from being used/executed from unauthorized users. So is there any way to set password to execute a particular script.


title: Linux: clnt_create: RPC: Program not registered

text: NFS mounts recently automatically got un-mounted. When I checked, the NFS service status it was shown to be running.               [root@hsluasrepo]# service nfs status     rpc.svcgssd is stopped     rpc.mountd (pid 4083) is running...     nfsd (pid 4148 4147 4146 4145 4144 4143 4142 4141) is running...     rpc.rquotad (pid 4079) is running...          [root@hsluasrepo]# service rpcbind status     rpcbind (pid  4203) is running...          [root@hsluasrepo common]# rpcinfo -p 10.80.3.154        program vers proto   port  service         100000    4   tcp    111  portmapper         100000    3   tcp    111  portmapper         100000    2   tcp    111  portmapper         100000    4   udp    111  portmapper         100000    3   udp    111  portmapper         100000    2   udp    111  portmapper      But `showmount` output was showing an error.               [root@hsluasrepo ]# showmount -e 10.80.3.154     clnt_create: RPC: Program not registered      After restarting the NFS service, `showmount` output displayed the NFS server's export list. Can anyone tell me the root cause of this issue and How to avoid this problem in future?


title: What is the IPV4_FAILURE_FATAL ifcfg directive and under what scenarios would I want to use it?

text: CentOS / RHEL 6 I recently learned that there's a ifcfg directive called `IPV4_FAILURE_FATAL` exists for use in the files located here: `/etc/sysconfig/networking- scripts/ifcfg-*`. But I'm having a difficult time finding information about it.   * What does it do?   * Under what circumstances would I ever want it set to "yes"?


title: How to add entry to right click menu?

text: I have CentOS 6 and i need Terminal a lot. i want to add an entry "Open Terminal to the menu when i right click on a blank space in my desktop. How can I do this?


title: GTK2, GTK3 or QT for LXDE optimized application

text: For developing an application optimized for LXDE, should you choose GTK2, GTK3 or QT? Most LXDE apps are currently using GTK2, but it looks like GTK2 is becoming dead and the LXDE developers are porting everything over to QT


title: GRUB won't boot, live CDs either

text: First, my computer crashed slowly, as if all the files were being deleted, then when I tried to reboot, GRUB just didn't show up. I also tried to boot on a live CD but it doesn't work either (yes, I've checked the boot order.) I suspect a HDD issue, yet I doubt it as live CDs don't work. What to do?


title: Backup or snaphot tool for ext4

text: I'm looking for a backup tool for ext4, which can take a copy from a running FS like /var with no collisions in system after recover such FS. I know BSD dump has an '-L' option, which tells him to work on a snapshot. But nor dump nor dumpe2fs from repositories have such option. I've read about a patchset for ext4 providing snapshot support, but replies about it are very different, so i'm here to ask about your experience with this patches.


title: can't access account with empty password

text: I used the `passwd` command to remove the password for my account. Now, when I try to use `su` to log in to my account, it won't let me enter an empty password. So now, I can't access my account. Any ideas on how to recover my account? I'm using _OSX 10.9 Mavericks_. I've read, after the fact, that since version _10.5_ , OSX does not allow empty passwords.


title: Why does agetty ask for the username itself?

text: From the man page: > agetty opens a tty port, prompts for a login name and invokes the /bin/login > command. It is normally invoked by init(8). But if you run login without any argument, it asks a username. So why not let login do the job of asking the username, instead of doing it inside agetty (also, if your login fails, _login_ will ask you your username again)? It just seems redundant to me. I thought agetty's only job would be to call login repeatedly (because login exits after a certain number of tries).


title: IBM Java Runtime Environment on CentOS

text: I need to install IBM's JRE, but I can't seem to find an appropriate download or guide to installing it on CentOS. I've found various zips, but none of them include an RPM and I have no idea where to start with the files contained inside the zips. If somebody knew of a guide and an appropriate download, as the developerWorks one seems to be down, it says that IBM Developer Works is currently down for maintenance. It seems to have been like this for quite some time, so I don't think IBM are going to fix it any time soon. Also, I'm downloading the IBM version to run a minecraft server, as I've hear that IBM's version consumes a lot less RAM and such.


title: Transactional UNIX shell for file system changes

text: It is easy to make a mistake when copying (cp), moving/renaming (mv), removing (rm/rmdir), creating dirs (mkdir), and changing file permissions (chmod). It would be nice to have a log to view before commit. Is there a tool to do these actions in a "transaction" and allow before/after diff and rollback? I know my question is very broad as there are a **huge** number of commands that could be supported. Even if the most basic actions were supported it would be helpful.


title: Netbeans on Linux Mint only starts when run with sudo

text: I've installed Netbeans directly from the oracle site (the 7.4 Release but also the 8.0 Release Candidate). I really want to install the least possible version, so the one in the apt repos's doesn't help me. I install Netbeans with my user account directly into my home directory, the installation is only usable for my user. I do this because it should be possible to code and deploy applications to tomcat or glassfish without starting netbeans as root. So my glassfish development server is also installed with my local user account. This is also an aspect why I don't like getting netbeans over apt, because it's hard to use this glassfish as a development server then (where is the webapp directory? where is the the config? Where are the logfiles? is it possible to quickly change the config then? I dont want my development server to start on system startup, it should only run when I am developing, and so on). The problem now is, that netbeans is installed and also the starters appear on my desktop, but when I double click them, the netbeans splash screen appears and then nothing happens. When I `sudo netbeans`, it works, but thats actually not a solution for me. It just points out, that this has something to do with permissions. So which permissions do I have to set, that I am able to run netbeans (and tomcat, and glassfish) with my everyday user account?


title: biggest possible number for sort -n

text: How to determine the "biggest number" so that sort -n will always put it at the end? I'm thinking of something along `Inf` in some languages but I'm not sure if anything like this exists for sort. * * * The background is that I'm sorting list of potentially non-existent paths by age so that   * existent go first, from newest to oldest,   * non-existent go last. I'm using decoration approach and trying to put penalty on those unborns:               INFINITY=99999999999999   # ...close enough, right?          age_of() {         if [ -e $1 ];         then             local ctime=$(stat -c %Z "$1" 2>/dev/null)             local now=$(date +%s)             echo $(($now - $ctime))         else             echo $INFINITY         fi     }          cat - \       | while read path;         do             echo "$(age_of $path) $path"         done \           | sort -n \           | cut -d\  -f 2-      but obviously the comment is pretty naive; it's just a matter of time when even 99999999999999 will _not_ be close enough. ;) So is there a better value for INFINITY?


title: Can Asterisk play sounds over a Marantz sound system?

text: We are running Asterisk 1.2 (working on an upgrade) and in another building have a Morantz sound system that is connected to the same subnet as Asterisk. Can I use Asterisk to play a wav file over the Morantz's speakers? My idea is to use a Cisco Port Adapter to convert the digital line into analog and then plug the analog into the RCA ports of the Morantz. (see my question on SuperUser about the RJ11 to RCA conversion) I've done this in a different building with a Viking ZPI-4 Paging Interface, and use a "5" tone to tell the interface that the incoming data is to be played over a certain speaker zone. Asterisk already knows how to play a bell tone. With the Viking setup, since I have an ip address on the Port Adapter for it, I originate a call from the port adapter and Asterisk basically calls up the Viking like it was a phone. The problem with the other building is that I don't have a Viking PA system rigged with speakers. Instead I have a Morantz. (It's actually hooked to a Control4, but I'm trying to get rid of the Control4 since the rep who admins it is never available and doesn't service us well). So I want to play the wav file over the speakers attached to the Morantz. But I am wondering that since the Morantz has a network connection (I can access it's web-interface), can I just send the sound directly over the Morantz? Any ideas in this regard are welcome.


title: Understanding `od -c` output

text: I've got a text file that I'm trying to debug an encoding issue in. I ran the file through `od -c` and got the following output:               3457540  ,   "   t   e   x   t   "   :   "   302 241   Q   u 303 251      My understanding from the man page is that -c "select[s] ASCII characters or backslash escapes." I guess I don't understand what a backslash escape is. I would have assumed it to be a C-string style escaped character, such as `\0` or `\n`. However, I'm getting values (302 and 303) that are clearly out of the range of a byte. Could somebody explain what's happening here?


title: Problem extracting email attachment using munpack

text: I have fetchmail running perfectly to fetch emails from Gmail, and then I am using procmail to store them in `$HOME/Mail/Inbox`. In my `.procmailrc`, I added this code which pipes to `munpack` to extract the attachment which can be a PDF or CSV file:               ATTACH=`echo $HOME/Mail/Inbox`      :0 c     * ^To:.*me@email.com     * ^From:.*me@email.com     | munpack -q -C $ATTACH      But I dont get any file in /var/tmp or anywhere else. Aslo if I use munpack manually in terminal I get the error of "Did not find anything to unpack from /Users/[username]/Mail/Inbox". Does anyone have any experience how to solve the problem?


title: private memory calculated by pmap, a combination of virtual memory size and resident memory size?

text: You can use the ps command to get the virtual memory size and the resident memory size of a process:               $ ps aux | grep apache2     USER       PID  %CPU %MEM  VSZ  RSS     TTY   STAT START    TIME    COMMAND     www-data 31141  0.0  0.3 163864 24008 ?        S    16:15   0:01 /usr/sbin/apache2 -k start      Now virtual memory and resident memory doesn't provide accurate precision of a process's true memory footprint, because it also factors in shared libraries. So a better solution is to use pmap to get the true memory usage of a process. So here is the output of pmap using the same process as above:               $ sudo pmap -d 31141     31141:   /usr/sbin/apache2 -k start     Address           Kbytes Mode  Offset           Device    Mapping     00007f85bbb82000      28 r-x-- 0000000000000000 0fc:00000 libnss_dns-2.15.so     ...     ...     mapped: 163864K    writeable/private: 28420K    shared: 592K      So the "writable/private" value is the private memory of the process, which is almost 28 mb. My question: Is this private memory only main memory (RAM) or does this number also include swap space possibly?


title: Fedora's command-not-found doesn't work

text: I've recently installed Fedora 19. Packagekit-command-not-found is installed. But its own examples don't work. When I enter `gedti` the output is:               bash: gedti: command not found... Similar command is: 'gedit'      And it works correctly but when I enter powertop, the output is:               bash: powertop: command not found...      With no suggestion about the package. Why? Should I edit some configuration files or update some cache or ... ?


title: Can I run emacs as server on Linux but attach from Windows?

text: I am able to run emacs as server daemon and attach back to it on Linux. Is it possible to start emacs as daemon on Linux, but attach back to it from Windows with a different client? Emacs or xemacs, both are okay. to be precise, I want to start a emacsclient windows client to connect to linux emacs server. so putty or exceed or screen is not precisely what I want to do. is it possible.


title: Why does this 'at' command not print to the standard output?

text: I am a relative Linux novice. I am trying to learn how to use `at` so that I can schedule tasks to begin at a later time, without using `sleep`. I have been looking at this previous question for help. My question is, in the following sample bash script that I have created, why is **"Running"** never -- as far as I can tell -- printed to the standard output (i.e., my bash console)?               #!/bin/bash          echo "Started"          at now + 1 minutes <<EOF     echo "Running"     EOF          echo "Finished"      The only output I see is, for example: > >     Started >     warning: commands will be executed using /bin/sh >     job 3 at Fri Jul 12 17:31:00 2013 >     Finished >   Is the answer to my question found in the warning? If so, how does `/bin/sh` differ from the standard output?


title: How to disable Emacs gnuclient warning on kill-buffer

text: When I run `M-x kill-buffer` for a buffer which was openend via `gnuclient`, I first get this prompt...               Kill buffer (default 'my-buffer-name'):       Then I get a second prompt/message...               Buffer 'my-buffer-name' belongs to gnuserv client(s); kill anyway? (yes or no)       How can I disable the second _gnuserv/client_ message? (I don't need it).


title: How to cache all internet downloads

text: I am currently running Ubuntu 12.04. How would I go about caching all downloads? And if Linux does not have this built in, then what are good tools for this? Please note that this isn't a browser related question, I want any program attempting to access the net to retrieve cached data instead. Also, I am not running a server; I want to do this with a single home PC.


title: Asking ls to only list files in a path that match a specific glob/regex

text: In Zsh: Is there a way to use `ls` to **only** list files and folders in the **current directory** that match a specific **globbing** or **regex** pattern? For example, say I have multiple files that start with the character `#`, the following command does **not** do what I want:               ls -l #*      I know I can do this with find, i.e. `find . "#*" -maxdepth 1 -print`, but I am looking for a solution that lists files and folders with permissions in `ls`. I presume that one way of doing this is by parsing the output of ls (but AFAIK this is usually not recommended).


title: Update jiffies value after waking up from suspend

text: The global variable `jiffies` holds the number of ticks that have occurred since the system booted. On boot, the kernel initializes the variable to zero, and it is incremented by one during each timer interrupt. But how the kernel updates this value after waking up from suspend? How the kernel calculates the time that it had conducted in suspend mode?


title: Recovering overwritten LVM metadata

text: Yesterday I was trying using the Debian install in rescue mode in order to fix my Grub (The menu-item for Debian was suddenly gone). Now I wasn't able to fix it and didn't have a lot of time, so I thought I'd just reinstall Debian (I know, windows style :P). Problem was that I had installed Debian using full disk encryption, thus within a LVM partition. For some reason the installer didn't recognize the volume groups, though I could mount them in rescue mode. I tried to set "use as lvm" and then select option "use current layout", but no volume groups were present anymore. Going back to rescue mode, executing a shell, I couldn't mount them anymore, as if they were gone. So somewhere along the way the metadata for the volume groups must have been overwritten. I did some googling, but hardly found anything on the specific subject of overwrittten metadata. I've tried running testdisk, but it seems that's only for recovering partitions, not volume groups. Last I could find was the output of pvck:               root@ubuntu:/home/ubuntu# pvck -d -v /dev/sda5         Scanning /dev/sda5       Found label on /dev/sda5, sector 1, type=LVM2 001       Found text metadata area: offset=4096, size=192512         Found LVM2 metadata record at offset=194560, size=2048, offset2=0 size2=0         Found LVM2 metadata record at offset=128512, size=66048, offset2=0 size2=0         Found LVM2 metadata record at offset=116224, size=12288, offset2=0 size2=0         Found LVM2 metadata record at offset=69120, size=47104, offset2=0 size2=0         Found LVM2 metadata record at offset=68096, size=1024, offset2=0 size2=0         Found LVM2 metadata record at offset=65024, size=3072, offset2=0 size2=0         Found LVM2 metadata record at offset=53248, size=11776, offset2=0 size2=0         Found LVM2 metadata record at offset=52736, size=512, offset2=0 size2=0         Found LVM2 metadata record at offset=51712, size=1024, offset2=0 size2=0      Now that does look like it found something right? But unfortunately I don't know enough about LVM's, so I have no idea how to use this information. Anyone who is able to guide me further? Extra information: output of pvscan:               root@ubuntu:/home/ubuntu# pvscan       PV /dev/sda5                      lvm2 [465.52 GiB]       Total: 1 [465.52 GiB] / in use: 0 [0   ] / in no VG: 1 [465.52 GiB]      I am testing on live Ubuntu 10.04 LTS 32-bit live-cd and I was trying to reinstall Debian Squeeze 64-bit. I am using a Acer Aspire laptop with intel i7 quad-core processor, 2x 1TB internal hard drives, ati Radeon HD 5600 Series videocard. (which is probably more information than needed :P).


title: Extracting lines by key from very large file

text: I have a 42M line text file. Th first nine characters of each line are a numeric key. What is the most efficient way to extract only the lines whose key exists in another list of about 1.5M keys? Both the file and the list of keys are sorted.


title: Proxy for certain networks

text: Is it possible, on a system using NetworkManager, to configure a system-wide proxy if I am in a certain wifi-network, but not otherwise? It would also need to log in to the proxy with a username and password.


title: Get default ubuntu motd in fish shell

text: I would like to have Ubuntu's MOTD in the fish shell. Ubuntu's default is as follows: ![Default Ubuntu MOTD](http://i.stack.imgur.com/dsldV.png) That is essentially what I would like to see when open up my terminal (terminator, which loads fishfish) As far as I can make out (Based on the information here), the default shell executes pam_motd, which in turn executes a bunch of scripts from /etc/update-motd.d I don't know how to do this in the fish shell with any confidence. I haven't been able to find any information by searching. Cheers


title: SSH encryption security

text: If I log in to my server through `ssh` and copy files to my local computer can I be eavesdropped? How do I make sure nobody can intercept the data or even know what I am copying? Are there levels of security in SSH?


title: How to create multiple zips from a directory containing a million xml files?

text: I have a directory containing million xml files. I want to create multiple zip files containing n number of xml files. For ex: if n = 10000, then I want to create 100 zip files i.e. each zip file will have only 10000 xml files. What is the most efficient way to create these zip files? I don't want this process to take more time since I have to repeat this operation for multiple folders having millions of xml files.


title: sudo chown -R $USER:admin /usr/local - revert back to ROOT?

text: On `OS X`, but may also apply to `*NIX`. This question was asked/answered previously, and I know it's safe to `chown` on `/usr/local` for my admin user account, which I've done to install `git` with `homebrew` (using `brew instal git`).               sudo chown -R $USER:admin /usr/local      Now I'm thinking I should change ownership back to _root_. Does it matter who owns `/usr/local`?


title: Get a list of the functions in a shared library?

text: How can I get a list of the functions defined in a shared object library, or find out if a particular function is defined in one?


title: How to grep for pipe |

text: How can I grep for line containing pipe character `|` or for character `>`:               files content:     |this is test     where is >     this is none      now what I need using grep command is               grep -iE "<some expression>" file_name      Output:               |this is test     where is >


title: Debian: Which firewall for a newbie?

text: I have to install a firewall on my server (so without X Server). It's a debian lenny. If it is possible, I want to avoid the use of `iptables`. Is there a way to install/configure a firewall for a newbie ?


title: how to work around APT's "Release file expired" problem on a local mirror

text: I have a local mirror (created with debmirror), and when I try to do a cache update (`apt-get update`) after a few days, I get this:               E: Release file expired, ignoring file:/home/wena/.repo_bin/dists/sid/Release (invalid since 14h 31min 45s)                                                        How do I work around that?


title: Is there a way to write a script to do ftp login so I don't have to type things over and over again?

text: I am recently working extensively with a remote system via ftp connection, since the session time is so short that I have to re-login quite often when I finish my work on my local machine, so I need a way to create a custom command/shell script to login to the ftp server with just one word, but the question is how to do it. e.g.               ~$ ftp domainname.com      ...      Name (domainname.com): MyName      ...      Password: xxxx      ...      ftp>


title: How do I set up dual monitor wallpaper (Ubuntu/NVIDIA)?

text: On Ubuntu 10.4 with NVIDIA drivers I have dual monitors setup with TwinView. How do I configure a single wallpaper to span both monitors? Right now the same wallpaper is replicated on both monitors.


title: Will files created under source directory after running `cp` be copied?

text: Suppose I use `cp` to copy a directory to another place. If the process takes long, and I create a new file under the source directory, will it be copied, or does it depend on something?


title: ipset accounting information

text: I know that iptables keeps accounting information for ip traffic blocked or passed. However, it appears that when using ipsets with iptables, the accounting information is aggregated for the entire set. Is there any way of finding accounting information for individual entries in an ipset being used by iptables?