2
votes
4answers
31 views

Using sed to search for a string and print everything before and after within a range

I have this file: sometext1{ string1 } sometext2{ string2 string3 } sometext3{ string4 string5 string6 } I want to search this file for a specific string and print everything before this string ...
3
votes
2answers
51 views

How to search all text files in Ack? (with --text option being now removed)

Manual says that "The --text option has been removed.". It was setting the --type to text, i.e. ack was searching all text files regardless of their semantic category (i.e. in *.php files, *.txt ...
0
votes
0answers
3 views

Reference: Programming exercises in IPC, Internet sockets etc

I read Beej's Guide for Sockets Programming and IPC 3 times. Did all the examples from it and know how the API's work. But still I am unable to get the confidence. So thought of doing some ...
0
votes
0answers
6 views

sudo - ubuntu 12.04

I am running a Ubuntu 12.04 LTS server. Today I have been doing some maintenance to the server, and a security audit. I realized that sudo is not working the way I expected it to. In the default ...
1
vote
1answer
16 views

calendar to check the date and then search 3 months back and add up the days of those months?

I want to use the cal comand or the date comand to displace the current day then I want it to displace 3 months before the current date then add up all the days in those 3 months up to the current ...
0
votes
0answers
6 views

KDE4 PolicyKit backdoor(misconfiguration) (tested on FBSD10x,PCBSD, probably will work on linux)

recently found subj on FreeBSD 10.x out of the box (with KDE4): [user@fbsd10] /home/user% su Password: su: Sorry [user@fbsd10] /home/user% sudo csh Password: Sorry, user user is not allowed to ...
0
votes
0answers
12 views

What is Best Practice for running PHP in background?

When running the following on the command line it will be suspended until I issue the fg command: /usr/bin/php -r 'phpinfo();' & This is the case regardless if the PHP code is contained in a ...
1
vote
0answers
4 views

Repeat key while pressed

I'm trying to simulate sending keystrokes to a window (it's ok if it can't be bound) using shell script/bash. What would be the best way of doing this? I also don't want it to block other keys while ...
0
votes
0answers
2 views

Cross-NFS file move adds ACL

Moving a file from one NFS4 mount to another adds an ACL. The reason, if I understand the process correctly, is that mv queries the system.nfs4_acl extended attribute of the source file, and uses the ...
1
vote
0answers
4 views

Configure secondary interface without gateway on Centos

I have two VLANs (default vlan and vlan 5 for voip). I have 2 interfaces, one for each VLAN. My route table looks like this right now: Destination Gateway Genmask Flags Metric ...
0
votes
1answer
497 views

Why is mouse freezing in FreeBSD 9.1 Gnome or Fluxbox?

I'm new to FreeBSD 9.1 and I wanted to install a desktop GUI environment. I first tried Gnome 2 since I am familiar with it. I appended the following lines to the /etc/rc.conf file: hald_enable="YES" ...
3
votes
5answers
864 views

Search only in files that match a pattern with ack

Can ack search only through files that match a specific 'glob' pattern (eg: search for foo in all files named "bar*.c"). The command ack foo "bar*.c" only works in the current directory. Note: I ...
0
votes
1answer
18 views

is there a way to stop users sending to unwanted email accounts?

I want to set a command that only allows users to send emails to accounts ending in @hotmail.com @gmail.com @talktalk.net for example. Is there a way to set it so users can only enter these ...
10
votes
3answers
10k views

How to disable USB autosuspend on kernel 3.7.10 or above?

I've updated my HTPC from kernel 3.7.10 to 3.10.7 and it seems CONFIG_USB_SUSPEND is now gone from the kernel options and included in PM. The main problem I'm facing is that I have an external HDD ...
0
votes
1answer
7 views

how to read any process' /proc/pid/io

I'm trying to monitor disk activity of each process. One way that I found how to do this is to read /proc/pid/io file and compare fields with previous read. That works fine except my monitoring ...
0
votes
1answer
24 views

How to change dmenu's font size in xmonad?

I just start to use xmonad window manager. It is wonderful. I tried to modify some configurations to get it work more suitable for me. My question is: How to make a keyboard shortcut for commonly ...
0
votes
2answers
129 views

Installing Debian 7 (Wheezy) on VMWare Fusion

I'm trying to install Debian 7 x64 on to VMWare Fusion Professional 7.0.1 (on Mac OS X 10.10.1): I downloaded debian-7.7.0-ia64-netinst.iso and tried to start a VM with it and got the following: ...
1
vote
2answers
30 views

Safe way of letting users upload their public keys

I need to let untrusted users, strangers, upload their id_rsa.pub to my server and onto a given user's authorized_keys (user git in my case). What is the safest way of achieving that, without having ...
0
votes
1answer
18 views

Why doesn't Linux remove route from routing table if interface is physically down?

As seen below, Linux(3.7-trunk-686-pae) keeps route to 10.10.12.64/28 in routing table although the interface is physically down: root@kali:~# ip addr show dev eth0 2: eth0: ...
1
vote
0answers
22 views

wget resume download from dropbox gives can't write error

I want to resume download from dropbox using wget. I was downloading a file wget -O SQLyog.exe "https://www.dropbox.com/s/dfv2z0le0c2bo7z/SQLyog-9.3.3-0Trial.exe?dl=1" .......... Length: 15775640 ...
3
votes
2answers
468 views

Jingle CLI client / Jitsi replacement / VOIP

I am looking for a Jingle client for the command line. Currently, I use Jitsi, but my dreams of not needing the GUI for more than just web-browsing are not realized due to my reliance on this ...
0
votes
1answer
15 views

why does grep '\;.' expand to grep '\''\;.'\''' when executed over ssh?

$cat test.sh ssh HOST -l root -o StrictHostKeyChecking=no -q "/bin/bash -l -c /bin/env | grep -w PATH | grep '\;.'" $bash -x test.sh + ssh HOST -l root -o StrictHostKeyChecking=no -q '/bin/bash -l -c ...
3
votes
2answers
2k views

What does a “[1]+ Exit 1” response mean?

I ran this command to try and get my python program to run in the background and let me exit the SSH connection I am using: nohup python files.py >> files.log & I then check ps to check ...
0
votes
2answers
16 views

Can Process id and session id of a daemon differ?

As far as I understood from different articles and here , a daemon has the following features: Parent Process ID should be 1. No terminal should be associated with the process. The process id, ...
1
vote
0answers
8 views

Does Samba 4 actually respect Unix file acls?

After researching the subject on the internet I drew a conclusion that Samba should take into account Unix file acls. During my tests I found the opposite. Only Unix file mode bits are respected, and ...
4
votes
3answers
3k views

sed: delete all occurrences of a string except the first one

I have a logfile with timestamps in it. Occasionally there are multiple timestamps in one line. Now I would like to remove all of the timestamps from a line but keep the first one. I can do ...
0
votes
0answers
3 views

install linux distro with overwritting grub?

Currently i am using linux mint 17.1 cinnamon for some reasons i need to install xubuntu 14.04. So how to install xubuntu with overwriting GRUB. ie. After installation I should have linux Mint's ...
0
votes
0answers
15 views

How do I prevent SD card from dismounting when suspended? [on hold]

I have Android Studio installed in my SD card. When it's running and the system is suspended, java starts throwing a bunch of I/O error. Is there a simple way of disabling this so that the SD card ...
2
votes
1answer
56 views

How to validate/verify .desktop files?

I have a couple of .desktop files that aren't working as expected or not at all. I can't see any error anywhere and asking for help on each one seems unproductive. Is there a way I can verify that I'm ...
2
votes
2answers
19 views

Trying to sort on two fields first is second criteria

I'm trying to sort on multiple columns a file with GNU sort. The format of the source file tmp/file.txt is : 01A0070700474 0000020370988712 "01" => first column "A" => field separator ...
-1
votes
1answer
493 views

How to print gmail inbox messages

I want to print inbox messages one by one (like cat someFile) so that I can parse the message contents. something like printGmail InboxMesg1 | grep some | sed some Using curl I can access the ...
0
votes
0answers
25 views

Working of cd command issues

When I do cd ~/Desktop, it takes me to the Desktop. Then doing ls -a shows the hidden files . and ... Then doing cd . takes me to Desktop, but doing ls -a does not show directories . and ... Even if ...
4
votes
4answers
80 views

Remove a character between 2 known strings

I have a data set like below: \"XXX \ START sapiodj \\" aj \d 2387 END hddo\" START bbcc \\" END ss My Requirement: I want to remove all occurrences of backslash\ and double quotes " between ...
2
votes
1answer
415 views

Syncronising Calendar and Contacts between Thunberbird and Android using Linux Software

I am looking for software to sync my Calendar and my Contacts between Thunderbird, my Android phones and probably other clients like KDEs Kalendar and Kontacts. I want to have both parts available ...
0
votes
0answers
4 views

Using a picture as background in the filebrowser Nemo for directories which are not the home directory

im currently configuring Linux Mint Cinnamon 17 on a SSD as a Christmas present. I want to have the file-browser nemo display a .jpeg instead of a plain background in directories which should not be ...
1
vote
1answer
15 views

I need to download Leonard Suskind video Lectures

Is there a way to download the physics video lectures using curl, mget, or wget. accessing youtube and selecting download method (MP4) takes too long. Any command line example would help greatly.
15
votes
5answers
36k views

How to stop a background process?

I have started a wget on remote machine in background using &. Suddenly it stops downloading. I want to stop its process, then start it again. How can I stop it? I haven't close its shell window. ...
5
votes
3answers
94 views

Replace uppercase to lowercase except first letter of each word in specific line

I want to replace names that I received in uppercase letters only. The names are mixed with other information which should stay as it is. AUTH: at the beginning of the line identifies it as a line ...
0
votes
0answers
2 views

How to add sensors and cooling devices to thermal-conf.xml

I have a Toshiba NB510-108 netbook with Xubuntu 14.10 installed. Under Windows 7 Starter, temperature sensors show values up to 45 degrees Celsius. Under Xubuntu, they show values up to 55 degrees. I ...
0
votes
0answers
3 views

Internal Socket Receive Buffer Implementation

I’m working on an embedded application, where i receive some sensor values over UDP. The board I’m using runs the 2.4 kernel on an ARM processor. The problem is the following: once my internal socket ...
6
votes
2answers
61 views

How to show line numbers in vim on the right side of the buffer?

I have set nu in my .vimrc which shows line numbers on the left side of current buffer. I would like to see line numbers on the right side. How to achieve this? UPDATE: This should also work for set ...
0
votes
0answers
9 views

Using bcache on an USB Stick to reduce Disc access

I am in the process to convert one of my old computers and a bunch of old hard disks into a "zerocost" NAS. I'd prefer that the disks spin down after some time so originally I planned to only have ...
2
votes
2answers
134 views

What is $PWD? (vs current working directory)

So Wikipedia (link) tells me that the command pwd is short for "print working directory", and that makes sense. But for the environment variable, the "P" has to be an acronym for something else than ...
3
votes
1answer
14 views

virt-manager: is it possible to assign specific IP addresses to certains VMs via the virtual DHCP?

using virt-manager quite successfully. I am wondering if it's possible to specify in the virtual DHCP server, that some virtual machines will have a specific IP address (maybe via MAC address ...
3
votes
1answer
532 views

LXDE customize main menu add SEARCH BOX like in KDE Kickoff or Windows 7/Vista

When you open the main menu in say MS Windows (7/Vista) you can quickly search for any item (apps/docs etc.) the same in Ubuntu (Dash), Kubuntu (Kickoff menu). Is there any easy way to add such a ...
0
votes
1answer
29 views

tar & gzip the same folder but get different size

There are two identical folders on two external hard disks. Two hard disks are brand new with the same format I tried du -s to check the size of both folders. The sizes are the same. Then, I ...
3
votes
1answer
142 views

Counting windows

Is there a command to get the number of (visible or iconified) X11 windows? The command $ xwininfo -children -root returns a long list of windows but most of them are neither visible nor iconified. ...
19
votes
6answers
24k views

How can I get a count of files in a directory using the command line?

I have a directory with a large number of files. I don't see a ls switch to provide the count. Is there some command line magic to get a count of files?
1
vote
2answers
633 views

How to have user directory for GNOME wallpapers

I have my wallpapers stored on Dropbox organized by dimensions and I would like to have them available to GNOME. However, I have found this is absurdely hard to do, as even complex searches on various ...
0
votes
0answers
14 views

bash script cronjob not working

Why is the cronjob below not working? As manually executed script is working, but if I put it on cron job it doesn't push through. #--------Reports------------- 25 11 * * * ...

15 30 50 per page