Tikejhya: Ashish Nepal

Knowledgebase

Month: July 2013 (Page 1 of 2)

Postfix delete certain email queue

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

mailq | grep -i “tikejhya@ashishnepal.com” | awk ‘{ print $1 }’ | cut -d”*” -f1 | postsuper -d –

kernel: php-cgi[7094]: segfault at

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Apr 23 17:50:12 web1 kernel: php-cgi[7094]: segfault at ffffffffffffffff ip 00007f27b67e67b8 sp 00007ffff22d8f28 error 6 in libpthread-2.12.so[7f27b67dc000+17000]

Solution:

This is permision issue.
[probably check ur php.ini path for apc or things like that]

varnish tips & Tricks

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Varnish Troubleshoot

varnishtop

# most often-made requests to the backend:
varnishtop -b -i TxURL
varnishtop -i rxurl

# Client Encoding type
varnishtop -i RxHeader -I Accept-Encoding

# Show User Agents accessing your server through Varnish:
varnishtop -i RxHeader -I ^User-Agent

varnishlog

# Varnish adds a Age header to indicate how long the object has
varnishlog -i TxHeader -I ^Age

# Varnish grep status Code 503
varnishlog -m TxStatus:503

# To see the client requests
varnishlog -c -m ReqStart:$CLIENTIP

# To see the backend requests, match on the TxHeader.
varnishlog -b -m TxHeader:$BACKENDIIP

varnishhist

# histogram for the past 1000 requests, cache hits (denoted by a ‘|’) and misses (denoted by a ‘#’),

varnishhist

Nginx SSL Termination, Varnish

If you are looking for ssl termination on varnish, i would assume you have enough knowledge of configuring varnish and looking into this you must be able to configure ssl termination including Client-IP forwarding.

Default location with 444 error would make sense to forward any unwated traffic, you may want to google it around if its not already in www.ashishnepal.com 😉

server {
### server port and name ###
listen 192.168.1.24:443;
ssl on;
server_name www.tikejhya.com;

### SSL log files ###
access_log logs/ssl-access.log;
error_log logs/ssl-error.log;

### SSL cert files ###
ssl_certificate /var/certs/tikejhya.com.crt;
ssl_certificate_key /var/certs/tikejhya.com.key;

ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers RC4:HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
keepalive_timeout 60;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;

location / {
# Pass the request on to Varnish.
proxy_pass http://127.0.0.1;

# Pass a bunch of headers to the downstream server, so they’ll know what’s going on.
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

# Most web apps can be configured to read this header and understand that the current session is actually HTTPS.
proxy_set_header X-Forwarded-Proto https;
# We expect the downsteam servers to redirect to the right hostname, so don’t do any rewrites here.
proxy_redirect off;
}
}

Varnish SSL Termination

Varnish ssl termination can be done using Nginx, and Nginx would be my first choice too, You can find nginx tutorial all over the place including here , so i wanted to stick it here in my blog who to do ssl termination with pounds.

# Pounds https with varnish

User “pound”
Group “pound”
Control “/var/lib/pound/pound.cfg”

ListenHTTPS
Address 0.0.0.0
Port 443
Cert “/var/certs/tikejhya.com.pem”
Service
BackEnd
Address 192.168.1.88
Port 443
End
End
End

shell-init: error retrieving current directory: getcwd: cannot access parent directories:

shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

This is not a bash problem. You’re in a directory which can be read and
searched only by root, and you’re su’ing to another user. That user
does not have permission to search the current directory, even to find
`..’, so getcwd is going to fail.

su –

Remove saved svn Password

how to remove saved svn password

/root/.subversionauth/svn.simple/ <>

Remove All duplicate lines

SED
Remove All duplicate line.

:g/%(^1>.*$n)@<=(k+).*$/d Replace Newline To space :%s/n/ /g

Cronjob Every odd/Even Minute

Every odd minute would be:
1-59/2 * * * *

Every even minute would be:
0-58/2 * * * *

sftp command line

[root@monitor relay]# sftp -oPort=2134 tikejhya@ashishnepal.com:/data/files
Connecting to ashishnepal.com…
tikejhya@ashishnepal.com’s password:
Changing to: /data/files
sftp>

Page 1 of 2

Powered by WordPress & Theme by Anders Norén