Create htpasswd entry and print to stdout:
$ sudo apt install apache2-utils # Optional
$ htpasswd -n $USERNAME
New password:
Re-type new password:
$USERNAME:<Password Hash>
Brendan Gregg is the Linux performance god. Use the information in this link to find out what ways there are for performacne analysis.
This link is shows the more sophisticated way and encourages to dig deeper for optimizing your system. If you're in a hurry look at Linux Performance Analysis in 60,000 Milliseconds
We want to make the following firewall rule to be applyable to different network interfaces (for e.g. different environments) with just one variable:
firewall { "010-reject-port":
ensure => present,
dport => [ 80 ],
destination => $::ipaddress_eth0,
proto => 'tcp',
action => 'drop',
iniface => 'eth0',
}
We can create a $firewall_interface
variable and apply it to iniface
but how can we ensure that the correct ipaddress
factof the corresponding interface is used for `destina...
Bash stores the exitcodestatus of piped commands in the environment variable PIPESTATUS
So you can just echo ${PIPESTATUS[@]}
to get them all.
13:52:30 ✔ claus:~$ ps ax | grep /usr/bin/ruby
13205 pts/20 S+ 0:00 grep --color=auto /usr/bin/ruby
13:52:43 ✔ claus:~$ echo ${PIPESTATUS[@]}
0 0
PIPESTATUS
is an array, so you can get the exitcode of an specific command (first pipe):
13:54:20 ✔ claus:~$ echo ${PIPESTATUS[1]}
0
If you need the debug output of the puppetmaster running with passenger you have to uncomment this setting in the config.ru
:
#ARGV << "--debug"
If you don't know where your config.ru
is, check the Apache DocumentRoot
. It's in /path/to/DocumentRoot/../config.ru
. For example if your DocumentRoot is /etc/puppet/rack/public/
the config.ru
is in /etc/puppet/rack/config.ru
.
The exim documentation says:
Freezing occurs when a bounce message encounters a permanent failure because the sender address of the original message that caused the bounce is invalid, so the bounce cannot be delivered. This is probably the most common case, but there are also other conditions that cause freezing, and frozen messages are not always bounce messages.
By default, frozen bounce messages will b...
swaks is a very nice tool to test SMTP. For the most linux distributions you can easily install it with your package management system.
This example send an email from from@example.com
to to@example.com
via the server mail23.example.com
with the user from@example.com
and password mysupersecurepasswordyouneverget
for authentication and require the connection to use STARTTLS.
$ swaks -tls --to to@example.com --from from@example.com --auth-user from@example.com --server mail23.example....
Install and configure the AWS Command Line Interface
Show existing certificates to test if the AWS Cli is working:
$ aws iam list-server-certificates
{
"ServerCertificateMetadataList": [
{
"Path": "/",
"Arn": "arn:aws:iam::5xxxxxxxxxxx:server-certificate/www.example.com-201307-201407",
"ServerCertificateId": "AXXXXXXXXXXXXXXXXXXXX",
"ServerCertificateName": "www.example.com-201210-201310",
...
I'm creating certificate requests with this command:
openssl req -new -out www.example.com.csr -keyout www.example.com.key -newkey rsa:2048 -nodes
When I try to upload the certificate to AWS IAM I get this error:
$ aws iam upload-server-certificate --server-certificate-name www.example.com-2013010-2014010 --certificate-body www.example.com.crt --private-key www.example.com.key --certificate-chain www.example.com.ca-bundle
A client error (MalformedCertificate) occurred: Invalid Public Key Certificate.
That's because o...
Create a 1 GB file to swap to (we have sufficient space on / on this machine. Use a different partition if necessary)
sudo dd if=/dev/zero of=/var/swapfile bs=1M count=1024
If you prefer 2GB swap, chose count=2048
, 4GB: count=4096
Change permissions of swap file:
sudo chmod 0600 /var/swapfile
Set up swap file and enable it:
sudo mkswap /var/swapfile
sudo swapon /var/swapfile
You should see your swap space now:
thomas@machine:~$ free -m
total used free shared buffers...
This is a way to run multiple redis server on one ubuntu server.
Change some Variables.
From this:
DAEMON_ARGS=/etc/redis/redis.conf
NAME=redis-server
DESC=redis-server
PIDFILE=/var/run/redis.pid
to this:
NAME=`basename ${0}`
DAEMON_ARGS=/etc/redis/${NAME}.conf
DESC=${NAME}
PIDFILE=/var/run/${NAME}.pid
These steps y...