openssl verify -verbose -x509_strict -CAfile gd_bundle-g2-g1.crt 39aaf24e9f2b1f6f.crt
nJoy;-)
openssl verify -verbose -x509_strict -CAfile gd_bundle-g2-g1.crt 39aaf24e9f2b1f6f.crt
nJoy;-)
Sometimes you have a multi threaded / multi processed application and you need to see where are things hanging.
ps auxw | grep sbin/apache | awk '{print"-p " $2}' | xargs strace
nJoy 😉
You could add the sysctl line to the system or in the /etc/init.d/
{
"Version":"2012-10-17",
"Statement":[
{
"Action":[
"s3:*"
],
"Effect":"Allow",
"Principal":{
"AWS":[
"arn:aws:iam::ACCOUNT_ID:user/USERNAME_A",
"arn:aws:iam::ACCOUNT_ID:user/USERNAME_B",
"arn:aws:iam::ACCOUNT_ID:user/USERNAME_C",
"arn:aws:iam::ACCOUNT_ID:role/ROLE_A",
"arn:aws:iam::ACCOUNT_ID:role/ROLE_B",
"arn:aws:iam::ACCOUNT_ID:role/ROLE_C"
]
},
"Resource":[
"arn:aws:s3:::BUCKET_NAME",
"arn:aws:s3:::BUCKET_NAME/*"
]
}
]
}
Epel’s yum install does not cut it anymore at time of writing installing node.js causes a mass of 404s and file not found.
current best approach :
Including Red Hat® Enterprise Linux® / RHEL, CentOS and Fedora.
Node.js is available from the NodeSource Enterprise Linux and Fedora binary distributions repository. Support for this repository, along with its scripts, can be found on GitHub at nodesource/distributions.
Note that the Node.js packages for EL 5 (RHEL5 and CentOS 5) depend on the EPEL repository being available. The setup script will check and provide instructions if it is not installed.
Run as root on RHEL, CentOS or Fedora, for Node.js v4 LTS Argon:
curl --silent --location https://rpm.nodesource.com/setup_4.x | bash -
Alternatively for Node.js v5:
curl --silent --location https://rpm.nodesource.com/setup_5.x | bash -
Alternatively for Node.js 0.10:
curl --silent --location https://rpm.nodesource.com/setup | bash -
Then install, as root:
yum -y install nodejs
Optional: install build tools
To compile and install native addons from npm you may also need to install build tools:
yum install gcc-c++ make # or: yum groupinstall 'Development Tools'
Available architectures:
Supported Red Hat® Enterprise Linux® versions:
Supported CentOS versions:
Supported CloudLinux versions:
Supported Fedora versions:
Other distributions known to be supported:
nJoy 😉
This is a simple sample configuration for the impatient.
AddOutputFilterByType DEFLATE text/html text/plain text/xml
The following configuration, while resulting in more compressed content, is also much more complicated. Do not use this unless you fully understand all the configuration details.
<Location />
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</Location>
ref: Apache Doc
nJoy 😉
cat graph.log.heavy | awk -F, -vOFS=, '{l=$0; $1=""}; ! ($0 in seen) {print l; seen[$0]}' > graph.log
nJoy 😉
pm2 start app.js --log-date-format 'DD-MM HH:mm:ss.SSS'
nJoy 😉
If you need to automate firewall settings for AWS by service this is a real time source of info you can pro grammatically use.
https://ip-ranges.amazonaws.com/ip-ranges.json
nJoy 😉
With `openssl`, it’s not too hard.
(Note: If you’re on OSX, you should install the latest versions of OpenSSL and OpenSSH with Homebrew.)
First, let’s start with our plaintext file:
echo "Yo test!!" > clear.txt
Before we can encrypt the text file with our public key, we must export our public key into a PEM format suitable for OpenSSL.
openssl rsa -in ~/.ssh/id_rsa -pubout > ~/.ssh/id_rsa.pub.pem cat ~/.ssh/id_rsa.pub.pem
It should look something like this:
-----BEGIN PUBLIC KEY----- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-----END PUBLIC KEY-----
cat plain.txt | openssl rsautl -encrypt -pubin -inkey ~/.ssh/id_rsa.pub.pem > encrypted.txt
The important command in the pipeline is `openssl`. The first argument passed to `openssl` is the OpenSSL command you are running. It has a wide variety of commands covering a wide range of cryptographic functionality. For our purposes, we’re doing public/private RSA encryption, so we’re using the RSA Utility, or `rsautl`, command. Next, the `-encrypt` key indicates we are encrypting from plaintext to cipher text, and finally the `-pubin` flag indicates we are loading a public key from `-inkey [public key file]`.
Print the contents of the encrypted with `cat encrypted.txt`.
You should see non readable stuff.
cat encrypted.txt | openssl rsautl -decrypt -inkey ~/.ssh/id_rsa
“Yo test!!”
Voila`! We’re back to clear text.