Skip to content

Instantly share code, notes, and snippets.

View Run services using Docker
#### Postgres
# Run Postgres 10
sudo docker run --rm --name postgres10 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRE_PORT=5433 -p 5433:5432 postgres:10
# Connect to Postgres 10
psql -p 5433 -U postgres -h 172.17.0.1
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active February 6, 2023 15:01
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)
View letsencrypt_2020.md

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@Faheetah
Faheetah / Jenkinsfile.groovy
Last active December 27, 2022 19:17
Jenkinsfile idiosynchrasies with escaping and quotes
View Jenkinsfile.groovy
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@joekr
joekr / Dockerfile-Nginx
Last active April 14, 2021 13:24
Kubernetes + Rails (NGINX & Unicorn) on GCE
View Dockerfile-Nginx
# Set nginx base image
FROM nginx
# Copy custom configuration file from the current directory
COPY nginx.conf /etc/nginx/nginx.conf
@shiroyasha
shiroyasha / dog.rb
Created February 16, 2016 22:20
Method tracer for Ruby classes
View dog.rb
class Dog
attr_writer :name
def initialize(name)
@name = name
end
def bark
puts "patrick"
end
@profh
profh / decode_session_cookie.rb
Last active June 23, 2021 13:25
A simple script to decode Rails 4 session cookies
View decode_session_cookie.rb
@maxx1337
maxx1337 / redis-sentinel
Last active August 29, 2015 14:01 — forked from mathieue/sentinel
save redis-sentinel into /etc/init.d/
View redis-sentinel
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-sentinel
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts redis sentinel
# Description: Starts redis sentinel using start-stop-daemon
### END INIT INFO
@dyerc
dyerc / sidekiq
Last active February 27, 2020 10:45
Sidekiq init script
View sidekiq
#!/bin/bash
# sidekiq Init script for Sidekiq
# chkconfig: 345 100 75
#
# Description: Starts and Stops Sidekiq message processor for Stratus application.
#
# User-specified exit parameters used in this script:
#
# Exit Code 5 - Incorrect User ID
# Exit Code 6 - Directory not found
@mathieue
mathieue / sentinel
Created February 4, 2013 16:19
redis sentinel startup script
View sentinel
#!/bin/bash
### BEGIN INIT INFO
# Provides: redis sentinel
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts redis sentinel
# Description: Starts redis sentinel using start-stop-daemon
### END INIT INFO
View captcha_minteye.md

minteye is a captcha system where you try to find the original image out of distorted ones. They also have a feature list on their website but they forgot the view from a computer. I fixed it:

minteye captcha features

There are two ways to crack this captcha easily. I've used the audio challange. There are three different kind of audio messages.

  1. move the slider to the right
  2. move the slider to the left
  3. slider is in the correct position