I have a file that I am trying to read by using tail -f. I was wondering if there was a way to have the terminal output an actual line break instead of the \n character.
I've added the following line to /etc/environment:
FOO_DEPLOYMENT_ENV="vbox"
Upon logging in via SSH, I can echo $FOO_DEPLOYMENT_ENV and, of course, see vbox output to the shell. If I open a Python shell and run os.getenv('FOO_DEPLOYMENT_ENV'), it will return 'vbox', but the same code in my Python application, when run by uWSGI (as the www-data user), it does not see the environment variable.
Clearly, this isn't a problem of uWSGI, and is rather a problem with my understanding of environment variables, or how they're properly set, and the contexts in which they can be retrieved. What am I doing or understanding incorrectly?
I'm using Debian Lenny and I want to tunnel rtorrent only through a OpenVPN tunnel.
I have a tunnel running, the config file looks like this:
client
dev tun
proto udp
remote openvpn.xxx.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca /etc/openvpn/xxx/keys/ca.crt
cert /etc/openvpn/xxx/keys/client.crt
key /etc/openvpn/xxx/keys/client.key
tls-auth /etc/openvpn/xxx/keys/tls.key 1
ns-cert-type server
comp-lzo
verb 3
auth-user-pass
script-security 3
reneg-sec 0
My idea is that I could run a sockd proxy internally that redirects traffic to the openvpn tunnel. I could use the *nix "proxifier" application "tsocks" to make it possible for rtorrent to connect through that proxy (as rtorrent doesn't support proxies).
I have trouble configuring sockd as my IP inside the VPN changes every time I connect. This is a config file someone said would help:
http://ircpimps.org/sockd.conf
As my IP changes at each connect I don't know what to put in that config file. I have no control over the host side config file.
Any help wanted. Any other method is very welcome.
I have tried this case by using the NAT function in iptables but fail
example.
PC A IP is 1.1.1.1 (Win7)
My Server IP is 2.2.2.2 (CentOS 6.2)
target Server B is 3.3.3.3 (Windows server 2003)
Flow: PC A WanIP -- My Server A -- Server B (WanIP)
My iptables rules:
1. iptables -t nat -A PREROUTING -d 2.2.2.2 -p tcp --dport 80 -j DNAT --to-destination 3.3.3.3:80
2. iptables -t nat -A POSTROUTING -d 2.2.2.2 -j MASQUERADE
finally, i can access server B website by enter 2.2.2.2:80
but when i checked the access log at Server B
i found it's source address had been changed to src:2.2.2.2 dst:3.3.3.3
please help me to do how to get the real address is src:1.1.1.1 dst:3.3.3.3
I have Virtualbox running on Windows Vista, and Debian running inside Virtualbox. Everything's running great, for the most part. Everything looks correct.
But when I'm in full-screen mode, the top edge seems to act (to the mouse) like it's the bottom edge, and the left edge seems to act like the right edge. For example, if I click in the middle of the desktop and drag left, as if to select some icons, when I hit the very leftmost pixel of the screen, the selection (but not the mouse pointer) jumps to the far right edge of the screen).
For the left edge, it's not such a big deal, but not having the top edge is kind of annoying: it means I can't select things from the menu in my top panel by slamming the mouse against the top of the screen.
Anyone seen this before? Is there some way to make this work?
Thanks!
I've setup a git-svn repo with cron to fetch from the svn repo daily. I have a script to do the fetching, and this is what is invoked by cron. Everything is fine with the repo, and the script works fine when executed manually.
However, when it runs under cron, empty files get dropped into the .git directory. The files have names that look like they are some base64 output, e.g. juTrvjP6m8 and kcKf3hu3b4. Two of these files show up for every cron run. I thought these might be commit hashes, but they're not, git-show says it's an unknown revision.
I set-up the repo as follows:
git svn init http://svn.ip.addr/repo
git svn fetch svn-remote
My script looks like this:
cd /gitsvn/dir
git svn fetch svn-remote
git svn push pub
The last line pushes the repo to a separate (bare) public repo from which others can clone.
I'm piping the output from the cron job to a file, which looks like this:
fatal: unable to run 'git-svn'
Counting objects: 21, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (11/11), 59.08 KiB, done.
Total 11 (delta 8), reused 0 (delta 0)
To /gitpub/repo.git
360faf5..a153b0d trunk -> trunk
The line "fatal: unable to run 'git-svn'" is alarming, but the fetch seems to go ahead anyway. Any suggestions? Where are these empty garbage files coming from, and how to stop them? Am I in for bigger problems in the future?
BTW, I'm using git 1.6.3.3.
While searching for a secure dns server I came across the NSD project.
I was really impressed by what seemed to me the best option out there that's open source.
One problem thought their 'tutorial' is really not beginner friendly. I have basic DNS knoledge but what's in there is out of my league.
I need to have multiple sites on this CentOS server I've recently got my hands on. They also need to receive email.
Details:
I have a master host and would love to set this in the way described in the rows that follow:
masterhost.com -> ns1.masterhost.com mail.masterhost.com www.masterhost.com
addonhost.com -> ns1.masterhost.com mail.masterhost.com www.addonhost.com
And so on.
Any help in setting up this DNS server please? All answers and suggestions are welcomed. Thank you in advance.
I'm encountering a weird problem which is present both on Ubuntu 9.10 and 10.04, on two different machines.
When trying to copy between two external drives connected to the same USB controller, the transfer will randomly hang at some random time (after copying 300MB, 1GB, 10GB - it doesn't appear to depend on the dataset being copied). The hang appears to happen faster in 10.04. It appears to happen slower if both drives are connected to a hub. If the drives are connected to 2 distinct physical ports on the machine, the hang will be very fast.
Hangs cannot be reproduced if:
Data is copied from the first external drive to an internal drive, then to the second external drive
Drives are connected to different USB controllers, for example the first one is connected to the built-in controller and the second one via an external PCMCIA controller.
lspci says the first machine has an Intel ICH9 USB controller, the second an Intel ICH4.
Is this a hardware problem, a kernel problem or a software issue? I used Nautilus when copying the files.
Does anyone know the best way to configure Ubuntu to use a SOCKS5 proxy for all network traffic? Server is ubuntu server - all cli. So I cannot set via the Proxy Settings GUI. We want to push all outbound traffic through the proxy (apt-get, http, https, etc). I do need to separate ssh traffic so it stays locally. Everything else should hit the proxy server. not that it matters, but I'm using Squid for the proxy server.
I know this is easy on Mac and Windows as you can set a proxy on the actual network interface. Can you do the same on Ubuntu?
I have a Gigabyte H55M-UD2H motherboard and an Acer S271HL monitor. When I connect the monitor to the motherboard via VGA, signal works perfectly. When I connect the monitor via HDMI, the system "sees" the connection, but the monitor receives no signal (the monitor shows a blue box which reads "No Signal" and then the monitor goes into power-saving state).
Some fun facts about this:
if I hook a different monitor to this box via HDMI, the monitor receives the output without issue (same computer/motherboard, same cable, different monitor)
if I connect a different computer to the monitor via HDMI, the monitor receives the output without issue (different computer, same cable, same monitor)
no signal is received whether in the OS or in the BIOS
there are no BIOS options for controlling video output other than for selection of onboard vs. PCI/PCI-E-based video card (the system has no dedicated video card installed)
The box is running Linux, so I have the output of xrandr which shows the connection and the monitor modes detected via DDC:
~$ xrandr --prop
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
Broadcast RGB: Full
supported: Full Limited 16:2
audio: auto
supported: force-dvi off auto on
DP1 disconnected (normal left inverted right x axis y axis)
Broadcast RGB: Full
supported: Full Limited 16:2
audio: auto
supported: force-dvi off auto on
HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
EDID:
00ffffffffffff000472ca028d128022
1c160103803c2278ca7b45a4554aa227
0b5054bfef80714f8140818081c08100
9500b300d1c0023a801871382d40582c
450056502100001e000000fd00384c1f
5311000a202020202020000000fc0053
323731484c0a202020202020000000ff
004c55573044303130383531300a01e5
020324f14f0102030405060790111213
1415161f230907078301000067030c00
1000382d023a801871382d40582c4500
56502100001f011d8018711c1620582c
250056502100009f011d007251d01e20
6e28550056502100001e8c0ad08a20e0
2d10103e960056502100001800000000
000000000000000000000000000000de
Broadcast RGB: Full
supported: Full Limited 16:2
audio: auto
supported: force-dvi off auto on
1920x1080 60.0*+ 50.0 25.0 30.0
1680x1050 59.9
1680x945 60.0
1400x1050 74.9 59.9
1600x900 60.0
1280x1024 75.0 60.0
1440x900 75.0 59.9
1280x960 60.0
1366x768 60.0
1360x768 60.0
1280x800 74.9 59.9
1152x864 75.0
1280x768 74.9 60.0
1280x720 50.0 60.0
1440x576 25.0
1024x768 75.1 70.1 60.0
1440x480 30.0
1024x576 60.0
832x624 74.6
800x600 72.2 75.0 60.3 56.2
720x576 50.0
848x480 60.0
720x480 59.9
640x480 72.8 75.0 66.7 60.0 59.9
720x400 70.1
HDMI3 disconnected (normal left inverted right x axis y axis)
Broadcast RGB: Full
supported: Full Limited 16:2
audio: auto
supported: force-dvi off auto on
DP2 disconnected (normal left inverted right x axis y axis)
Broadcast RGB: Full
supported: Full Limited 16:2
audio: auto
supported: force-dvi off auto on
DP3 disconnected (normal left inverted right x axis y axis)
Broadcast RGB: Full
supported: Full Limited 16:2
audio: auto
supported: force-dvi off auto on
How do I get this monitor to recognize the output from this HDMI socket?
I have an older version already installed.
I have upraded the package using setup.py install command. But the path is not correctly set. When I type "s3cmd" is shows the older version of software.
# s3cmd
s3cmd [options] <command> [arg(s)] version 1.2.6
--help -h --verbose -v --dryrun -n
# which s3cmd
/usr/local/bin/s3cmd
The correct version is in different folder and I will like that to be used whenever I type the command.
# /usr/bin/s3cmd
Consider using --configure parameter to create one.
How do I set path?
I have added path to .bash_profile file but it does not work.
PATH=$PATH:/usr/bin/s3cmd
I need to send a request to CUPS server with the specific request-user parameter - remote_user instead of local_user. How should I set the local CUPS server?
I don't know much about ruby, much less how or what is involved with hosting a ruby on rails web app.
BUT, I recall hearing someone saying that they have to run multiple mongrels b/c of a limit of 50 threads?
Is this true (or something similiar)?
Why does it have this limitation?
I have create a script to start a server(my first question). Now I want it to run on the system boot and start the defined server. What should I do to get this done?
My findings tell me put this file in /etc/init.d location and it will execute when the system will boot. But I am not able to understand how the first argument on the startup will be start? Is this predefined somewhere to use start as $1? If I want to have a case startall that will start all the servers in the script, then what are the options I can manage.
My Script is like this:
#!/bin/bash
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
$0 stop
$0 start
;;
*)
echo "usage: $0 (start|stop|restart)"
;;
esac
I'm going to be moving about 7-10 websites (5-8 with Databases - MySQL) onto our new Virtual Private Server. I'm curious what the best way to host many sites on a single server is though. Do I create a directory for each site immediately within my root directory, and then point the domain names for each site to http://123.123.123.123/siteDirectory - or is there a more appropriate way to do this?
I'm very interested in maintining control over how many concurent connections each site can have at any given time - would I be able to do that on the directory-level, or am I required to limit the concurrent-connections to the VPS itself?
We have a cyrus 2.4.12 on Debian, we use packages, rather than building each software ourselves.
I am getting the this "log" constantly, a lot of, various users, and 8-10 times per user request:
fetching user_deny.db entry for 'user123'
I have searched for it, but haven't found a real solution, there were some patches for 2.3.xx, but we don't want ot build it, we prefer to use packages.
Is there any solution to disable the user_deny.db at all. We don't need this feature. It wastes the CPU as disk.
How to configure ntop so I can get the amount of upload traffic sent through a certain port ?
I've added port in ntop/protocol.list, restarted ntop and after some time I've checked Summary - Traffic - TCP/UDP Traffic Port Distribution: Last Minute View, but data from that table is not too relevant.
I think there is much more about this ntop that I don't know (configuration, usage).
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?
Has anyone else come across this?
After about as much of a fresh install as i can muster without buying new drives, and after walking through the amd64 alternate install with ease, and after a little 'pre-splash' screen where the orange dots under the (very sexy) new ubuntu logo blink away, I'm left with a vista of purple hues and logo plonked in the middle, with the dots not going anywhere.
I was at this same position last night at 3 in the morning, left it lying overnight, and nothing had changed, so I'm pretty sure its frozen, but when i go in and inspect /var/log/* in the recovery console, no errors, no complaints, no problems.
I'm at my wits end and am just about ready to try anything. If this was on SO I'd be bountying, but if anyone can help you'll just have to cope with my thanks!
Additional Details on my blog and my first attempt at asking for help
There is a script which calls other scripts and they call others... I don't know exactly which scripts are called and how many of them. I only know that some of them are adding iptables rules and I get this error when I call root script.
iptables: No chain/target/match by that name.
iptables: No chain/target/match by that name.
My problem is that I can not find which script outputs this errors. Is there any way or tool to learn that?
i've got some questions about how it works:
so ubuntu server comes with postfix installed.
if i want my php script to send a mail to lets say [email protected], how does it work?
do i have to specify any ip to another MTA (my ISP's MTA?) in postfix's configuration file?
and if someone sends back, will it get to my ip? is it postfix that receives it? or has it to do with fetchmail?
We have a collocated server on which we run some OpenVZ hosts. Recently, we have had to pay a lot extra we keep exceeding our bandwidth quota. Our quota is 5 Mb/s but we have spike to almost 50. I looked at the graphs and there are some spikes happening at some intervals. I want to know which process is causing this so I need a tool that monitors the processes and gives me the one with the maximum instant traffic (It doesn't matter how much traffic we have as long as we don't exceed the 5Mb/s quota). Does anyone have a recommendation for this? My hosts are CentOS 5 with OpenVZ so I can see all the containter processes from the host, if that helps in any way.