Skip to content

Instantly share code, notes, and snippets.

View rchamorro's full-sized avatar

Richard Chamorro rchamorro

View GitHub Profile
@rchamorro
rchamorro / README.md
Created April 4, 2019 08:43 — forked from denji/README.md
Simple Sentry docker-compose.yml
  1. Download docker-compose.yml to dir named sentry
  2. Change SENTRY_SECRET_KEY to random 32 char string
  3. Run docker-compose up -d
  4. Run docker-compose exec sentry sentry upgrade to setup database and create admin user
  5. (Optional) Run docker-compose exec sentry pip install sentry-slack if you want slack plugin, it can be done later
  6. Run docker-compose restart sentry
  7. Sentry is now running on public port 9000
@rchamorro
rchamorro / create_slug_from_title.sql
Last active February 20, 2017 09:57
Create slug from title avoiding duplicated slugs with TSQL
WITH SlugTable AS
(
SELECT Id, CASE WHEN N > 1 THEN CONCAT(RTRIM(slug), '-', n) ELSE slug END AS NewSlug
FROM (
SELECT Id
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(RTRIM(LTRIM(LOWER(Title))), ' ', '-'), '/', '-'), '(',''), ')',''), '--','-'),'--','-'),'''','-'),'á','a'),'é','e'),'í','i'),'ó','o'),'ú','u'),'à','a'),'è','e'),'ò','o') AS Slug,
ROW_NUMBER() OVER (PARTITION BY [Name] ORDER BY [Id]) as N from Posts n
) AS Q
)
Update Posts
@rchamorro
rchamorro / haproxy.cfg
Last active August 29, 2015 14:06 — forked from GABeech/haproxy.cfg
# This is an example of the Stack Exchange Tier 1 HAProxy config
# The only things that have been changed from what we are running are:
# 1. User names have been removed
# 2. All Passwords have been remove
# 3. IPs have been changed to use the example/documentation ranges
# 4. Rate limit numbers have been changed to randome numbers, don't read into them
userlist stats-auth
group admin users $admin_user
user $admin_user insecure-password $some_password