Skip to content

Instantly share code, notes, and snippets.

View nk-gears's full-sized avatar
💥
experimenting...

Nirmal nk-gears

💥
experimenting...
View GitHub Profile
@nk-gears
nk-gears / gist:2db8491655b8e69b94440e84b2d6c0f5
Created January 25, 2017 15:55 — forked from imranity/gist:9246dd195f785cf4783d
How to solve "sudo: no tty present and no askpass program specified" when trying to run a shell from Jenkins
Running shell scripts that have contain sudo commands in them from jenkins might not run as expected. To fix this, follow along
Simple steps:
1. On ubuntu based systems, run " $ sudo visudo "
2. this will open /etc/sudoers file.
3. If your jenkins user is already in that file, then modify to look like this:
jenkins ALL=(ALL) NOPASSWD: ALL
4. save the file by doing Ctrl+O (dont save in tmp file. save in /etc/sudoers, confirm overwrite)
5. Exit by doing Ctrl+X
6. Relaunch your jenkins job
@nk-gears
nk-gears / configuration.yaml
Created December 25, 2016 09:12
Configuration.yaml - Home Assistant.io
# I moved this all to https://github.com/CCOSTAN/Home-AssistantConfig - I won't be updating this file anymore.
homeassistant:
name: Bear Stone Run
latitude: !secret homeassistant_latitude
longitude: !secret homeassistant_longitude
elevation: !secret homeassistant_elevation
unit_system: imperial
@nk-gears
nk-gears / spring-boot-docker-cfn-sample.cfn.json
Created December 21, 2016 15:46 — forked from wonderb0lt/spring-boot-docker-cfn-sample.cfn.json
The CFN template for the cfn/docker sample
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Infrastructure for the Spring Boot + Docker + CFN sample",
"Parameters": {
"Version": {
"Type": "String",
"Default": "1.0.0"
}
},
"Resources": {
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS Quick Start Demo - Elastic Beanstalk App Setup.",
"Parameters" : {
"VPC": {
"Description" : "ID of the VPC to use",
"Type": "String",
"MinLength": "1",
@nk-gears
nk-gears / cftemplate-eb.json
Created December 21, 2016 15:39 — forked from GeneralistDev/cftemplate-eb.json
Cloud Formation Template (danielparker.com.au) WordPress and Elastic Beanstalk
{
"Outputs":{
"AWSEBLoadBalancerURL":{
"Value":{
"Fn::Join":[
"",
[
"http:\/\/",
{
"Fn::GetAtt":[
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Test template for creating a beanstalk environment",
"Parameters" : {
"VPC": {
"Description" : "The AWS VPC to use.",
"Type": "AWS::EC2::VPC::Id"
},
"SubnetA": {
"Description" : "The Subnet in AZ A.",
packages:
yum:
git: []
gcc: []
make: []
openssl-devel: []
commands:
00-add-home-variable:
command: sed -i 's/function error_exit/export HOME=\/root\n\nfunction error_exit/' /opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh
container_commands:
package ca.uwo.csd.cs2212.USERNAME;
public class BankAccount {
private double balance;
public BankAccount(double balance) {
this.balance = balance;
}
@nk-gears
nk-gears / jenkins-ec2-continous-integration.md
Created December 11, 2016 09:00 — forked from stephenharris/jenkins-ec2-continous-integration.md
How to set up CI with Jenkins on AWS EC2 (and some notes)
@nk-gears
nk-gears / ssh_config
Created December 3, 2016 14:28 — forked from MatthieuLemoine/ssh_config
SSH config proxy host
# ~/.ssh/config
Host <custom-name>
HostName <remote-host>
User <remote-user>
Port <remote-ssh-port>
ForwardAgent yes
ProxyCommand ssh -o 'ForwardAgent yes' <proxy-user>@<proxy-host> 'ssh-add && nc %h %p'