Skip to content

Instantly share code, notes, and snippets.

Procedure
Take the file you exported (e.g. certname.pfx) and copy it to a system where you have OpenSSL installed. Note: the *.pfx file is in PKCS#12 format and includes both the certificate and the private key.
Run the following command to export the private key: openssl pkcs12 -in certname.pfx -nocerts -out key.pem -nodes
Run the following command to export the certificate: openssl pkcs12 -in certname.pfx -nokeys -out cert.pem
Run the following command to remove the passphrase from the private key: openssl rsa -in key.pem -out server.key
[program:hubot]
command=/usr/bin/coffee node_modules/.bin/hubot --name ozux --adapter slack
directory=/usr/local/bot/hubot.ozux-bot
stdout_logfile=/var/log/%(program_name)s-stout.log
stderr_logfile=/var/log/%(program_name)s-stderr.log
stdout_logfile_backups=10
stderr_logfile_backups=10
user=ubuntu
startsecs=10
autorestart=true
@damaya
damaya / postgre inyect
Created February 14, 2017 12:51
Operaciones postgre
1. Log into postgre: sudo su - postgres
2. create db: createdb newdb
3. Inyect db psql worlddb < world.sql
---
Ingres to specific db, specific user
psql --username=awx --password --dbname=awx
Dumb database
pg_dump --username=awx --password --dbname=awx > /tmp/awx-tower.sql
https://github.com/symfony/security-bundle/blob/master/Resources/config/security.xml
@damaya
damaya / gist:0333e39f540ce9ff5d6f
Created September 4, 2015 04:05
some sed and vim replace queries
Replace only last ocurrence
:s/.*\zsts server thread txn_id txn_time user hostname ip db tbl idx lock_type lock_mode wait_hold victim query//
Replace with seed
sed 's/ts server thread txn_id txn_time user hostname ip db tbl idx lock_type lock_mode wait_hold victim query/<replacewiththis>/g' newdeadlock.log > changedeadlock.log
@damaya
damaya / gist:86d8de23f29f5f942da2
Created August 14, 2015 16:10
Escape slash in vim replace
:%s/\//-/g
@damaya
damaya / gist:f67885b25c34299085e9
Created August 6, 2015 19:40
Grep users connected to server by ssh
lsof -i TCP -P | grep ssh
UPDATE `admin_user` SET `password` = MD5('newpassword') WHERE `username` = 'adminusername';
@damaya
damaya / gist:20f785ddaad226002871
Created May 16, 2015 00:51
Contribuir con validación de environment del ezpublish kernel y justificarlo
*/
public function registerContainerConfiguration( LoaderInterface $loader )
{
$environment = $this->getEnvironment();
$loader->load( __DIR__ . '/config/config_' . $environment . '.yml' );
$configFile = __DIR__ . '/config/ezpublish_' . $environment . '.yml';
if ( !is_file( $configFile ) )
{
$configFile = __DIR__ . '/config/ezpublish_setup.yml';
@damaya
damaya / gist:80bb28e27ac5fbf47437
Created January 22, 2015 16:04
Lista de frameworks y herramientas para aprender
RabbitMQ
http://www.rabbitmq.com/
Redis
http://redis.io/
Mandrill
https://mandrill.com/
Erlang