New answers tagged

0

One option is to put your mobile redirection within the applicable server block, and define different server blocks for each mobile site. A little duplication now and overhead to jeep up, but makes things easier to tweak later if requirements change. The key change is server { listen 80; server_name johnson.com # Add redirect detection if ...


0

Use a configuration management system to deploy your packages and server configurations. Generally-speaking, most CM systems are able to handle differences between Linux distros fairly gracefully. However, what you'll run into is that package names between Debian and CentOS will differ. So you may need to manage two lists of packages - one for Debian and ...


0

I know this is not answering the main question, but I've ended up here, searching for just sniffing communication on a socket. I've decided to post for others like me. Here's how I did it: $> sudo socat -t100 -x -v UNIX-LISTEN:/var/run/php5-fpm.sock.socat,mode=777,reuseaddr,fork UNIX-CONNECT:/var/run/php5-fpm.sock You can remove -x and just leave -v ...


0

/mnt/resource WILL NOT PERSIST no matter what you do with it Documentation


1

I've done this in the past by editing /etc/issue. The following script runs on boot, which detects the current IP and then adds it to /etc/issue: #!/bin/sh # Save this file as /etc/network/if-up.d/mod-etc-issue and chmod +x if [ "$METHOD" = loopback ]; then exit 0 fi # Only run from ifup. if [ "$MODE" != start ]; then exit 0 fi IPADDR=`ip a s ...


0

Depending on your system, those files are probably going to be /etc/issue and/or the file defined as Banner in /etc/ssh/sshd_config. However, I'm almost positive that those are strictly text files, so you would have to figure out your IP address and create the file. (Update: /etc/issue is not strictly a text file. It has a few escape characters that expand ...


0

Resizing an ext4 filesystem won't affect any open files. Anyway, your error message is about send(), which isn't used for regular files. It's used to write to sockets, such as network connections or UNIX domain sockets. You should also look at the timestamp...


1

Surely it is (possible) — Policy Based Routing they call it. You can use firewall marking and then leverage ip rule. LARTC is the thing you're looking to have read thoroughly.


0

Is there a common way or a command to add/remove ca-certificates on linux to the "official" openssl stack on a machine? I can't find a proper duplicate but this has been answered before and the answer is: No, distro's use different locations for openssl and after adding a CA certificate to openssl's CA collection, you still have to provide for ...


0

I can see two options. You can backup the whole filesystem, than recreate it with higher number of inodes. Or you can mount another drive to the path with many files and move the files to that drive, so you will keep the structure as mentioned by @vembutech . Sadly, I can't upvote that one yet.


0

I figured it out, nothing wrong with rsync. In the 2nd step where I transfer the data in parallel I was using this: find /some/folder/structure/ -type f -mmin +60 | parallel -j4 'echo "starting `date` {}";rsync -av --no-compress --no-whole-file --quiet {} somehost.com::backup/somefolder/;echo "done `date` {}"' that causes all files to be written into the ...


0

The following is simple and awesome: python -m SimpleHTTPServer 8888 This starts a new http file server for current directory. Supposed there is a file named foo in current directory, you can download it like this: wget http://your.ip.here:8888/foo


0

From http://gagravarr.org/writing/openssl-certs/others.shtml#ca-openssl Another way to check On most OpenSSL builds, if you run the command openssl version -d it will report the directory used, eg OPENSSLDIR: "/usr/lib/ssl" (directory is /usr/lib/ssl). On some systems (eg Ubuntu), the path given from this will contain a symlink to the real ...


0

One option you can delete or move files to another drive. Or mount a higher capacity drive to a new directory on /dev/sda2 drive and move the files.


0

Thanks to the comments I was able to figure it out (I am rather new to this kind of admin stuff, didn't know well about envelope sender and so on...): As seen from the logs, the envelope sender used by sendmail when using PHP was www-data@MYSERVER.de, when using the command line it was alumpi@MYSERVER.de, so I tried changing them around. BUT this wasn't a ...


0

In addition to allowing DNS queries, you will need to allow traffic via port 9418. Git uses port 9418 to communicate. You don’t want to open up the port externally so I used stateful inspection to open the port only if we established the connection. # allow git sudo iptables -A OUTPUT -o eth0 -p tcp --dport 9418 -m state --state ...


1

I don't think iperf is be flexible enough to simulate user activity for various traffic types. Depending on how you're using pfsense (routing, gateway, proxy, whatever) it will experience different load types. So I would rather stick to one of the following tools: Apache JMeter - this one have GUI and doesn't require programming skills Grinder - this guy ...


0

iptables-DNAT rules will be replaced with the following settings. (Script execution user's .ssh/config) Host 10.20.30.40 Hostname 127.0.0.1 Port 1234 If ssh-portforward is running with the same user, I think it good to use the ProxyCommand. Host 10.20.30.40 ProxyCommand ssh server1.test.com nc %h %p


0

the issue is that when you update the JRE the cacerts gets overwritten and you have to (manually) add the certificates again That is exactly the use case for a configuration management tool, puppet in our case, which allows you to automate such things. In pseudo code a simple loop: For every installed Java version (on RHEL easily found with ...


0

You can use JAVA_OPTS to specify additional parameters when you start Tomcat. You can use -Djavax.net.ssl.keyStore=customkeystore. I use the JAVA_OPTS in tomcat7.conf which is just a symlink to setenv.sh. Hope this helps.


0

Changing /etc/ppp/pptpd-options to the following options worked for me: refuse-pap refuse-chap refuse-mschap #require-chap #require-mschap #require-mschap-v2 #require-mppe-128 mppe-stateful


0

Please keep in mind that this answer is very, very Linux specific. parent_pid=$$ while [[ -z "${tty_bits-}" || $tty_bits -ne 0 ]]; do read initiator_name parent_pid tty_bits < <( awk '{ print substr($2, 2, length($2) - 2) " " $4 " " $7 }' /proc/$parent_pid/stat ) done echo $initiator_name This makes a key assumption: the login process ...


1

I found the libreswan documentation helpful here concerning interop with Juniper. I feel your pain. VPN's are notoriously difficult to get just right. The seemingly smallest thing can render the connection unstable and/or useless. As such, I can't determine exactly which setting you posted above is wrong or missing so I'll comment on a few lines that may ...


2

The technique you want is called scientific method. With scientific method and some monitoring tools, you can diagnose the issue and take corrective action.


0

Beware: read this only if you have root access to both source and intermediate machines. Since you say source machine (let's call it A ) has no way to contact the destination one (called C ), I assume that there are routing or permission restrictions that prevent this. Restrictions that the intermediate (machine B) can avoid. You can make the source machine ...


0

First, the direct answer: Per the official rsync documentation, I can't find an explicit answer; it depends upon interpretation. However, I believe you're not seeing the correct behaviour. At any rate, I do have a recommendation. Per http://meta.stackexchange.com/questions/17204/six-simple-tips-to-get-reputation-fast-on-any-stack-exchange-site, ...


0

Either use VPN connections for this (all machines connected via private network) which is safer or port forwarding (which is not a bad idea), just remember to limit connection IP pool on machine in private network.


0

What you can usually get is the number of pages you printed with a toner cartridge and in some cases an average toner coverage in % of the page covered (on the B/W model I had this statistic, this pretty universally ended up with 5.0% coverage). These counters alone give you a pretty decent value for the average price of a printed page. I've never seen ...


1

wanted to comment on some answers, but couldn't (not enough reputation) so replying the question: YES, downgrade is needed so that nc can listen. and as for the other comments: a) -p is not supposed to be used when in listening mode. from nc manpage: -l Used to specify that nc should listen for an incoming connection rather than initiate ...


0

You can configure AMT locally when the system is booting. The "phone home" feature requires a bit more to make it work. You may want to take a look at using it with meshcentral.com. You can get the most from AMT without having to run any software on your own using it.


-1

I believe the right solution will be Split tunneling, or is what I will do in a client workstation, but your situation is a little different, because there is a server: is possible add a second network interface? In that case you can route all your VPN traffic by the first interface, and yet let your service listening by the second one.


0

If you want to timeout remote commands that are started non-interactively using ssh, you could use something like this : ( sleep $timeout && kill -9 0 ) 2>/dev/null & $cmd; RC=$? ; pkill -P $! ; exit $RC;


0

We ended up continuing with pwdx with sudo access as other options were more or less 'complicated' as this one.


1

If you don’t have the latest rsync (e.g., OS X has 2.6.9) and can’t use --info=progress2, here’s another alternative to save yourself from pages of scrolling text on progress: rsync -aPh <source> <destination> | xargs -L1 printf "\33[2K\rTransferring: %s" That will print out, on one line, the name of the latest file being transferred: ...


0

postfix/smtp[27379]: cannot load Certificate Authority data: disabling TLS support postfix/smtp[27379]: warning: TLS library problem: error:02001002:system library:fopen:No such file or directory:bss_file.c:169:fopen('/etc/postfix/cacert.pem','r'): Install certificates of Certification Authorities - they certify other certificates => install package ...


1

sudo mysql && sudo mysql -u root it's redundant command. Not assks for password because you have a file named /root/.my.cnf with with client name and password sudo mysql -u root -pask for passowrd because you put -p in your coammand (see man mysql) · --password[=password], -p[password] The password to use when connecting to the ...


0

This is so idiotic that is hard to explain why this is so bad. You asked for examples of what could go wrong. Here's one: If all applications that use the database server log in with an account that has read/write access to ALL databases, a single web app (like a WordPress site with a buggy or out-of-date plugin) can grant access to all databases. Data ...


-1

Running services exposed to Internet as root is not a big issue. Indeed, many daemons runs as root. Unless a security issue in a daemon is found or the root password is stolen, it is unlikely that an external attacker can edit your files through Apache or other services. If you have frequent, offsite, offline full system backups and a backup validation ...


1

Enabled/disabled states control if services are started/not started at boot. In this context I would suggest that the dependent services should stay disabled, and only the state of the umbrella service should be changed. To make umbrella service to start only some of the dependencies, they should be soft-linked into .requires directory of the umbrella ...


1

It's broken. Log into the ILO and it will tell you why. If your ILO is not configured (shame on you), you should then follow the HP troubleshooting flowchart. Can you give some information about what happened right before you wrote this question? A DL585 G5 dates back to 2007, so when did it last work? And what happened between then and now?


1

No, it's not possible via configuration. I'd recommend just having a counter in your program counting the number of requests it has made, and subtract this from the total. You can see the documentation for mod_status here; https://httpd.apache.org/docs/current/mod/mod_status.html As you can see, the only extra option you have is turning ExtendedStatus on. ...


0

With GNU bash 4: declare -i eighty_percent_ram_mb # set integer attribute while read -r a b c; do [[ $a =~ ^MemTotal: ]] && mem=$b; done < /proc/meminfo eighty_percent_ram_mb=$mem/100*80/1024


1

Enable common-auth (includes pam_unix.so), and change "required" to "sufficient". auth sufficient pam_radius_auth.so @include common-auth (2016/05/03 JST) settings for "fallback" auth [success=done default=bad authinfo_unavail=bad ignore=ignore] pam_radius_auth.so localifdown @include common-auth Results of pam_radius_auth in the following ...


0

Someone just tweeted this to me! eighty_percent_ram_mb=$(free -m | awk 'NR==2{printf "%.0f\n", $2*0.8 }') I tried it and it worked.


3

eighty_percent_ram_mb=$(free -m | awk 'NR==2{printf "%d", $2*0.8 }') Should do the job :)


0

Have you tried this: spawn ssh "$user\@$ip" instead of this: spawn ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "$user\@$ip" Other than that this looks like it should work. It might help if you have any errors or just the output of the script to share those.


0

Here is information from kernel.org how to use them. In my opinion, this is right echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore echo 1 > /proc/sys/net/ipv4/conf/eth0/arp_ignore ...... echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce echo 2 > /proc/sys/net/ipv4/conf/eth0/arp_announce .....


0

I used chkconfig to have my system automatically run a script once after boot and never again. If your system uses ckconfig (Fedora, RedHat, CentOs, etc) this will work. First the script: #!/bin/bash # chkconfig: 345 99 10 # description: This script is designed to run once and then never again. # ## # Beginning of your custom one-time commands # ...


1

You may use formail program to feed "one by one" messages in mailbox-file to program/script of your choice. Below please find elaborate example of using formail -s ... to process user system mailboxfile. It is provided in man procmail and makes procmail process every message in the system mailbox. #!/bin/sh ORGMAIL=/var/mail/$LOGNAME if cd $HOME ...


1

There is a list of squid analyzers but unfortunately some of them seem to be out of date. http://www.squid-cache.org/Misc/log-analysis.html In the past I used LightSquid but it requires Apache. I tested with Calamaris and found that this old perl script worked perfect. mkdir logfile cd logfile/ wget http://cord.de/files/calamaris/calamaris-2.59.tar.gz ...



Top 50 recent answers are included