Skip to content

Instantly share code, notes, and snippets.

View technolo-g's full-sized avatar

Matt Bajor technolo-g

View GitHub Profile
@vrivellino
vrivellino / ec2_cloud.groovy
Last active January 20, 2022 11:11
Jenkins EC2 Plugin Configuration via Groovy
/*
* Configure the Jenkins EC2 Plugin via Groovy Script
* EC2 Plugin URL: https://wiki.jenkins-ci.org/display/JENKINS/Amazon+EC2+Plugin
*/
import hudson.model.*
import jenkins.model.*
import hudson.plugins.ec2.*
import com.amazonaws.services.ec2.model.InstanceType
@technolo-g
technolo-g / commands.sh
Last active October 19, 2016 20:20
Spacemacs
# Finding Files
SPC ft # Toggle NeoTree
SPC pt # Open project root
SPC ff # Find a file with Helm
# Buffers / Files
SPC fs # Save file
SPC bd # Close buffer
SPC TAB # Switch between open buffers
@jhoblitt
jhoblitt / kubernetes.groovy
Created April 18, 2016 19:20
configuring the kubernetes jenkins plugin via groovy
import org.csanchez.jenkins.plugins.kubernetes.*
import jenkins.model.*
def j = Jenkins.getInstance()
def k = new KubernetesCloud(
'jenkins-test',
null,
'https://130.211.146.130',
'default',
@taoyuan
taoyuan / npm-using-https-for-git.sh
Last active April 27, 2024 01:22
Force git to use https:// instead of git://
# npm using https for git
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."git@github.com:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
import jenkins.model.*
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.common.*
import com.cloudbees.plugins.credentials.domains.*
import com.cloudbees.plugins.credentials.impl.*
import com.cloudbees.jenkins.plugins.sshcredentials.impl.*
import org.jenkinsci.plugins.plaincredentials.*
import org.jenkinsci.plugins.plaincredentials.impl.*
import hudson.util.Secret
import hudson.plugins.sshslaves.*
# Install
Download the package here http://www.lsi.com/support/Pages/download-results.aspx?keyword=megacli
Extract it
On RHEL, Install the rpm under Linux
On Ubuntu:
apt-get install rpm2cpio
cd Linux; rpm2cpio MegaCli-*.rpm | cpio -idmv
# Usage
List all physical disks:
alias javaws='/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/javaws'
@technolo-g
technolo-g / squash.md
Last active August 29, 2015 14:08
Squash commits in a branch

This method is harder than using the get reset method above. Also it doesn't work well if you merged the master into the feature branch previously (you'll need to resolve all conflicts again).

What we are describing here will destroy commit history and can go wrong. For this reason, do the squashing on a separate branch:

git checkout -b squashed_feature

To squash all commits since you branched away from master, do

git rebase -i master
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: