samedi 31 janvier 2015

GUFW or Firestarter in Fedora


Physician using Fedora 21 - I have very limited knowledge of Linux. I cannot make sense of iptables in Fedora. I used Debian before but moved away from Debian in great disgust after I realized their default firewall accepted all incoming. Now I use Fedora 21 and would like to install GUFW or Firestarter. Can someone help?



Looking for effective alternative to ssh-copy-id which fails if you do not have the private part of the key?


To my surprise, I discovered that ssh-copy-id fails if you do not have the private part of the key, making it not usable for deploying someone else key.


I an looking for a reliable way to deploy these keys, so it must not create duplicate entries if you run it twice.



Fn key results in backslashes rather than brightness, etc


I recently upgraded from Ubuntu 14.04 to 14.10. On 14.04, the Fn key controlled bits and pieces such as mute, brightness, volume, lock touchpad, etc. all worked fine.


After the upgrade, they don't. Pressing the Fn key post-upgrade results in a backslash.


I've tried all the various options suggested elsewhere online to change grub's config:



GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux"


Suffice to say, none solve the issue.


I've since wiped Ubuntu and replaced it with Linux Mint 17.1, which I believe is based on Ubuntu 14.04, the version in which everything worked.


This leads me to believe there is some sort of setup/configuration setting which was wiped by the upgrade and is the default in Mint and in Fedora too, of which I tried a live CD.


Hardware Info: $ sudo dmidecode | grep -A3 '^System Information':



System Information
Manufacturer: Acer
Product Name: Aspire V3-771
Version: V2.08


At a bit of a loss with this.



Arch: libGL: screen 0 does not appear to be DRI3 capable


I've a problem with certain 32 bit game on 64 bit Arch Linux.


It looks like the problem lies in my 32 bit enviroment which cannot see my 64 bit NVidia drivers.


When I launch 64bit version of glxgears it works smoothly and there are no errors in console. 32 bit version is not smooth and console says:



$ LIBGL_DEBUG=verbose glxgears32
libGL: screen 0 does not appear to be DRI3 capable
libGL: screen 0 does not appear to be DRI2 capable
libGL: OpenDriver: trying /usr/lib32/xorg/modules/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib32/xorg/modules/dri/swrast_dri.so
libGL: Can't open configuration file /home/michal/.drirc: No such file or directory.
libGL: Can't open configuration file /home/michal/.drirc: No such file or directory.
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast


I was trying to google this problem but there are usually tips for Ubuntu which doesn't seem to be applyable on Arch.


I've installed some 32 bit libs: lib32-nvidia-utils, lib32-opencl-nvidia, lib32-mesa-libgl which seemed for me to be the missing ones (basing on Ubuntu's forums) but they didn't help



Why do I get mail when I unplug my adapter?


Usually I only get the terminal output You have new mail in /var/mail/$USER after running certain upgrades but I've started getting it every couple days after running other commands, seemingly at random. The new mail in /var/mail/$USER is always to akin to this:



Message-Id: <E1YHfKT-0008LI-2d@debianator>
From: root <root@debianator>
Date: Sat, 31 Jan 2015 22:11:45 +0100

Adapter 0: off-line


Note that it doesn't happen every time i plug put the AC adapter (thank God)!


I use a simple bash script (run by udev) to hibernate when battery is low and the AC adapter isn't connected. The script uses acpi to detect the latter and has been working for years without mailing me.


So what service could be mailing Adapter 0: off-line to me?


EDIT:


Below is the script I use to hibernate on low battery. On further inspection, I definitely think it's related. Note the if acpi -a | grep 'off-line' lines. When I run acpi -a | grep 'off-line I get the output Adapter 0: off-line. That is the exact output that is send to my mail - so how do I stop it?


Here is the script:



#!/bin/bash
# Critical battery level (acpi reports it at 5%)
CRITICAL=6

battery_level=`acpi -b | grep -o [0-9]*% | sed s/%//`
if [ ! $battery_level ]
then
exit
fi
if [ $battery_level -le $CRITICAL ]
then
if acpi -a | grep 'off-line'
then
# Warning
sudo -u andreas DISPLAY=":0.0" notify-send -u critical "Gimme power"
sleep 60s
if acpi -a | grep 'off-line'
then

sudo -u andreas DISPLAY=":0.0" notify-send -u critical "Shutting down"
sleep 2s
/bin/systemctl hibernate
fi
fi


"not a valid package archive" when trying to install PHP extension?


I'm running CENTOS 6.6 on a VPS and am trying to install the ZMQ PHP extension and tried installing using the command shown in the instructions:



sudo pecl install zmq-beta


However, it fails, showing this as the output:



root@host [/zmq]# sudo pecl install zmq-beta
downloading zmq-1.1.2.tgz ...
Starting to download zmq-1.1.2.tgz (39,573 bytes)
..........done: 39,573 bytes
could not extract the package.xml file from "/root/tmp/pear/cache/zmq-1.1.2.tgz"
Download of "pecl/zmq" succeeded, but it is not a valid package archive
Error: cannot download "pecl/zmq"
Download failed
install failed


I also tried:



sudo pecl install -Z zmq-beta


And:



sudo pecl install --nocompress zmq-beta


But I get the same error.


Why is this error occuring?



Resolving IP address to get Domain Name


How to make my server be resolved by IP address and get the domain name. For example: then Anyone can use:



resolveip <my-ip>


And get the output of my domain name; like www.xyz.com.



How can I access samba from windows 8?


I'm running samba on debian (Running on a BeagleBone Black), and I cannot access the share via Windows 8.1. It prompts me for a username/password as shown below, and won't authenticate me.


When it prompts for a username/password, it is the standard windows 8 prompt. I enter in "WORKGROUP\debian" for user which uses WORKGROUP as the domain. And then I enter my password and it fails.


I've tried experimenting with the smb.conf file to make the "downlaods" share accessible to guests but it still tried to authenticate me and denied me access.


My smb.conf file is as follows:



#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
# - When such options are commented with ";", the proposed setting
# differs from the default Samba behaviour
# - When commented with "#", the proposed setting is the default
# behaviour of Samba but the option is considered important
# enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic
# errors.
# A well-established practice is to name the original file
# "smb.conf.master" and create the "real" config file with
# testparm -s smb.conf.master >smb.conf
# This minimizes the size of the really used smb.conf file
# which, according to the Samba Team, impacts performance
# However, use this with caution if your smb.conf file contains nested
# "include" statements. See Debian bug #483187 for a case
# where using a master file is not a good idea.
#

#======================= Global Settings =======================

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = WORKGROUP

# server string is the equivalent of the NT Description field
server string = %h MDW BeagleBone

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
# wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.
dns proxy = no

# What naming service and in what order should we use to resolve host names
# to IP addresses
; name resolve order = lmhosts host wins bcast

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
; interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself. However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
; bind interfaces only = yes



#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m

# Cap the size of the individual log files (in KiB).
max log size = 1000

# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
# syslog only = no

# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.
syslog = 0

# Do something sensible when Samba crashes: mail the admin a backtrace
panic action = /usr/share/samba/panic-action %d


####### Authentication #######

# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
security = user

# You may wish to use password encryption. See the section on
# 'encrypt passwords' in the smb.conf(5) manpage before enabling.
encrypt passwords = true

# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.
passdb backend = tdbsam

obey pam restrictions = yes

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
pam password change = yes

# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
map to guest = bad user

########## Domains ###########

# Is this machine able to authenticate users. Both PDC and BDC
# must have this setting enabled. If you are the BDC you must
# change the 'domain master' setting to no
#
; domain logons = yes
#
# The following setting only takes effect if 'domain logons' is set
# It specifies the location of the user's profile directory
# from the client point of view)
# The following required a [profiles] share to be setup on the
# samba server (see below)
; logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
# (this is Samba's default)
# logon path = \\%N\%U\profile

# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
; logon drive = H:
# logon home = \\%N\%U

# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
; logon script = logon.cmd

# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe. The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u

# This allows machine accounts to be created on the domain controller via the
# SAMR RPC pipe.
# The following assumes a "machines" group exists on the system
; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u

# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe.
; add group script = /usr/sbin/addgroup --force-badname %g

########## Printing ##########

# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
# load printers = yes

# lpr(ng) printing. You may wish to override the location of the
# printcap file
; printing = bsd
; printcap name = /etc/printcap

# CUPS printing. See also the cupsaddsmb(8) manpage in the
# cupsys-client package.
; printing = cups
; printcap name = cups

############ Misc ############

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /home/samba/etc/smb.conf.%m

# Most people will find that this option gives better performance.
# See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/speed.html
# for details
# You may want to add the following on a Linux system:
# SO_RCVBUF=8192 SO_SNDBUF=8192
# socket options = TCP_NODELAY

# The following parameter is useful only if you have the linpopup package
# installed. The samba maintainer and the linpopup maintainer are
# working to ease installation and configuration of linpopup and samba.
; message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &

# Domain Master specifies Samba to be the Domain Master Browser. If this
# machine will be configured as a BDC (a secondary logon server), you
# must set this to 'no'; otherwise, the default behavior is recommended.
# domain master = auto

# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
; idmap uid = 10000-20000
; idmap gid = 10000-20000
; template shell = /bin/bash

# The following was the default behaviour in sarge,
# but samba upstream reverted the default because it might induce
# performance issues in large organizations.
# See Debian bug #368251 for some of the consequences of *not*
# having this setting and smb.conf(5) for details.
; winbind enum groups = yes
; winbind enum users = yes

# Setup usershare options to enable non-root users to share folders
# with the net usershare command.

# Maximum number of usershare. 0 (default) means that usershare is disabled.
; usershare max shares = 100

# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
usershare allow guests = yes

#======================= Share Definitions =======================

[homes]
comment = Home Directories
browseable = no

[downloads]
path = /media/Seagate/Downloads
comment = Downloaded Content
available = yes
valid users = debian
read only = no
browseable = yes
public = yes
writable = yes

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
read only = yes

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
directory mask = 0700

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# The following parameter makes sure that only "username" can connect
# to \\server\username
# This might need tweaking when using external authentication schemes
valid users = %S

# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; read only = yes

# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700

[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
; write list = root, @lpadmin

# A sample share for sharing your CD-ROM with others.
;[cdrom]
; comment = Samba server's CD-ROM
; read only = yes
; locking = no
; path = /cdrom
; guest ok = yes

# The next two parameters show how to auto-mount a CD-ROM when the
# cdrom share is accesed. For this to work /etc/fstab must contain
# an entry like this:
#
# /dev/scd0 /cdrom iso9660 defaults,noauto,ro,user 0 0
#
# The CD-ROM gets unmounted automatically after the connection to the
#
# If you don't want to use auto-mounting/unmounting make sure the CD
# is mounted on /cdrom
#
; preexec = /bin/mount /cdrom
; postexec = /bin/umount /cdrom


Pipes, how do data flow in a pipeline?


I don't understand how the data flows in the pipeline and hope someone could clarify what is going on there.


I thought a pipeline of commands processes files (text, arrays of strings) in line by line manner. (If each command itself works line by line.) Each line of text passes through the pipeline, commands don't wait for the previous to finish processing whole input.


But it seems it is not so.


Here is a test example. There are some lines of text. I uppercase them and repeat each line twice. I do so with cat text | tr '[:lower:]' '[:upper:]' | sed 'p'.


To follow the process we can run it "interactively" -- skip the input filename in cat. Each part of the pipeline runs line by line:



$ cat | tr '[:lower:]' '[:upper:]'
alkjsd
ALKJSD
sdkj
SDKJ
$ cat | sed 'p'
line1
line1
line1
line 2
line 2
line 2


But the complete pipeline does wait for me to finish the input with EOF and only then prints the result:



$ cat | tr '[:lower:]' '[:upper:]' | sed 'p'
I am writing...
keep writing...
now ctrl-D
I AM WRITING...
I AM WRITING...
KEEP WRITING...
KEEP WRITING...
NOW CTRL-D
NOW CTRL-D


Is it supposed to be so? Why isn't it line-by-line?



Hotkey for doing sudo suggestions


On Ubuntu and Debian, often if I try to run a program I will get a message that says something to the effect of:



You don't have that program. To get it type sudo -apt -get -install programName



(or some variation on that). Then I usually type exactly the command that was just suggested. Is there a hotkey that will automatically type the suggested command for me, e.g., I type something like "Alt-Up" and "sudo -apt -get -install programName" is automatically typed?


Thanks.



sed: read whole file into pattern space without failing on single-line input


Reading a whole file into pattern space is useful for substituting newlines, &c. and there are many instances suggesting the following:



sed ':a;N;$!ba; [commands...]'


However, it fails if the input contains only one line.


As an example, with two line input, every line is subjected to the substitution command:



$ echo $'abc\ncat' | sed ':a;N;$!ba; s/a/A/g'
Abc
cAt


But, with single line input, no substitution is performed:



$ echo 'abc' | sed ':a;N;$!ba; s/a/A/g'
abc


How does one write a sed command to read all the input in at once and not have this problem?



Parallella Board release date?


Does anybody know when the parallella board with 64 cores gets released? I cannot find any information or shop for buying it.


Would be really nice to know it..



How do I pass arguments to the shebang command when executing a script?


If I have my.script such as



#!/bin/bash

blah
blah


and say the bash command accepts a --verbose argument.


How do I execute my.script passing --verbose to bash?


I know I can do bash --verbose my.script on the command line, but I need to be able to run my.script directly.



Custom key combinations in dwm


I have some custom key combinations in config.h, which work great. I just got a 60% keyboard, and would like to config arrows to work vim like ¨hjkl¨, instead of the combination with FN key + arrows.


I tried to use xmodmap but if I define Muhenkan key as a Mode key, it will interfere with the usual behaviour of dwm (mod + J = previous window).


Is there any way I can define: keycode 102 (Muhenkan) + keycode 44 (j) = Down ? Thanks,



Route everything through VPN except SSH on Port 22


I have a Server and I want to setup a VPN on it to route all traffic.


Of course I dont want to block myself out when establishing the OpenVPN connection (already did that..) so I want the Port 22 to be unaffected and be reachable as usual.


Is this possible? And if so, how can I set this up?



What does .~/.bashrc command do?


I was viewing my .bash_profile file, and I saw this written inside a block of if statement:



if [ -f ~/.bashrc ]; then
. ~/.bashrc


Can someone explain what the second line is actually doing?



connman connections extremely flaky and slow


I'm trying to configure my system to be able to connect via either ethernet or wifi with connman. I was able to hotplug my ethernet with systemctl restart dhcpcd.service previously, but I'd like to get automatic wifi working.


After installing and enabling the connman.service, I can now connect over wifi and ethernet -- but both are extremely slow, and drop almost all connections. I've tried disabling dhcpcd.service but my problems persist. I checked, and I do have the correct wifi driver ath9k, and I'd assume my ethernet driver is correct because it worked perfectly before. DNS requests work just fine, which makes me think that something is interfering with my connection ... but what? I'm not running any other network services, to the best of my knowledge.



Intercept abd modify commands in bash scripts


I have some scripts and some commands in the scripts are like this


./executable arg1 arg2 .. argn


I want to change the above command to


LD_PRELOAD=/some/lib ./executable my_arg1 my_argn arg1 arg2 argn; some_other_command


One way to change the scripts, but I don't want to do that, instead I want to intercept those commands, change those commands and run them. How can I do that?



Install R package on Ubuntu


I'm using Ubuntu and I'm trying to install this package from http://ift.tt/1BJurN3‌​tation_2.0.1.tar.gz but I cannot see how to do it.



'chmod g+s' command


Hello I want to understand the role of the 'chmod g+s' command in unix.


I also would like to know what it does in this particular context :


cd /home/canard; touch un; chgrp canard .; chmod g+s .; touch deux ;


I understand all the commands roles except for 'chmod g+s' and I want to know the differences between the files 'un' and 'deux' resulting from this series of commands.


Thanks in advance, I'm a beginner in Unix.



Automaticaly rename new buffer in term-mode


In Emacs, let's create a buffer in term-mode with M-x term. The resulting buffer is named *terminal*. If one wants to create another buffer also in term-mode, one usually does M-x term again. However, this simply gets back to the first buffer. Therefore, one has to (1) rename the first buffer with M-x rename-uniquely, this buffer now being named *terminal*<2>, and (2) create the second buffer with M-x term, that buffer being named *terminal*.


Would there be a way instead to create another buffer in term-mode without renaming the first ones, so that the new buffer is automatically named *terminal<i+1>* where i is the number of already-existing buffers in term-mode?


ps: I started reading the introduction to programming in Emacs Lisp, in order to write in my .emacs my own function overloading M-x term, but I feel like any help will be much needed!



Why there is no automatic flag on automatically added libraries?


I'm running Debian Jessie, when I run aptitude I can see a lot of libraries not manually installed but without the automatic flag. So if I remove the main packages the dependent packages will stay.


aptitude screenshot


My question is why theses not manually installed packages are not marked with the automatic flag?


If needed, here is my /etc/apt/sources.list



deb http://ift.tt/LZG23Z testing main
deb-src http://ift.tt/LZG23Z testing main

deb http://ift.tt/A2rwP6 testing/updates main
deb-src http://ift.tt/A2rwP6 testing/updates main

deb http://ift.tt/LZG23Z testing-updates main
deb-src http://ift.tt/LZG23Z testing-updates main

#Added by myself
deb http://ift.tt/LZG23Z unstable main
deb http://ift.tt/LZG23Z experimental main


P.S.: The last two lines were added to obtain the last version of iceweasel.



How to lock screen for a terminal session?


as we could use xflock4 command to lock the screen (ask for a password to continue) in an X session; I need a similar way to lock the tty1 session. Is there any? (logout is not working when I call in a script.)



Manually patch glibc for Ghost on old CentOS 3 server


I need to patch glibc for the Ghost vulnerability on a CentOS 3.9 server. Yes, I really wish I could get rid of that old distro, but unfortunately that is not possible due to an old legacy application that will not work with later versions.


I am looking for the least painful way to properly patch this server.


Perhaps the easiest would be to build and prep the source from the SRPM + manually edit this source and then build binaries.


So I grabbed the SRPM and built the source from it:



wget http://ift.tt/1yTe1gJ
rpm -ivh glibc-2.3.2-95.50.src.rpm
rpmbuild -bp /usr/src/redhat/SPECS/glibc.spec


But what exact file(s) need patching?



[glibc-2.3.2-200309260658]# find . -exec grep -l gethostbyname {} \;


This yields 60 files. I believe the method to patch is gethostbyname2 in:



./resolv/gethnamaddr.c


Is this correct?


Before I start editing this method manually to try to fix the buffer overflow issue, does anybody have before-and-after source of a properly patched glibc to guide me?



Removing KDE from Fedora21, groupremove not working


I am trying to remove KDE from my Fedora 21 installation in favor of XFCE. I have tried a few different commands and neither of them work.



#yum groupremove "KDE Plasma Workspaces"


and also



#yum groupremove kde-desktop-environment --exclude=fedora-release\*


Both fail to find the kde group and remove it. I think it has something to do with the fact that I upgraded from fedora20 with fedup and used the non-product selection.



Rewrite module apache2 on openSUSE 13.2


I don't know exactly how apache2 configuration files work, so probably that's the problem. Maybe someone here could help me? My problem is that I have installed apache2 + php @ opensuse 13.2, I enabled rewrite and userdir modules but the links don't work and I get 404 error.


My part (I think interesting one) of /etc/apache2/default-server.conf looks like this:



DocumentRoot "/srv/www/htdocs"
<Directory "/srv/www/htdocs">
Options None
AllowOverride None
Require all granted
</Directory>

<IfModule mod_userdir.c>
UserDir public_html
Include /etc/apache2/mod_userdir.conf
</IfModule>


mod_userdir.conf file looks like this:



<IfModule mod_userdir.c>
UserDir disabled root
<Directory /home/*/public_html>
AllowOverride All
Options Indexes FollowSymLinks MultiViews

<Limit GET POST OPTIONS PROPFIND>
Require all granted
</Limit>

<LimitExcept GET POST OPTIONS PROPFIND>
Require all denied
</LimitExcept>
</Directory>
</IfModule>


And my .htaccess in ~/public_html looks like this:



Options FollowSymLinks
RewriteEngine On
RewriteBase /

RewriteRule ^404.html$ index.php?page=errors/404 [L]
... and so on.


The .htaccess is correct because links on webserver work. Once I get through a tutorial how to enable mod_rewrite on Ubuntu I just realized that in OpenSUSE it doesn't work.


Artur



What port uses my backportpackage or bzr?


I am working in a company what uses Ubuntu Precise on the desktops behind a proxy. The Proxy is available in /etc/environment and set as: http_proxy, https_proxy, ftp_proxy, no proxy and their uppercase versions.


So actually i have a problem with using some applications inside the Bash. If i'm using backportpackage (like backportpackage -s trusty -d precise fop) or bzr branch then just comes up a timeout.


Now i'm guessing that the programs trying to use an unsupported (from Proxies Firewall) Port. But if i can find out what port it uses, i can ask the Admins for opening the port.


May anyone can help with this?



Nvidia Proprietory Drivers for Linux Mint 17.1 (http://ift.tt/1BHPU9l)


My laptop has dual graphics (Intel + Nvidia GeForce 820M) and i'm finding it difficult to install Proprietory graphic card drivers for the GeForce.


Have tried many methods on Ubuntu 14.04, and they have ended up crashing my Lightdm.


Please specify with minute commands on how i can get my proprietory drivers installed as i am a noob with Terminal cmds :D


Any help is greatly appreciated!


Note: Using Linux Mint 17.1 (based on Ubuntu 14.04) System Info shows: Intel Corporation Haswell-ULT Integrated Graphics Controller



Execute command after inotifywait established watches


Inside shell script (test.sh) I have inotifywait monitoring recursively some direcotry - "somedir":



#!/bin/sh
inotifywait -r -m -e close_write "somedir" | while read f; do echo "$f hi"; done


When I execute this in terminal I will get following message:



Setting up watches. Beware: since -r was given, this may take a while!
Watches established.


What I need is to touch all files under "somedir" AFTER the watches were established. For that I use:



find "somedir" -type f -exec touch {}


The reason why is that when starting inotifywait after crash, all files that arrived during the time will be never picked up. So the problem and question is, how or when should I execute the find + touch?


So far I have tried to let it sleep few seconds after I call test.sh, but that doesn't work in long run when the number of subdirs in "somedir" will grow.


I have tried to check if the process is running and sleep until it appears, but it seems that process appears before all the watches are established.


I tried to change test.sh:



#!/bin/sh
inotifywait -r -m -e close_write "somedir" && find "somedir" -type f -exec touch {} |
while read f; do echo "$f hi"; done


But no files are touched at all. So I would really need a help...


Additional info is that test.sh is running in background: nohup test.sh &


Any ideas? Thanks



apt-get failed to find any updates for Debian squeeze



# ls -F /etc/apt/
apt.conf.d/ preferences.old sources.list trustdb.gpg trusted.gpg~
preferences.d/ secring.gpg sources.list.d/ trusted.gpg trusted.gpg.d/


# cat /etc/apt/sources.list
deb http://ift.tt/1A8DGsk oldstable main
deb http://ift.tt/1A8DGsk oldstable-updates main
deb http://ift.tt/A2rwP6 oldstable/updates main


# apt-get update
Hit http://ift.tt/1A8DJUX squeeze Release.gpg
Ign http://ift.tt/1A8DGsk squeeze/main Translation-en
Ign http://ift.tt/1A8DGsk squeeze/main Translation-en_US
Hit http://ift.tt/A2rwP6 squeeze/updates Release.gpg
Ign http://ift.tt/A2rwP6 squeeze/updates/main Translation-en
Ign http://ift.tt/A2rwP6 squeeze/updates/main Translation-en_US
Hit http://ift.tt/1A8DJUX squeeze-updates Release.gpg
Hit http://ift.tt/A2rwP6 squeeze/updates Release
Hit http://ift.tt/A2rwP6 squeeze/updates/main amd64 Packages
Ign http://ift.tt/1A8DGsk squeeze-updates/main Translation-en
Ign http://ift.tt/1A8DGsk squeeze-updates/main Translation-en_US
Hit http://ift.tt/1A8DJUX squeeze Release
Hit http://ift.tt/1A8DJUX squeeze-updates Release
Get:1 http://ift.tt/1A8DJUX squeeze/main amd64 Packages [6,527 kB]
Get:2 http://ift.tt/1A8DJUX squeeze-updates/main amd64 Packages [14 B]
Fetched 5,479 kB in 25s (213 kB/s)
Reading package lists... Done


# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


# dpkg -l libc6 | grep libc6
ii libc6 2.11.3-4 Embedded GNU C Library: Shared libraries


# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 6.0.10 (squeeze)
Release: 6.0.10
Codename: squeeze


# w3m -dump http://ift.tt/1zoymOG | grep '2.11.3-4+deb6u4_amd64'
libc-bin_2.11.3-4+deb6u4_amd64.deb . . . . . . . . . Jan 28 01:26 732K
[ .. snipped ..]


Any insights?



Using options with :tabe in vim


I have a file open in Vim.


I'd like to open another file in a tab, using the :tabe command. However, I'd also like to open this file with the -M option, in order to avoid modification and writing of the file. I tried to use the following command in vim:



:tabe -M filename


However, that did not work. How can I achieve this?



Install libapache2-mod-fastcgi on Cubietruck (Debian 7.8)


I'm new in the Linux world, but I wanted to install Seafile 4.0.1 on my Cubietruck (Cubieboard 3) with Apache2 and MySQL using these two tutorials:



I ran into a problem as I wanted to install libapache2-mod-fastcgi, but the package was not found. I added the non-free repos in the sources.list file. Didn't help.


Instead I installed libapache2-mod-fcgi and continued with the tutorial. At the point when I had to restart the apache2 server, the error Invalid command 'FastCgiExternalServer occured.


Any help to solve this problem, did I anything wrong?


Some more information:


It's running on Debian 7.8 and uname -a gives output below:


Linux cubietruck 3.4.79 #3 SMP PREEMPT Wed Nov 12 11:39:10 CST 2014 armv7l GNU/Linux



UDP Tunnel via SSH Confusion


Overview:


I have a software program which communities on UDP port 1046 and I am hoping to hook two computers together.



  • Laptop (Required to ALWAYS have VPN connection)

  • Desktop (Public ip address)


Where I am:


I've seen various bridging tutorials but they seen to involve one computer serving as a proxy and not a direct bridge between the two systems. I have successfully managed to create a TCP bridge and I'm assuming its not too much harder to force the UDP traffic across that bridge


TCP Tunnel


On the "laptop" I run



ssh -N -L *:24804:localhost:24804 -R:24804:desktop:24804 user@desktop


which I believe creates a 2-way tunnel on the machines between TCP port 24804


I tried socat udp-listen:1046,reuseaddr,fork tcp:localhost:24804 but when I launched my software it gave me an error that port 1046 was already in use


Is there a simple next step I'm completely missing here?


Thanks!



How to install Php5 auth Pam on Ubuntu Trusty 14.04?


Assuming i'm still a noob in unix & linux, i'm asking here as I can't find the answer on the web. I'm trying to install php5-auth-pam on ubuntu 14.04, but package doesnt exist after ubuntu 12.04.


I've tryed by downloading package here : http://ift.tt/15Uvajh


I've done things like : dpkg -i php*.deb apt-get install -f


But I can't match dependancies, and i don't know how to install them too. Can anyone help me ?


Thanks !



Windows 8.1 not showing up in GRUB bootloader after installing Linux Mint 17.1 on partition


my system drives are based on these hardware parts


1: SSD 250 GB

2: HDD 1TB

3: External HDD 2TB


I use my SSD for Windows 8.1 and all other related stuff, like, installing software etc. The HDD is used for installing games on it, and the external HDD is, well, just an external HDD.


So what I wanted to do is, to install Linux Mint 17 next to Windows 8.1 Since I heard there might be problems with machines that run with UEFI, I searched for a tutorial to do it right.


I used this tutorial here. I shrunk my SSD by 60GB, started Linux Mint from USB and installed it.


According to the tutorial, I divided the free space into three parts



SWAP -> 4GB
EXT4 in path / -> 20GB
EXT4 in path /home -> 36GB


The tutorial said, I should install the bootloader in the partition that says efi. However, there was no such partition, so I created one by my own from the rest of the unused space I had. (Maybe, this was the problem)


I then installed Linux Mint, and can now use it without any problems. However, I can't get back into Windows 8.1.


When the computer starts and I hit F8 to select boot device, and I select the SSD where Win 8. is, I get the error message



This is not a bootable disk. Please insert a bootable floppy


Some people told me, that I need to select Win 8 out of the grub loader and not out of the device selector.


When I pressed ESC repeatedly the grub loader showed up, but only Linux Mint was in it.


What I then did, was the following: I booted into the live cd again (with USB Stick) and performed these commands



sudo add-apt-repository ppa:yannubuntu/boot-repair &&
sudo apt-get update &&
sudo apt-get install -y boot-repair &&
boot-repair


However, the only thing this did, was that I now have "Ubuntu" instead of Linux Mint in the bootloader, why so ever.


Then, I tried to update grub. This is the output



sudo update-grub2
[sudo] password for tzfrs:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.13.0-44-generic
Found initrd image: /boot/initrd.img-3.13.0-44-generic
Found linux image: /boot/vmlinuz-3.13.0-37-generic
Found initrd image: /boot/initrd.img-3.13.0-37-generic
No volume groups found
Adding boot menu entry for EFI firmware configuration
done


I also tried update-grub instead of update-grub2


This is my grub configuration file



# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"


Then, I tried to add it manually, by following this tutorial, but I'm already stuck at Step 1 where I should find my EFI partition with this command



sudo parted /dev/sda print | grep -i efi


However, there is no output. I also changed /dev/sda to something else, but still nothing. When I type in df -aTh I don't even see anything called EFI. So, where exactly is this efi thingy so I can continue this tutorial?


This is the ouptut of df -aTh



Filesystem Type Size Used Avail Use% Mounted on
/dev/sdb6 ext4 19G 6,8G 11G 40% /
proc proc 0 0 0 - /proc
sysfs sysfs 0 0 0 - /sys
none tmpfs 4,0K 0 4,0K 0% /sys/fs/cgroup
none fusectl 0 0 0 - /sys/fs/fuse/connections
none debugfs 0 0 0 - /sys/kernel/debug
none securityfs 0 0 0 - /sys/kernel/security
none efivarfs 0 0 0 - /sys/firmware/efi/efivars
udev devtmpfs 7,8G 12K 7,8G 1% /dev
devpts devpts 0 0 0 - /dev/pts
tmpfs tmpfs 1,6G 1,6M 1,6G 1% /run
none tmpfs 5,0M 0 5,0M 0% /run/lock
none tmpfs 7,9G 21M 7,8G 1% /run/shm
none tmpfs 100M 12K 100M 1% /run/user
none pstore 0 0 0 - /sys/fs/pstore
/dev/sdb7 ext4 36G 1009M 33G 3% /home
binfmt_misc binfmt_misc 0 0 0 - /proc/sys/fs/binfmt_misc
systemd cgroup 0 0 0 - /sys/fs/cgroup/systemd
gvfsd-fuse fuse.gvfsd-fuse 0 0 0 - /run/user/1000/gvfs
/dev/sdc1 vfat 30G 1,5G 28G 6% /media/tzfrs/KINGSTON


So, does anyone know, how I can get Windows 8.1 again into my bootloader? I can see the SSD partition with Windows in Linux Mint, so it's def. still there.



How To Change Scrollbar Action In GNOME 3.10


I am using Ubuntu GNOME 14.04 which includes GNOME 3.10.


I would like to change the default method / action xwindows takes when I click on a scrollbar above or below the slider.


Currently it moves to the position in the file / object that corresponds to the point on the slider where you clicked. IMHO, this makes the slider button redundant.


I would prefer that the window behave as though I have hit page up or page down on my keyboard.



Why doesn't set -x work within eval within a function?


I ran into an issue trying to dynamically set some variables based on output of a program, in a fish function.


I narrowed my issues down to a MWE:



function example
eval (echo 'set -x FOO 1;')
end


calling:



>example
>echo $FOO


results in no output -- ie the FOO environment variable has not been set. How should I have done this?



Stretch window over two monitors with "gap" in between


I have a dual monitor setup with Compiz as window manager on Ubuntu 14.04. I can resize a window to stretch over both windows. However, while the physical display panels are a few centimeters apart, the software by default thinks of them to be right next to each other without a gap in between. This means, e.g. a diagonal line ends up looking like this:



+----------+ +----------+
| | | / |
| | | / |
| | | / |
| | |/ |
| /| | |
| / | | |
+----------+ +----------+


What I'd like to achieve is something more like this:



+----------+ +----------+
| | | / |
| | |/ |
| | | |
| | | |
| /| | |
| / | | |
+----------+ +----------+


This would result in part of the window being hidden, but that's acceptable.


I can make X regard the displays to have a gap in between as follows:



$ xrandr
Screen 0: minimum 320 x 200, current 2048 x 1280, maximum 32767 x 32767
LVDS1 connected (normal left inverted right x axis y axis)
1366x768 60.0 +
1360x768 59.8 60.0
1024x768 60.0
800x600 60.3 56.2
640x480 59.9
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)
HDMI2 connected primary 1024x1280+0+0 left (normal left inverted right x axis y axis) 376mm x 301mm
1280x1024 60.0*+ 75.0
1280x960 60.0
1152x864 75.0
1024x768 75.1 70.1 60.0
832x624 74.6
800x600 72.2 75.0 60.3 56.2
640x480 75.0 72.8 66.7 60.0
720x400 70.1
HDMI3 connected 1024x1280+1024+0 right (normal left inverted right x axis y axis) 376mm x 301mm
1280x1024 60.0*+ 75.0
1280x960 60.0
1152x864 75.0
1024x768 75.1 70.1 60.0
832x624 74.6
800x600 72.2 75.0 60.3 56.2
640x480 75.0 72.8 66.7 60.0
720x400 70.1
DP2 disconnected (normal left inverted right x axis y axis)
DP3 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
$ xrandr --fb 2184x1280
$ xrandr --output HDMI3 --pos 1160x0


At first sight, this seems to work perfectly – when I move the mouse in a diagonal line across the gap between the monitors, it disappears "behind" the monitor bezels and re-appears where I'd expect the diagonal line to continue.


However, I can no longer move or resize a window to stretch across both monitors. Neither the mouse nor wmctrl seem to be able to do that.


Is there a way to achieve what I want?



How is This Symbolic Link Not Being Followed?


I have LibreOffice Writer and OpenOffice Calc installed on my OpenSuSE system. This is arguably not ideal, but before I fully switch to one or the other, I noticed some strange behaviour when calling oocalc file.ods from the command line.



user@host:~> ooffice -calc
Warning: -calc is deprecated. Use --calc instead.
user@host:~> oocalc
Warning: -calc is deprecated. Use --calc instead.
user@host:~> which oocalc
/usr/bin/oocalc
user@host:~> readlink -f `which oocalc`
/opt/openoffice4/program/scalc
user@host:~> /usr/bin/oocalc
Warning: -calc is deprecated. Use --calc instead.
user@host:~> ls -lth /usr/bin/oo*
lrwxrwxrwx 1 root root 30 Jan 30 17:32 /usr/bin/oocalc -> /opt/openoffice4/program/scalc
-rwxr-xr-x 2 root root 55 Dec 19 18:06 /usr/bin/ooffice
-rwxr-xr-x 2 root root 66 Dec 19 18:06 /usr/bin/oofromtemplate
-rwxr-xr-x 2 root root 60 Dec 19 18:06 /usr/bin/ooweb
-rwxr-xr-x 2 root root 63 Dec 19 18:06 /usr/bin/oowriter
user@host:~> readlink -f `which oocalc`
/opt/openoffice4/program/scalc
user@host:~> /opt/openoffice4/program/scalc


The last of the above commands runs OpenOffice Calc as expected. When oocalc or ooffice -calc is executed it prints the deprecation warning and then actually opens LibreOffice writer, as its spreadsheet counterpart isn't installed. My question, though, is how is it possible for oocalc to resolve correctly to the symbolic link but not follow it, and execute ooffice -calc instead?


EDIT: The contents of /opt/openoffice4/program/scalc are as follows:



cmd=$(cd `dirname $0` && pwd)/soffice
exec "$cmd" -calc "$@"


Home directory doesn't shown whenever I login through new username


I trying in Ubuntu server Virtual machine, created new user (testuser) using useradd command. Now my problem is want to create a home directory for that new user and root privileges for that user. And whenever I login through new user it doesn't show home folder.



Snort PCAP file analysing doesn't write to alert file


I'm using snort in my ubuntu 14.04 virtual machine. This is how I installed snort.



sudo apt-get update
sudo apt-get install snort


I haven't change /etc/snort/snort.conf or rules file. They remain as the default and I did PCAP reading using following command.



sudo /usr/sbin/snort -d -l /var/log/snort -c /etc/snort/snort.conf -r /home/navarathna/Downloads/cap2.pcap


The PCAP file is successfully read and a snort.log file is created, but the size of that file is 0 bytes. When I installed snort, there was no alert file in /var/log/snort directory. So I created one and gave owner permission for snort as following.



sudo chown snort.snort alert


After the PCAP reading, both snort.log and alert files have no content (Although the snort.log modified date changes to the last read date and time). Their sizes are 0 bytes. What am I doing wrong here?? Do I need to do some additional changes for rules/snort.conf files?



Mapping mouse buttons with udev hwdb


Following this guide: http://ift.tt/1t0IU1h


I've set up a config file:



$ lsusb | grep G500
Bus 006 Device 007: ID 046d:c068 Logitech, Inc. G500 Laser Mouse
$ cat /etc/udev/hwdb.d/70-g500.hwdb
keyboard:usb:v046DpC068*
KEYBOARD_KEY_90009=9
KEYBOARD_KEY_9000a=8
KEYBOARD_KEY_90006=0


Based on the following evtest output:



Event: time 1422711060.272136, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90009
Event: time 1422711060.272136, type 1 (EV_KEY), code 280 (?), value 1
Event: time 1422711060.272136, -------------- EV_SYN ------------
Event: time 1422711060.432134, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90009
Event: time 1422711060.432134, type 1 (EV_KEY), code 280 (?), value 0
Event: time 1422711060.432134, -------------- EV_SYN ------------
Event: time 1422711061.461191, type 4 (EV_MSC), code 4 (MSC_SCAN), value 9000a
Event: time 1422711061.461191, type 1 (EV_KEY), code 281 (?), value 1
Event: time 1422711061.461191, -------------- EV_SYN ------------
Event: time 1422711061.628125, type 4 (EV_MSC), code 4 (MSC_SCAN), value 9000a
Event: time 1422711061.628125, type 1 (EV_KEY), code 281 (?), value 0
Event: time 1422711061.628125, -------------- EV_SYN ------------
Event: time 1422711062.725119, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90006
Event: time 1422711062.725119, type 1 (EV_KEY), code 277 (BTN_FORWARD), value 1
Event: time 1422711062.725119, -------------- EV_SYN ------------
Event: time 1422711062.902137, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90006
Event: time 1422711062.902137, type 1 (EV_KEY), code 277 (BTN_FORWARD), value 0


And yet I get no keypresses (Or change in evtest output) when I'm done.


(Yes I've done udevadm hwdb --update/trigger)



Suspend button does not work when xscreensaver is active on xfce Debian


I've Debian jessie and xfce. When I push the power button, my system is suspended. When I press any key on my keyboard the system wake up and I get the login prompt of Xscreensaver (screen lock is active). Now if I push the power button the system does not suspend, I must login and then I can suspend the system with the power button. Is there a way to suspend the system from the login screen of Xscreensaver?



wine not recognizing my controller


I installed my real flight airplane simulator on Linux Mint 17 without any trouble using wine. However, it won't recognize my control. How do I get it to find and use it?



Compiling LibSSH2 with specific LibSSL


I have downloaded and compiled the latest version of libssl, the result of which is located at /usr/local/ssl. I want to compile libssh2 using the files in this folder, and to do that I've set the switch --with-libssl-prefix=/usr/local/ssl.


After performing ./configure --with-libssl-prefix=/usr/local/ssl and make, the resulting libssh2.so, according to the output of ldd, depends on the libssl found in the /usr/lib64, which is exactly what I don't want.


What can I do to force libssh2 to be compiled with the libssl I have in /usr/local/ssl?



AV Linux as main OS. Computer wont accept bootable USB


I am trying to install and run AVLinux through the downloadable .iso image from the website.


I created a standard startup disk with the standard creator in 14.10 all went well.


However my laptop does not detect the Startup disk I created as a Bootable disk upon restarting the system.


My question is simple.


Has anyone out there had this problem and how did they get around it?


(admins, if you have suggestions for more tags id love to hear them)



How to restrict/cut power output to a USB client?


...or, how not to charge my phone when I'm using it as a GSM modem in USB tether mode?


I can use it as WiFi tether modem, but it wastes battery both of the netbook it supplies connectivity to, and on the phone side. In USB tether mode I would avoid the power-hungry WiFi connection, but instead the phone wrecks the netbook battery by charging from it. I'd like to be able to maintain the data connection while disabling or restricting the current fed over the power lines; let the phone and the netbook use their own batteries without draining each other.


I'm using Kubuntu 14.10 but any system solution is okay, I'm sure I'd be able to adapt it. Even hardware solutions would be okay - cut the power line in the USB cable or solder a large resistor in maybe? Would that work?



When running some X prog. remotely with ssh -X, it says "libGL error: failed to load driver: r600"


OS: CentOS Linux release 7.0.1406 (Core) Kernel: 3.10.0-123.8.1.el7.x86_64


When I run xcrysden (http://ift.tt/1Ew5ZCC) remotely through ssh -X, it crashes with error: "libGL error: failed to load driver: r600 libGL error: Try again with LIBGL_DEBUG=verbose for more details."


But this happens only in ssh session. The program runs well locally.


The crash happens for only some programs but not all. I can run X programs such xterm, gnome-terminal, evince ... with ssh normally. But when I run glxgears or glxinfo through ssh, it gives the same error.


$ LIBGL_DEBUG=verbose glxinfo name of display: localhost:12.0 libGL: OpenDriver: trying /usr/lib64/dri/tls/r600_dri.so libGL: OpenDriver: trying /usr/lib64/dri/r600_dri.so libGL error: failed to open drm device: No such file or directory libGL error: failed to load driver: r600 libGL: OpenDriver: trying /usr/lib64/dri/tls/swrast_dri.so libGL: OpenDriver: trying /usr/lib64/dri/swrast_dri.so


Does anyone know how to solve this problem?



read first element in array



defaults read -g AppleLanguages


produces something like this:



(

en,

de

)



I'd like to extract just the first element, in this case "en",



defaults read -g AppleLanguages | awk '/\(/ , /,/'


but awk always includes the search patterns. What can I do to produce just "en"?



Unable to boot Linux Mint or WIndows anymore


I've spent the last two days trying to get my computer working. It's a dell inspiron 15r se.


I have windows 7 Professional edition installed and Linux Mint


I've tried the recovery disk for windows and that just leaves me with a boot loop and a blue screen of death.


On the linux side I've tried using boot-repair ( http://ift.tt/160sIY9 ) but I still just get a no operating system message when trying to boot from the Hard Disk.


Here is the output of my Partition info etc from Boot-repair: http://ift.tt/1HpGlBH


If anyone can point me in the right direction I'd be so greatful.


Cheers


joolz



vendredi 30 janvier 2015

bash/svn how to filter documents [on hold]


Does anyone know how to filter documents. For example, if I had something like this:



dVa/Prs/Upe/dVar.var


I want to only the last file in log and then add to this file another for example after filter I have list of files:



das.rar
tyii.po
wrt.sdf


and must want add path to this :



ofc/pc/Catalog/das.rar
ofc/pc/Catalog/tyii.po
ofc/pc/Catalog/wrt.sdf


I must do this in SVN.*/


Hmm, I did the first part of my task but now I must add values from folders like PATH and revision number to database. I have



insert into status(ticket,environment,path,revision,developed,component,change_type)
values (0, 'OFSTST', 'INSERTFM','RRR','1','OFS','A');


and I must add for INSERTFM my path from the file which looks like http://ift.tt/1ydggw5 and for RRR must add this number 2222. I have a list and a part of code which look like



cat listofmyfiles | { while read FPATH REVN; do
cp FPATH REVN
mv INSERTFM FPATH
mv RRR REVN


and don't know what next. Sorry for English.



Remote terminal application


Does anyone know if there exist an application which allows admin run other apps in kind of desktop environment. What i mean is a kind of VNC application which only gives user the terminal console, but when user disconnects, the daemon will be still running, so for example:



  • User connects to server and to the daemon.

  • In this daemon console user runs mc starts copying a big file

  • User disconects and connects again.

  • The mc is still performing the copy of some big file etc.


I know that nohup allows to run app without in/out stream but one cannot "reconnect" to working process.



Installing kernel headers (prior to `make install_headers`)


I'm trying to accomplish this



make ARCH=x86_64 INSTALL_HDR_PATH=/opt/cross/x86_64-linux headers_install


But with the 2.6.9 kernel tarball. It does not support the make target headers_install and I'm relatively new to this. What do I do? What does headers_install actually do?


I'm trying to build a cross compiler for this particular version but I am also running everything on a CentOS 4.8 64-bit (that happens to run 2.6.9, specifically 2.6.9-89) can I copy the headers from the host?



Compile static tmux with libutempter support


I'd like to fix issue for tmux when it can't report username via logname:



logname: no login name

I'm using steps below:



# lets assume all other prerequisites are compiled already
# and staged/installed to $HOME/opt

# libutempter (http://ift.tt/15VAiTW)
# URL : http://ift.tt/1z7FqAt
tar xvfj libutempter-1.1.5.tar.bz2
cd libutempter-1.1.5
vi Makefile
grep 'DESTDIR =' Makefile
---
DESTDIR = /home/xxxxxx/opt

make
make install

# tmux (http://ift.tt/uMygmv)
# URL : git://git.code.sf.net/p/tmux/tmux-code
git clone git://git.code.sf.net/p/tmux/tmux-code tmux
cd tmux
sh autogen.sh

CFLAGS="-I$HOME/opt/include -I$HOME/opt/usr/include -I$HOME/opt/include/ncurses" \
CPPFLAGS="-I$HOME/opt/include -I$HOME/opt/usr/include -I$HOME/opt/include/ncurses" \
LDFLAGS="-L$HOME/opt/lib -L$HOME/opt/include/ncurses -L$HOME/opt/include -L$HOME/opt/usr/lib" \
./configure --enable-static

CPPFLAGS="-I$HOME/opt/include -I$HOME/opt/usr/include -I$HOME/opt/include/ncurses" \
LDFLAGS="-static -L$HOME/opt/include -L$HOME/opt/usr/include -L$HOME/opt/include/ncurses -L$HOME/opt/lib -L$HOME/opt/usr/lib" \
make

But tmux still can't report login name via logname :(


And i can't install packages (no root access).


UPDATE: Jan 30, updated env vars and flags, ldd reports no shared libs, but tmux still can't show login name via logname :(



What are the ramifications for remapping ^D in zsh?


I typically use CtrlD to log off remote systems, but this doesn't allow .zlogout to run. I can remap CtrlD to exit via bindkey, but I'm not sure whether there might be other ramifications other than just exiting the shell. Are there reasons why I shouldn't do this?



Can a systemd dependency be applied only to a unit's "ExecStart" action?


I have a scenario where a number of storage volumes are encrypted using keys contained on a removable encrypted USB "keyring" flash drive. I am running Arch Linux and this question is about systemd dependency configuration.


The system is configured so that, as long as the keyring is present, the system boots and the volumes are mounted. The keyring passphrase is manually entered during boot.


I want to be able to remove the USB keyring once the system is up, However, I am having problems with this because systemd unmounts everything.


Here is an example of what I have done. First, /etc/crypttab



# <name> <device> <password> <options>
keyring PARTLABEL=keyring none noauto
abc /dev/lvm/abc /root/keyring/abc.key header=/root/keyring/abc.hdr
xyz /dev/lvm/xyz /root/keyring/xyz.key header=/root/keyring/xyz.hdr




  • I am using a recent Git checkout of systemd that supports the header option; it was added to the code-base on January 8th.




  • I am using the partition label of the keyring because there are multiple physical keyrings for backup/convenience reasons. They may have different UUIDs but are setup with the same PARTUUID.




  • I am using noauto so the keyring is only a dependency of any devices that need to be decrypted.




Next is /etc/fstab:



# <file system> <dir> <type> <options>
/dev/mapper/keyring /root/keyring ext4 ro,noauto
/dev/mapper/abc /srv/abc ext4
/dev/mapper/xyz /srv/xyz ext4


Again, the keyring is noauto so mounting only occurs due to it being a dependency. Also, it's mounted read-only so that it's safe to just pull it out.


Now, to create the dependency between the volume and the keyring, I have used a drop-in override, for example:



# /etc/systemd/system/systemd-cryptsetup\@abc.service.d/override.conf
[Unit]
Requires=root-keyring.mount


That all works fine for start-up. The problem is that removing the keyring stops the units that are dependent on it. I don't want this to happen - the dependency is only required to make the keys and headers accesible while the encrypted volumes are unlocked. Once unlocked, the keys and headers are no longer required.


So, my question is to ask how can I arrange a dependency on the keyring that only exists for the duration of the "ExecStart" command in the systemd-cryptsetup@.service unit ?


Alternatively, if this is the wrong approach, any improved solutions would be welcome.



Initialise USB devices before hard disks during grub2 boot


I have a CentOS installation on a portable USB stick, with a grub2 installation on it's first partition. The system can boot when there are no internal hard drives plugged into a machine, but fails if any hard drive is plugged in.


I want my OS, running off the USB stick, to be mounted as /dev/sda, and any other internal hard drives to be labelled from /dev/sdb. I am using partition labels to map to my /boot, /root, /home and /swap. It seems the internal drive appears as sda, so I run into a kernel panic on boot.



lsblk -f
NAME FSTYPE LABEL
sda
|___sda1
sdb
|___sdb1 hfsplus DISK_1
|___sdb2 ext4 USB_root
|___sdb3 ext4 USB_home
|___sdb4 swap USB_swap


I have udev rules for internal drives to be numbered from /sdb onwards, but it appears that these rules are applied later in the boot sequence, so the internal disk which should be sda is initialised as sdb.



  • Is it possible to have an external USB drive boot initialise as sda before any internal drives?

  • Should I just map my USB device and grub config to something like /sdu so it does not conflict with internal drive naming?



Looking for effective alternative to ssh-copy-id which fails if you do not have the private part of the key?


To my surprise, I discovered that ssh-copy-id fails if you do not have the private part of the key, making it not usable for deploying someone else key.


I an looking for a reliable way to deploy these keys, so it must not create duplicate entries if you run it twice.



Keyboard Shortcut for Applications Menu Extension Possible?


I am new to linux, Ubuntu, and GNOME. I am running Ubuntu GNOME 14.04 which comes with GNOME 3.10. I am using the Applications Menu extension from gnome-look.org. I would like to create a keyboard shortcut to open the menu.



Unix: Add unique names after signs in text


I have a file looking like the following:



abcdefghijklmnopqrst
//
abcdefghijklmnopqrst
//
abcdefghijklmnopqrst


I use the following code to insert a line with // to the beginning of the document (as advised here: Adding text to beginning of text file), and save this update to a new file.



sed '1s/^/\/\/\'$'\n/' File_1.txt > File_2.txt


What I would like to do, however, is to add unique names after each //, getting a result like this:



// Text 1
abcdefghijklmnopqrst
// Text 2
abcdefghijklmnopqrst
// Text 3
abcdefghijklmnopqrst


etc.


I was thinking I could use tr to translate eg. "//" into "// Text 1". But how do I add Text 2 to the next //, text 3 to the third // etc.? I am complete newbie at this. The txt file is mac-osx made.


UPDATE:


Your solution looks good, @PM 2Ring, however, I have the addiditional problem, that the file actually looks like this:



//
abcdefghijklmnopqrstu
// x x
abcdefghijklmnopqrstu
// x x
abcdefghijklmnopqrstu


So the name is perfectly inserted in first line, but after the secons pair of /, the name is inserted after x, at the end of the line. I need to insert the name just after //, but without shifting the remaining text to the right. Is it possible to delete the same amount of spaces, as the there are characters in the name? This should then not be done in the first line, of course, as I assume this would delete characters from the second line.



How can I kill a process and be sure the PID hasn't been reused


Suppose, for example, you have a shell script similar to:



longrunningthing &
p=$!
echo Killing longrunningthing on PID $p in 24 hours
sleep 86400
echo Time up!
kill $p


Should do the trick, shouldn't it? Except that the process may have terminated early and its PID may have been recycled, meaning some innocent job get a bomb in its signal queue instead. In practice this possibly does matter, but its worrying me nonetheless. Hacking longrunningthing to drop dead by itself, or keep/remove its PID on the FS would do but I'm thinking of the generic situation here.



How to unmask an IP with iptables?


Is there a way to unmask an IP using iptables? I know to mask all-in-one is following by:



iptables -t nat -A -POSTROUTING -j MASQUERADE


Thanks in advanced.



What are the root permissions for a file?


If I type:



ls -l file.txt


I see that the rights for that file are equivalent to "456":



  • 4 = owner (r--)

  • 5 = group (r-x)

  • 6 = others (rw-)


Which the rights for root in this case? Does it have 777?


Could the rights be changed so that the root will have less permissions than the owner?



Ghost Vulnerability - CVE-2015-0235


Does the Ghost Vulnerability require access (as in being a logged in user) to the effected OS in question? Can someone clarify the 'remote attacker that is able to make an application call'? I only seem to find tests to run on the local system directly but not from a remote host.


All the information I have gathered so far about the Ghost Vulnerability from multiple sources (credits to those sources) I have posted below in an answer in case anyone else is curious.


Edit, I found my answer:



During a code audit Qualys researchers discovered a buffer overflow in the __nss_hostname_digits_dots() function of glibc. This bug can be triggered both locally and remotely via all the gethostbyname*() functions. Applications have access to the DNS resolver primarily through the gethostbyname*() set of functions. These functions convert a hostname into an IP address.




Fn key results in backslashes rather than brightness, etc


I recently upgraded from Ubuntu 14.04 to 14.10. On 14.04, the Fn key controlled bits and pieces such as mute, brightness, volume, lock touchpad, etc. all worked fine.


After the upgrade, they don't. Pressing the Fn key post-upgrade results in a backslash.


I've tried all the various options suggested elsewhere online to change grub's config:



GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux"


Suffice to say, none solve the issue.


I've since wiped Ubuntu and replaced it with Linux Mint 17.1, which I believe is based on Ubuntu 14.04, the version in which everything worked.


This leads me to believe there is some sort of setup/configuration setting which was wiped by the upgrade and is the default in Mint and in Fedora too, of which I tried a live CD.


Hardware Info: $ sudo dmidecode | grep -A3 '^System Information':



System Information
Manufacturer: Acer
Product Name: Aspire V3-771
Version: V2.08


At a bit of a loss with this.



If I install linux to a USB thumb drive, would it become a live USB?


I need a live USB that functions like normal install, with the ability like install app, add/remove user account etc... the guide on the internet which I have found require me a Live CD, but the linux distribution which I am interest in(opensuse) did not provide it, so, what should I do?


Thanks for help



Resizing Whiptail to full terminal screen


How to make whiptail full terminal screen? "as big as the terminal", like fluid CSS, something like 100%



drbd can't start resync


This is my situation


On both nodes



cat /etc/drbd.d/*
resource clustervol {
device /dev/drbd1;
disk /dev/sdb1;
meta-disk internal;

on iscsi1 {
address 192.168.0.30:7790;
}
on iscsi2 {
address 192.168.0.41:7790;
}
}

global {
usage-count yes;
# minor-count dialog-refresh disable-ip-verification
}

common {
protocol C;

handlers {
# The following 3 handlers were disabled due to #576511.
# Please check the DRBD manual and enable them, if they make sense in your setup.
# pri-on-incon-degr "/usr/lib/drbd/notify-pri-on-incon-degr.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f";
# pri-lost-after-sb "/usr/lib/drbd/notify-pri-lost-after-sb.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f";
# local-io-error "/usr/lib/drbd/notify-io-error.sh; /usr/lib/drbd/notify-emergency-shutdown.sh; echo o > /proc/sysrq-trigger ; halt -f";

# fence-peer "/usr/lib/drbd/crm-fence-peer.sh";
# split-brain "/usr/lib/drbd/notify-split-brain.sh root";
# out-of-sync "/usr/lib/drbd/notify-out-of-sync.sh root";
# before-resync-target "/usr/lib/drbd/snapshot-resync-target-lvm.sh -p 15 -- -c 16k";
# after-resync-target /usr/lib/drbd/unsnapshot-resync-target-lvm.sh;
}

startup {
# wfc-timeout degr-wfc-timeout outdated-wfc-timeout wait-after-sb
}

disk {
# on-io-error fencing use-bmbv no-disk-barrier no-disk-flushes
# no-disk-drain no-md-flushes max-bio-bvecs
}

net {
# sndbuf-size rcvbuf-size timeout connect-int ping-int ping-timeout max-buffers
# max-epoch-size ko-count allow-two-primaries cram-hmac-alg shared-secret
# after-sb-0pri after-sb-1pri after-sb-2pri data-integrity-alg no-tcp-cork
}

syncer {
# rate after al-extents use-rle cpu-mask verify-alg csums-alg
}


}


On node1 works all



version: 8.3.11 (api:88/proto:86-96)
srcversion: F937DCB2E5D83C6CCE4A6C9
1: cs:StandAlone ro:Primary/Unknown ds:UpToDate/DUnknown r----s
ns:0 nr:0 dw:0 dr:996 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:29359164


On node2 no



cat /proc/drbd
version: 8.3.11 (api:88/proto:86-96)
srcversion: F937DCB2E5D83C6CCE4A6C9

1: cs:WFConnection ro:Secondary/Unknown ds:Diskless/DUnknown C r-----
ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0


I have tried a lot of command: disconnect,invalidate,discard my data on node2,but the situation doesn't change Is a "virgin" dbrd configuration,i have no data on disk how to force a resync? Thanks



Remove all files recursively without deleting directories


I want to "clean out" all of the files a directory including all files in subdirectories but I want to leave the subdirectories in place. My understanding of rm -r is that it will also delete the subdirectories themselves.


I do not want to delete hidden (dot) files.


How can this be done?



Zip the contents of a folder without including the folder itself


I have a directory called folder that looks like this:



folder
-> root_folder
-> some files


I want to zip this directory into zipped_dir, I tried:



zip -r zipped_dir.zip folder/*


But this generates a ZIP that looks like this:



zipped_dir
-> folder
-> root_folder
-> some files


in other words, it's including the directory whose contents I want to zip. How can I exclude this parent directory from the ZIP, without moving anything?


IE I would like this end result:



zipped_dir
-> root_folder
-> some files


setuid (and other) permissions lost when copying / elsewhere - what to do?


I sort-of-cloned an existing Debian 7.x distro by copying the contents of the root filesystem (not the special dirs of course) to another HDD. I booted, things seem to run, but - I get some weird errors. One of them - sudo and su wouldn't run, complaining about lack of a setuid permission for the binaries. Well, I fixed that, and now they don't complain, but - maybe there are other files whose permission has been screwed up during the copy? Is there someway to verify and fix all relevant file permissions?



find the application that consuming large memory


How to find which application is consuming large memory? Is there any other way than using top?



Questions about whiptail and bash functions


I'm a bash newbie.



  • How to make whiptail full terminal screen? "as big as the terminal", like fluid CSS

  • Say I have this script




#!/bin/bash

function cpp-lang {
yum install "Development Tools"
}
function updatesys {
yum -y update yum -y upgrade
}

whiptail --checklist "test" 5 40 5\
Update "Update the system" on \
C++ "Install C++" off 2>results

while read choice
do
case $choice in
Update )updatesys
;;
C++)cpp-lang
;;
*)
;;
esac
done < results


When I run it, it exists, should I return something from the function?



  • Considering the script above as an example, should I run sudo everytime I call yum install or is doing sudo ./script.shenough?



Proper create user account with permissions on CentOS/Apache


I have setup a CentOS VPS to run apache, I am having trouble with permissions when creating an account.


I have setup a virtual host host to point a domain to /home/user/public_html



<VirtualHost *:80>
ServerAdmin me@mydomain.com
DocumentRoot /home/user/public_html
ServerName www.user.com
ServerAlias user.com
</VirtualHost>


I then added a user and make the public dir:



adduser user
passwd user
mkdir /home/user/public_html


Now when I browse this domain I get permission denied.. I can login via SSH and browse to the public directory but it does not let me create files due to permission errors.


The permission on the user dir are is 700, when i change it to 755 I get the 'Apache is installed' page, which I find weird.


I've Google'd this problem and it looks to be widespread, SELinux crops up a lot, however upon testing it is already disabled on my server:



SELinux status: disabled


sudo apt-get upgrade


I've just run:



sudo apt-get upgrade



And at the end I get the following error:



Setting up liboxideqtquick0:amd64 (1.4.2-0ubuntu0.14.04.1) ...
Setting up liboxideqt-qmlplugin:amd64 (1.4.2-0ubuntu0.14.04.1) ...
Processing triggers for libc-bin (2.19-0ubuntu6.5) ...
Errors were encountered while processing:
update-notifier-common
update-notifier
update-manager
ubuntu-release-upgrader-gtk
E: Sub-process /usr/bin/dpkg returned an error code (1)


Would anyone be so kind to help me fixing this?



Find the line number which contains the pattern with custom delimiter


As in example I'm trying to get line numbers which contains the pattern. My pattern contains slashes so I wanted to add custom delimiter.


This simple one works:



sed -n '/file/=' temp.txt


Using delimiter for string replace works too:



sed 's|file|gile|' temp.txt


but when I want to add delimiter to first example it doesn't:



sed -n 's|file /etc|=' temp.txt


I know I can escape slashes but I would prefer to add custom delimiter. Any idea how to fix my command?



How to bump file timestamps by 3 months (for a directory tree)?


I am looking at the touch command line utility, and from the examples I found in tutorials, I see how one can bump the access or modification timestamp to a specified time, the current time, or to a reference file.


However, I would like to do the following: The relative age of my files (relative to each other) has information valuable to me, and I'd rather not lose that. But I need to look each file in (recursive) folders look a few months younger than they are. So each file could refer to itself, bump the time, but apply this to each file in a tree of folders. What is a good way to do this?



#!/bin/bash
FILES=$(find $HIGHEST_FOLDER -type f -name *.*)
for f in $FILES
do
touch -ram f -F 7776000 f
# bumping access and modification timestamps by 3 months?
done


Or am I better off using find -exec as suggested in this answer? (There are many files in these folders.) How could that work?



How to install oddjob-mkhomedir repository on AMI box using command line


I'm trying to install oddjob-mkhomedir and it comes back with no package available nothing to do. I used sudo yum install oddjob-mkhomedir so I'm assuming the repository is not available.


My question is if the repository is indeed missing, where would I find it and how would I add it? Next would be how would I install oddjob-mkhomedir?


I found this page, but I'm not sure that it is correct



SELinux: bin_t type socket-application can access http_port_t ports


I am trying to compromising my application (myapp) to use limited ports.


For that, I have decided to assign httpd_t type to myapp. So, myapp could use only http_port_t typed ports & I could manually add or remove ports to http_port_t domain.


Since, SELinux prefers to use http_port_t ports for httpd_t domain processes, But not enforcing it. So, I also could able to use unserved ports too. How to make it as enforcing one??


Also, I have socket-applications in bin_t domain. These too are having access to http_port_t typed ports. But, I dont want them to access http_port_t ports.


What I am missing?? Guys, Please suggest some ways to achieve this..



Mark files,folder in color using Debian Wheezy/Gnome [on hold]


I'm using Debian Wheezy with Gnome. Does anyone know if it is possible to mark individual files, folders, etc. in the graphical filemanager in different colors like under OSX? That was a feature of OSX I used a lot before migrating to Debian.


I mean something like this feature with the color highlighting/labelling of individual files: enter image description here


resulting in:


enter image description here



CentOS rescue mode


After a power outage somehow my server is not finding the boot partition anymore. As far as I read about recovering a CentOS 6.4 I just need to pick "Rescue installed system" option from the boot menu.


But where is the "Rescue installed system" on the boot menu?


I had boot from the same liveCD which the original installation was done. But there's no option like that. I even tried to type "linux rescue" on boot command line, no success so far. It did not find the kernel image.


Seens to be so simple task, but I given up... Thanks in advance!



What to do for resolveip output the domain name


What I must have do to I can use resolveip (on any machine connected on internet) and get the output:



Host name of xxx.xxx.xxx.xxx is mydomaing.com


and not



resolveip: Unable to find hostname for xxx.xxx.xxx.xxx


List the files of another format while finding a certain name pattern


I had wanted to edit the txt files of videoA and videoB only if the movs files names contains the namespace -test


For eg.



videoDir
|-videoA
|- videoA_v001_test.mov
|- videoA_v001_info.txt
|-videoB
|- videoB_v001_test.mov
|- videoB_v001_info.txt
|-videoC
|- videoC_v002.mov
|- videoC_v002_info.txt


Above, I want to edit videoDir/videoA/videoA_v001_info.txt and videoDir/videoB/videoB_v001_info.txt but not videoC_v002_info.txt since the corresponding .mov file name doesn't contain test.


I come up with the command - find -name "*.mov" | grep -rn "test" | find -name "*.txt", find -name "*.mov" | grep -rn "test" does indeed lists out the 2 files that fulfills the condition (videoA and videoB). I added infind -name "*.txt"` as I had thought it will filter it down to the txt files within the output results, however I was wrong as it is still listing all the txt files



Crunchbang: Can't use simple-scan without administrator rights


I'm running the latest version of Crunchbang 64-bit on a Dell E5510 notebook.

Installing my printer and scanner worked fine - I just used an existing Ubuntu tutorial. However, scanning without starting Simple-Scan as sudo produces an error message. My main account is listed as part of the group scanner, according to the output of less /etc/group. To my limited knowledge, this should suffice, shouldn't it? What more steps are necessary in order to run simple-scan without sudo?

Thanks in advance.



Can I do reverse traceroute?


Is it possible to do reverse traceroute ? This is very important for me to know, Why the websites are loading slow for my clients in certain area ?



Writing a program for editing .txt data - Python or Unix?


I only have little experience in programming, and I'm currently working on improving my skills. Basically, I need to write a program, that can do some specific processes to some data in a .txt file.


To start from scratch, I have a .txt file with data looking like this:



>tex_1 abcdefghijklmnopqrstu
>tex_2 abcdefghijklmnopqrstuv
>tex_3 abcdefghijklmnopqrstuv
>tex_4 abcdefghijklmnopqrst
// x
>tex_1 abcdefghijklmnopqrstu
>tex_2 abcdefghijklmnopqrstuv
>tex_3 abcdefghijklmnopqrst
>tex_4 abcdefghijklmnopqrstuv
// x x
>tex_1 abcdefghijklmnopqrstuv
>tex_2 abcdefghijklmnopqrstuv
// x x


I need to do some weird stuff to this data, in order to end up with a data set, that can be analyzed in the software I use. Each "//..."-line refers to the group of data above, until the next "//..."-line


Here's a line-up of what I want to do:


Shift the "//..."-line, so the group of data it refers to is below this line, and not above it:



// x
>tex_1 abcdefghijklmnopqrstu
>tex_2 abcdefghijklmnopqrstuv
>tex_3 abcdefghijklmnopqrstuv
>tex_4 abcdefghijklmnopqrst
// x x
>tex_1 abcdefghijklmnopqrstu
>tex_2 abcdefghijklmnopqrstuv
>tex_3 abcdefghijklmnopqrst
>tex_4 abcdefghijklmnopqrstuv
// x x
>tex_1 abcdefghijklmnopqrstuv
>tex_2 abcdefghijklmnopqrstuv


Add a unique name to each group after //, without shifting remaining text on the line:



//Name 1 x
>tex_1 abcdefghijklmnopqrstu
>tex_2 abcdefghijklmnopqrstuv
>tex_3 abcdefghijklmnopqrstuv
>tex_4 abcdefghijklmnopqrst
//Name 2 x x
>tex_1 abcdefghijklmnopqrstu
>tex_2 abcdefghijklmnopqrstuv
>tex_3 abcdefghijklmnopqrst
>tex_4 abcdefghijklmnopqrstuv
//Name 3 x x
>tex_1 abcdefghijklmnopqrstuv
>tex_2 abcdefghijklmnopqrstuv


Output this to a new file, without changing the original. Then grab each name-line + line below, and output this to a File2:



//Name 1 x
>tex_1 abcdefghijklmnopqrstu
//Name 2 x x
>tex_1 abcdefghijklmnopqrstu
//Name 3 x x
>tex_1 abcdefghijklmnopqrstuv


Change the structure, so the naming is like the following, and output this to File3:



>Name 1 abcdefghijklmnopqrstu
>Name 2 abcdefghijklmnopqrstu
>Name 3 abcdefghijklmnopqrstuv


The above data is in a structure, I can actually analyse.


Now I know this is guite the task (especially for a complete programming-noob), and I am not asking you "how do I program this. I would just like to know, where you guys would start with such a project, and what language do you think fits the project best?


I managed to do a few things in unix, by getting help on this site. E.g. Giving unique names to each "//..." line, by the following unix code:



awk -F '' '/\/\//{n++ ; t=" Name "n ; sub("// {0,"length(t)-1"}","//"t)}{print}' File1.txt


Could you give me some hints for where to start? Is the problem suitable as a Python project? The original .txt data file contains a lot of data, so it is not possible to do the processing by hand. Also this project is meant as a way to get further into programming.


Thank you!