I have several servers setup with salt, I've been using the sqlite3 returner to record all my actions. This work fine, but rows only get inserted on each minions local database. How can I accumulate all of these records on the master?
devin's questions
I have multiple source dirs, say /home/me/source1
and /mnt/somedisk/source2
. I want to push them both to something like /home/someoneelse/dest1
and /home/someoneelse/dest
respectively. I'd like to use one rsync command to this, is this possible?
What about for N directories to N directories where every directory is uniqe?
I have an interface that I setup like this
ip addr add 192.168.1.1/24 dev eth0
ip addr add 192.168.1.2/24 dev eth0
ip addr add 192.168.1.3/24 dev eth0
etc.
Is there an easy way to delete all of the IPs I add with out doing
ip addr del 192.168.1.1/24 dev eth0
ip addr del 192.168.1.2/24 dev eth0
ip addr del 192.168.1.3/24 dev eth0
or doing something like
ips=`ip addr show dev eth0 | grep -oe '192\.168\1\.[0-2][0-9]{1,2}'`
for ii in $ips; do
ip addr del $ii dev eth0
done
There must be a more elegant way to do this.
I have some arbitrary number of servers with the same user/pass combination. I want to write a script (that I call once) so that
ssh-copy-id user@myserver
is called for each server. Since they all have the same user/pass this should be easy but ssh-copy-id
wants me to type the password in separately each time which defeats the purpose of my script. There is no option for putting in a password, ie ssh-copy-id -p mypassword user@myserver
.
How can I write a script that automatically fills in the password field when ssh-copy-id
asks for it?
I'd like to synchronize evolution inbox across 2-3 computers without leaving messages on the server. Does anyone have any experience with this? I can't seem to find any way to do this by searching server fault or Google.
What I've thought about doing is using rsync to make diffs every time I check my mail and transfer them to a service like drop box or ubuntu one. Then I can download the diffs when I use another machine.
I think it would take a decent amount of work to get this going, so if there's an easier way I'd appreciate knowing about it.
I have python 2.4 and 2.6 installed on my RHEL5 machine.
But
[de22596 gnuradio]:+ss$ python -V
Python 2.4.3
I tried to make a symlink from in /usr/bin python -> python26, then I get
[de22596 gnuradio]:+ss$ python -V
Python 2.6
But a lot of things break, like yum. How can I fix this?
Right now, I have this:
[de22596 bin]:$ ls -l python*
lrwxrwxrwx 1 root root 9 Jul 20 10:52 python -> python2.4
lrwxrwxrwx 1 root root 6 Jul 12 15:02 python2 -> python
-rwxr-xr-x 2 root root 8304 Jun 11 2009 python2.4
-rwxr-xr-x 2 root root 8328 Apr 9 11:17 python26
-rwxr-xr-x 2 root root 8328 Apr 9 11:17 python2.6
-rwxr-xr-x 1 root root 1418 Apr 9 11:17 python2.6-config
-rwxr-xr-x 2 root root 8304 Jun 11 2009 python.back
lrwxrwxrwx 1 root root 16 Jul 20 10:34 python-config -> python2.6-config
Could I do
yum remove python2.4
And expect things to still work? I'm worried because yum is a python script, so if I remove python2.4 will it be smart enough to
Is there a way where I can set vim to configure itself based on the filetype? So for example, text files have the equivalent of
:set spell :syntax off
Where a C source file has
:syntax on :smartindent on
Thanks for any help.
I've been reading about this google/china episode and and it seems that one of the attack vectors used was embedding code (javascript I believe) into PDF documents. This has me worried, I surely don't want any PDF documents executing code on my machine unless I explicitly say so. I run all Linux systems though, so is a simple chmod -x doc.pdf
good enough? (Not that any of my PDF files have exec privs anyway)
Are there any tools out there to scan for PDF with embedded code? I'm looking for Linux tools, but if anyone know of any Windows tools for this, I'm sure others would find them useful.
Also, the reader I use now is evince, does anyone know if evince even executes code embedded in PDFs? There's no option to turn it off and evince generally seems to be minimalistic so I suspect not.
Is there an elegant way to test an IP address in a BASH script? I could do ifconfig and narrow down the IP using sed/awk, but I think there is a simpler solution.
My application is basically using SSH/SCP scripts when I'm in my intranet and while I'm not. So, I want this type of flow
if IP=192.168.1.1
then do this
else
then do that
I use the tomato firmware for my router and I'm sick of the web interface. Does anyone know what files correspond to different configurations? The router I use is the Linksys WRT54GL.
Example:
the firewall is edited in /etc/iptables
Questions:
- Where is the wireless key kept?
- Where is the static DHCP kept? ("static dhcp" maps MAC addresses to IP addresses)
Is it possible to edit the sudoers file so a user can use sudo for any command except for a specified one? I reverse is true, I believe, that the sudoers file can be setup so that a user can only execute a given list of commands.
EDIT: the commands I really want to take away are halt and reboot... this makes me think there are special system calls for halt and reboot. Can you take system calls away from a user? If not, is it because the unix permission system abstracts over system calls neglecting this?
I can't seem to figure out a decent way to manage jobs over ssh. I want to start a job in an ssh session, logout, log back in, do a fg, check on the job, logout, then repeat the whole process. nohup doesn't seem to wrok well.
I used this command
$ nohup script & > nohup.out
[1] 28128
$ nohup: ignoring input and appending output to `nohup.out'
[1]+ Exit 255 nohup script
If I do either
$ jobs
$ ps -ef | grep script
I get nothing, i.e. the process isn't found.
Also, a related question I have is: If I'm in an ssh session, and want to send a job to the background, ctrl-z doesn't work. What to do?
Cany anyone help me out?
I want to run and check on apps (like rtorrent) running on server via ssh. I'd prefer not to use background/foreground stuff. What I really want to do is have a screen session on this server all the time and attach/detach/reattach remotely, but I'm not sure how to do that.
Anyone have any ideas?
How do I force someone to login for a webpage?
Specifically, I have a linux server, where everyone has a login to that server. Can I make users login to the webpage with that login info?
If I can't use that apporach, what are my other options?
I want to be able to send email from mutt through an SSH tunnel I can SSH into the SMTP server, but I don't know how to tell mutt how to use the tunnel to send e-mail.
Can someone help me out, please?
I really like the monitoring function in screen c-M and c-_ but whenever an event happens (or doesn't happen if c-_) on a screen I am monitoring the message doesn't go to the hard status line I have.
What I really want, yet have no idea how to do, is set it so when a monitoring event happens, the color of that screen changes. I think this is possible because my active screen is white and the inactive screens are green (on the hardstatusline).
To me, this would be really cool to implement....
EDIT: OK, I'm sure I can do this somehow. What I want is the color of the screen's name to change when activity stops for 30 seconds (or when activity starts, depending on what mode it's in. By default, an @ get placed in the before the name.
Here is my current hard status line (I copied this from a website, so I can't really interpret it exactly.) hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]'
so I wanted to change a folders name from uppercase letters to lowercase letters, so I did
mv FOLDER folder
why am I not required to make a new folder? Shouldn't I get an error like
folder does not exist
you can't copy into a folder that doesn't exist, so why can you move into one??
I've been thinking about doing a linux from scratch install. But I'm concerned about keeping my system updated. What are my options for package management? Would I be doomed to recompiling every update, or is there a better way?
I am trying to launch GNU Screen using my .bashrc
. I'm almost there:
if [ -z "$STY" ]; then
exec screen -dR
else
exec gnome-terminal
fi
This is wrong though! The first case works, screen
launches when I open a terminal. But the second part fails. I want to open a regular terminal if I already have one open. But this just opens an infinite number of terminals...