Skip to content

Instantly share code, notes, and snippets.

View edco29's full-sized avatar
🏠
Working from home

Edwin Contreras edco29

🏠
Working from home
View GitHub Profile
@edco29
edco29 / DefaultKeyBinding.dict
Created February 4, 2024 18:30 — forked from trusktr/DefaultKeyBinding.dict
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@edco29
edco29 / exportOptions.plist
Created November 24, 2023 14:10 — forked from skabber/exportOptions.plist
Export Options Plist Example
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>app-store</string>
<key>teamID</key>
<string>XXXXXXXXXX</string>
<key>uploadBitcode</key>
<true/>
@edco29
edco29 / Jenkinsfile
Created October 18, 2023 22:22 — forked from oifland/Jenkinsfile
Loops in Jenkinsfiles
// Related to https://issues.jenkins-ci.org/browse/JENKINS-26481
abcs = ['a', 'b', 'c']
node('master') {
stage('Test 1: loop of echo statements') {
echo_all(abcs)
}
stage('Test 2: loop of sh commands') {
@edco29
edco29 / ruby proxy
Created September 1, 2023 21:47 — forked from gmic/ruby proxy
Ruby: install gems behind a proxy
gem install --http-proxy http://user:password@some.proxy.com:8080 bundler
@edco29
edco29 / del_branch.sh
Created July 25, 2023 17:48 — forked from skdubey/del_branch.sh
This script will pull all the branches from your Bitbucket repository of all the projects and their repositories, find the merged branches older than 30 days and delete it.
#!/bin/bash
## Get the list of all the projects from Bitbucket account across all the pages
get_total_project_list () {
start=0
total_project_list=()
is_last_page=false
while ! $is_last_page
do
response=$(curl -k -u $u -X GET -H "Content-type: application/json" $bitbucket_url/rest/api/1.0/projects?start=$start) 2>&1
#! /usr/bin/env python3
'''pyCookieCheat.py
2015022 Now its own GitHub repo, and in PyPi.
- For most recent version: https://github.com/n8henrie/pycookiecheat
- This gist unlikely to be maintained further for that reason.
20150221 v2.0.1: Now should find cookies for base domain and all subs.
20140518 v2.0: Now works with Chrome's new encrypted cookies.
See relevant post at http://n8h.me/HufI1w
@edco29
edco29 / gist:1dba8a1f9d183a94e0fb66133a43effe
Created December 24, 2021 15:04 — forked from Khoulaiz/gist:41b387883a208d6e914b
Checking ports without telnet

Here are several different ways to test a TCP port without telnet.

$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C

$ cat &lt; /dev/tcp/127.0.0.1/23
@edco29
edco29 / Dockerfile1
Created April 23, 2021 06:19 — forked from xeoncross/Dockerfile1
Examples of using multi-stage builds with docker and Go to reduce the final image size / attack surface.
# Sample from @citizen428 https://dev.to/citizen428/comment/6cmh
FROM golang:alpine as build
RUN apk add --no-cache ca-certificates
WORKDIR /build
ADD . .
RUN CGO_ENABLED=0 GOOS=linux \
go build -ldflags '-extldflags "-static"' -o app
FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt \
@edco29
edco29 / sample.sh
Created January 22, 2021 23:47 — forked from e7d/sample.sh
Bash "try catch"
#!/bin/bash
export AnException=100
export AnotherException=101
# start with a try
try
( # open a subshell !!!
echo "do something"
[ someErrorCondition ] && throw $AnException
@edco29
edco29 / multiple_ssh_setting.md
Created December 11, 2020 14:50 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"