Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
docker run -v ~/docker/redmine:/root/shared -p 8080:3000 --restart=unless-stopped -d --name redmine redmine:3.3.0
@ipepe
ipepe / install_pg.sh
Last active August 23, 2017 15:04
Install pg gem when using Postgress.app on Mac
#!/bin/bash
gem install pg -v '0.19.0' -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/latest/bin/pg_config
# or just add bin of Postgress app into PATH env
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/latest/bin
https://github.com/lesaff/serverpilot-letsencrypt
https://serverpilot.io/community/articles/how-to-force-SSL-by-redirecting-http-to-https.html
@ipepe
ipepe / dump_pg_database.sh
Created December 11, 2017 12:34
Dumping command for postgres database backup
pg_dump -d DATABASE_NAME -Fp | bzip2 > dbdump_`date +"%F-%H-%M-%S"`.sql.bz

Why it's not written anywhere? Unauthorized USB device:

MBP-A1278-ipepe:~ patryk$ adb devices
List of devices attached
0b06b8360328c13a    unauthorized

Authorized USB device:

@ipepe
ipepe / function.js
Created June 27, 2018 21:10
Azure Function that responds with image (content type)
module.exports = function (context, req) {
var image_str = "/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMTEhUTExMWFhUXGBkYFxgXGCAdIBkXGxoWGB8eGBseHiggGB8lHRgWITEjJSkrLi4uGB8zODMtNyotLisBCgoKDg0OFxAQGi4dHR8tLSstLS0tLS0rLS0tKy0tLS0tLS0tKy0tKy0tLSstLS0rLS0tLSstLTctLS0tLS03Lf/AABEIAOEA4QMBIgACEQEDEQH/xAAcAAEAAgMBAQEAAAAAAAAAAAAABQYDBAcCAQj/xAA+EAABAwIEBAQDBwMDAwUBAAABAAIRAyEEEjFBBQZRYRMicYEykaEHQrHB0eHwFFLxI2JyFTOiJENTksIW/8QAGAEBAQEBAQAAAAAAAAAAAAAAAAECAwT/xAAdEQEBAAIDAQEBAAAAAAAAAAAAAQIREiExUQNB/9oADAMBAAIRAxEAPwDqvHMU4HIKhpg7tALvYmwHstKhWrtgsxIqgTLazAJGsB7AMvaQVp85PiqP+IP4+y1uFY4PbBEj1/Zcva6zHpccDxBtS0Frxqx2o39CO4st1U19YiA4kQfJUDSTT99COrNFvs5oZTc1mJimXGGVAZpv0gh33SST5TcR7qzLXVYuPxY0WB+MY0SXNA6kjufyPyUJj+dsFSs/EMBmNfr6d1vbOliRUyn9p3DiJNcDaIJ/JZm/aNw8vDRXYZMZtvc7bJtdLaij+H8aoVgDTqNdImzhaVu+IOoVR6K1cXjmMIBkuOjWiSfYbdzZR2N463K7IfKCWmpFrRPh7PM2nQfRRWCrvqOJAe1nVzTL+5dqT22GixcvjUx+pn/qtWR/6d0b+dkj2DrqRwmID25h/g9xsqpjK8fCe42Vi4PUzMDv7gCYG/XvsrKWJBERaZEREBERAREQEREBERAREQEREFV57wmamHj7uvouZU+MPomPKRPlzE5R3IGq67zV/wBmMpdm
@ipepe
ipepe / smc-control.1s.rb
Created August 2, 2018 12:46
Cool but louder custom smc-controlled bitBar script
#!/usr/bin/env /Users/pptasinski/.rbenv/shims/ruby
MIN_TEMP = 40.0
MAX_TEMP = 70.0
FANS = {
0 => { min: 2200, max: 6100, delta: 6100-2200 },
1 => { min: 2100, max: 5600, delta: 5600-2100 }
}.freeze
temperature = `/usr/local/bin/smc -k TC0F -r`.match(/\d\d\.\d\d\d/).to_s.to_f
@ipepe
ipepe / gitlab-runner-in-docker.sh
Created September 2, 2018 11:58
Gitlab Runner in Docker
docker run -d --name gitlab-runner --restart always -v /var/run/docker.sock:/var/run/docker.sock -v /opt/docker/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner:latest
docker exec -it gitlab-runner /bin/bash
gitlab-runner register
@ipepe
ipepe / deploy.rb
Last active September 2, 2018 16:43
Add my id_rsa.pub to authorized_keys in Capistrano
task :add_my_key_to_authorized_keys do
unless `cat "$HOME/.ssh/id_rsa.pub"`.empty?
id_rsa_pub_path = `echo "$HOME/.ssh/id_rsa.pub"`.strip
on roles(:all) do
upload! id_rsa_pub_path, "/tmp/id_rsa.pub"
execute 'cat /tmp/id_rsa.pub .ssh/authorized_keys | sort -u -o .ssh/authorized_keys'
execute 'cat .ssh/authorized_keys'
end
end
end
#!/bin/bash
docker run -p 5984:5984 -e COUCHDB_USER=admin -e COUCHDB_PASSWORD=admin --restart=unless-stopped -d --name couchdb couchdb