Skip to content

Instantly share code, notes, and snippets.

View AnalogJ's full-sized avatar
🔥
Why is everything always broken?

Jason Kulatunga AnalogJ

🔥
Why is everything always broken?
View GitHub Profile
@mustafaturan
mustafaturan / ruby.2.6.3-setup.sh
Last active February 2, 2023 10:08
ruby 2.6.3 setup for centos 6.x
#!/usr/bin/env bash
# repository
cd /tmp
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
# system update
yum -y update
yum -y groupinstall "Development Tools"
yum -y install libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib-devel openssl-devel libyaml-devel readline-devel curl-devel openssl-devel pcre-devel git memcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick
@treyrich
treyrich / Example.js
Last active May 30, 2017 20:36
This is an AngularJS provider to communicate with a Sails.js backend via Socket.IO.After searching for way too long for a way to interface with the Sails.js client-side SDK included in new Sails projects via AngularJS I decided to write a drop in replacement for the AngularJS $http provider.Although this isn't a full replacement it includes a nu…
angular.module("MyApp", ["SocketProvider"])
.controller("MyController", ["$scope", "socket", function($scope, socket) {
// Fetch initial data
$scope.person = null;
socket.get("/person/1").success(function(data) {
$scope.person = data;
}).error(function() {
@scy
scy / opening-and-closing-an-ssh-tunnel-in-a-shell-script-the-smart-way.md
Last active May 8, 2024 05:28
Opening and closing an SSH tunnel in a shell script the smart way

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost

@IntuitDeveloperRelations
IntuitDeveloperRelations / V2-QBO-Item-Filter-V2SDK-DevDefined.cs
Last active December 19, 2015 21:59
DevDefined / IPP .NET DevKit v2 - QBO - Get Items with DateTimeFilter #DotNetDevKitV2 #Item #Filter
//List<Item> items = GetQboItemsWithDateTimeFiler(commonService, 1, 100, new DateTime(2013, 6, 30, 11, 0, 0));
public List<Intuit.Ipp.Data.Qbo.Item> GetQboItemsWithDateTimeFiler(DataServices dataServices, int startPage, int resultsPerPage, DateTime filterCreateTimeAfter)
{
var filter = "CreateTime :AFTER: " + filterCreateTimeAfter.ToString("yyyy-MM-dd\"T\"HH:mm:sszzz");
var httpWebRequest = WebRequest.Create(dataServices.ServiceContext.BaseUrl + "items/v2/" + dataServices.ServiceContext.RealmId) as HttpWebRequest;
if (httpWebRequest != null)
{
@justincarroll
justincarroll / bootstrap-masonry-template.htm
Last active August 15, 2020 16:48
This is my template for using Masonry 3 with Bootstrap 3. For those of you who follow this gist a lot has changed since Bootstrap 2.
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Masonry Template</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700">
@echohack
echohack / artifactory_secret_api.py
Last active December 17, 2015 20:09
Artifactory Secret Build Info API.
def create_build_info(self, build_name, build_number, dependencies, build_dependencies):
"""
Returns a build info dictionary which is formated to correctly deploy
a new build to artifactory.
Make a put request with this build info to api/build
"""
build_info = {'version': '1.0.1',
'name': build_name,
'number': str(build_number),
'type': 'GENERIC',
@ezhuravlev
ezhuravlev / CentOS chkconfig script headers
Last active December 8, 2021 16:05
service <servicename> does not support chkconfig (CentOS)
/etc/init.d/<servicename>:
# chkconfig: 345 20 80
# description: my service
345 - 3,4,5 runlevels
20 - start priority
80- stop prioroty
@comewalk
comewalk / google-api-scopes.pl
Last active February 5, 2022 06:29
The script shows all Google APIs scopes via Google APIs Discovery Service. Run like below.$ perl google-api-scopes.pl | sort | uniq
#!/usr/bin/env perl
use strict;
use warnings;
use 5.010000;
use JSON;
use LWP::UserAgent;
use URI;
@cwjohnston
cwjohnston / Berksfile
Created April 23, 2013 14:39
sensu full stack in a vagrant box drop these puppies in the sensu-chef repo
site :opscode
metadata
cookbook 'redis',
git: 'git://github.com/miah/chef-redis.git'
cookbook 'monitor',
git: 'git://github.com/portertech/chef-monitor.git'
@leifg
leifg / Vagrantfile
Last active November 12, 2023 08:31
Add a second disk to system using vagrant
file_to_disk = './tmp/large_disk.vdi'
Vagrant::Config.run do |config|
config.vm.box = 'base'
config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024]
config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk]
end