Skip to content

Instantly share code, notes, and snippets.

View luismayta's full-sized avatar
😎
life is fun, so is coding

Lucho Mayta luismayta

😎
life is fun, so is coding
View GitHub Profile
@Skinner927
Skinner927 / init.lua
Last active November 15, 2020 22:10
Hammerspoon auto screen position script
hs.urlevent.bind('reload', function(eventName, params)
hs.reload()
end)
hs.urlevent.bind('currentScreenTag', function(eventName, params)
alert(getScreenTag())
end)
hs.urlevent.bind("printLayout", function(eventName, params)
config = {}
@jvlad
jvlad / updateVSCodeExtensionsInstallationScript.sh
Last active August 3, 2023 22:00
Export Installed Visual Studio Code Extensions in a Form of Installation Script
#!/usr/bin/env zsh
#
# This script generates and writes to file another bash-script (output_script)
# that implements "vscodeInstallExtensions" function which installs all
# Visual Studio Code extensions that were originally installed on your machine
# at the moment of generation output_script by running
# "vscodeUpdateExtensionsInstallationScript" function that is implemented here below.
#
# # How to use
#
@webframp
webframp / keybase.md
Created July 25, 2017 18:14
Signing git commits on github using keybase.io gpg key

Probably one of the easiest things you'll ever do with gpg

Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH

First get the public key

keybase pgp export | gpg --import

Next get the private key

@zamber
zamber / ssh-telegram.sh
Last active November 1, 2019 07:05 — forked from matriphe/ssh-telegram.sh
Bash Script to notify via Telegram Bot API when user log in SSH
# save it as /etc/profile.d/ssh-telegram.sh
# use sed to parse JSON from ipinfo.io
# you can get your user_id by writing to @get_id_bot
USERID="<target_user_id>"
KEY="<bot_private_key>"
TIMEOUT="10"
URL="https://api.telegram.org/bot$KEY/sendMessage"
DATE_EXEC="$(date "+%d %b %Y %H:%M")"
TMPFILE='/tmp/ipinfo-$DATE_EXEC.txt'
if [ -n "$SSH_CLIENT" ] && [ -z "$TMUX" ]; then
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active May 7, 2024 22:00
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@chrisjhoughton
chrisjhoughton / README.md
Last active May 19, 2023 04:36
Notify tray workflows "webhook style" from Salesforce using Apex triggers.

Salesforce Apex trigger notifications for tray.io

Salesforce's Apex triggers allow you to trigger tray workflows in real-time, based on events that occur in Salesforce. Events include things like:

  • New lead creations
  • Opportunity updates, such as the status moving from "open" to "closed"

Salesforce doesn't support webhooks out of the box, so we'll need to add some Apex code to your Salesforce account to notify tray at the right time.

@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active April 13, 2024 12:22
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@webinista
webinista / RunAProxyOnAmazonEC2VPC.md
Last active April 27, 2024 12:21
Create a proxy server on an Amazon EC2 (VPC) instance

This will create a proxy server in whatever your availability zone your VPC is in. For me, that's us-east-1b. For you, that may be something different. Steps 10+ should more or less work regardless of your provider since those steps cover the setup and configuration of TinyProxy.

  1. Click the Launch Instance button.
  2. Choose Ubuntu Server 14.04 LTS (HVM), SSD Volume Type. This isn't strictly necessary. If you choose another OS, check its documentation for how to install new packages.
  3. On the Choose an Instance Type screen, select t2.micro. It's Free Tier eligible.
  4. Click the Next: ... buttons until you reach the Configure Security Group screen.
    • You may wish to reduce the amount of storage on the Add Storage screen. This is optional.
    • You may wish to add a tag on the Tag Instance screen. This is also optional.
  5. On the Configure Security Group screen:
  • Select Create a new security group.
@andru255
andru255 / Readme.md
Last active February 5, 2018 04:09
Single bash to install/uninstall a specific version of emacs editor (24.5)

IMPORTANT NOTE: Only tested under linux/debian 7.0

For use this bash it needs run in the $HOME folder and execute this command:

~ sudo chmod +x install_emacs_24.5.sh

Then:

~ ./install_emacs_26.sh