Skip to content

Instantly share code, notes, and snippets.

View dpmex4527's full-sized avatar

Daniel Perez dpmex4527

  • Austin, TX
View GitHub Profile
@dpmex4527
dpmex4527 / query_in_curl.md
Last active November 15, 2018 21:30
Search Pull Request that contains a specific commit hash

You can execute the query using the following curl command

curl --request POST \
  --url https://api.github.com/graphql \
  --header 'authorization: Bearer <GITHUB_TOKEN>' \
  --header 'content-type: application/json' \
  --data '{"query":"query SearchPullRequestFromCommitSha {\n  search (\n    first: 100, type: ISSUE,\n    query: \"type:pr repo:octokit/octokit.rb cd410f734e090e49d0f6e1ccff7ad3403259bd4d\"\n  ) {\n    nodes {\n      ... on PullRequest {\n        id, number, title, headRefName\n      }\n    }\n  }\n}","operationName":"SearchPullRequestFromCommitSha"}'
@dpmex4527
dpmex4527 / docker_svn-server.md
Last active April 20, 2024 23:38
Set up SVN server on docker
@dpmex4527
dpmex4527 / CheckSSL.md
Created April 21, 2017 14:57
Check SSL cert

Check if ssl cert on server is valid

echo | openssl s_client -connect google.com:443

@dpmex4527
dpmex4527 / DockerRedis.md
Created April 21, 2017 14:54
Start a Redis Docker container

Start a docker redis container

Start container

docker run --name redis --restart always -p 6379  -v /home/ubuntu/workspace/docker/redis:/data -d redis redis-server --appendonly yes

Connect to it using redis-cli container

@dpmex4527
dpmex4527 / sendEmail.py
Created April 21, 2017 14:49
Send email using python
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from email.MIMEBase import MIMEBase
from email import encoders
fromaddr = "YOUR EMAIL"
toaddr = "EMAIL ADDRESS YOU SEND TO"
msg = MIMEMultipart()
@dpmex4527
dpmex4527 / git-bomb.sh
Created April 11, 2017 22:47 — forked from kylemacey/git-bomb.sh
This gist will create a custom git script that will delete any branches that are fully merged into the currently checked out branch (usually run on master)
mkdir -p ~/scripts/git
echo 'git branch --merged | grep -v "\*\|master" | xargs -n 1 git branch -d' > ~/scripts/git/git-bomb
echo 'git remote prune origin' >> ~/scripts/git/git-bomb
chmod +x ~/scripts/git/git-bomb
sudo ln -s ~/scripts/git/git-bomb /usr/bin/git-bomb