Skip to content

Instantly share code, notes, and snippets.

View DavidPesticcio's full-sized avatar
🚀
¯\_(ツ)_/¯

David Pesticcio DavidPesticcio

🚀
¯\_(ツ)_/¯
View GitHub Profile
@DavidPesticcio
DavidPesticcio / gist:4183e951df084992bffa1421db442ab3
Created February 20, 2017 19:53 — forked from wikimatze/gist:9790374
Github Two-Factor Authentication Failed For HTTPS

I heard from GitHub Two-Factor Authentication](https://github.com/blog/1614-two-factor-authentication) nearly a couple of days ago when I was reading my RSS feed. I enabled it and couldn' push to any of my repositories anymore. Learn in this blog post how to fix it.

Two-Factor Authentication

"Is a process involving two stages to verify the identity of an entity trying to access services in a computer or in a network". Github solves this authentication with sending an SMS to a device which wants to push to their platform.

Enabling Two-Factor Authentication

@DavidPesticcio
DavidPesticcio / postgres_queries_and_commands.sql
Created September 22, 2017 12:02 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@DavidPesticcio
DavidPesticcio / gist:7856bcf78b85ecdfcceb5085ddc1e0bd
Created September 28, 2017 19:38
MTU issues in VPN connections
https://community.spiceworks.com/topic/217130-mtu-issues-in-vpn-connections
Question:
Hello,
I often set up vpn tunnels on different network devices(cisco, juniper) and one day I read an info about MTU:
because of perfomance issues its better practise to reduce MTU size on tunnel interfaces/egress interfaces of routers.
How this is affect perfomance?

Keybase proof

I hereby claim:

  • I am davidpesticcio on github.
  • I am davidpesticcio (https://keybase.io/davidpesticcio) on keybase.
  • I have a public key ASAuypbBI405noHSinwrSwsArWpI80vH5DEVGJj8-8jk3wo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@DavidPesticcio
DavidPesticcio / GitHub-Forking.md
Created February 2, 2018 17:20 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

1. Setup a project
2. Add groovy SDK support:
https://www.bonusbits.com/wiki/HowTo:Add_Groovy_SDK_to_IntelliJ_IDEA
3. Download http://(yourjenkinsurl)/job/(yourpipelinejob)/pipeline-syntax/gdsl
- this will give you the .gdsl file - download this to the src folder of your project.
4. Finally follow this step - right click on the src folder -> Mark directory as -> Sources Root
@DavidPesticcio
DavidPesticcio / pipeline.gdsl
Created March 22, 2018 23:33 — forked from ggarcia24/pipeline.gdsl
GDSL supporting pipeline declarative
//The global script scope
def ctx = context(scope: scriptScope())
//What things can be on the script scope
contributor(ctx) {
method(name: 'pipeline', type: 'Object', params: [body: Closure])
property(name: 'params', type: 'org.jenkinsci.plugins.workflow.cps.ParamsVariable')
property(name: 'env', type: 'org.jenkinsci.plugins.workflow.cps.EnvActionImpl.Binder')
property(name: 'currentBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder')
property(name: 'scm', type: 'org.jenkinsci.plugins.workflow.multibranch.SCMVar')
@DavidPesticcio
DavidPesticcio / .bash_extras
Last active June 18, 2018 17:27
Does your wifi drop because of dodgy infrastructure or hardware?
# Put the function below in your .profile or .bashrc or other suitable file
# Name the function whatever you fancy - I chose wifi
# Change remote & delay accordingly
# Call it with no parameters, to watch and recover the existing wifi connection with feedback
# Call it with any parameter(s) to check and/or recover the existing wifi connection with feedback
# Capture some stats to a logfile as evidence of your crappy infrastructure. :-)
function wifi () {
# TODO: Use GNU date to calculate seconds instead of SECONDS
@DavidPesticcio
DavidPesticcio / clamav-notes
Created March 27, 2018 19:43 — forked from AfroThundr3007730/00-clamav-notes.sh
My notes on getting ClamAV working on CentOS 7
# How to get ClamAV working on CentOS 7
yum -y install epel-release && yum -y update
yum -y install clamav clamav-data clamav-scanner clamav-scanner-systemd clamav-server clamav-server-systemd clamav-unofficial-sigs clamav-update
cat <<EOF > /etc/clamd.d/freshclam.conf
# Automatically created by the clamav-freshclam postinst
Bytecode true
CompressLocalDatabase no
ConnectTimeout 30