Skip to content

Instantly share code, notes, and snippets.

View byteshiva's full-sized avatar
🎯
Focusing

Siva byteshiva

🎯
Focusing
View GitHub Profile
# check for php syntax errors in changed files
git status|grep php| cut -d : -f 2 | xargs -n1 php -l
@byteshiva
byteshiva / Ansible-Vault how-to.md
Created April 25, 2018 16:28 — forked from tristanfisher/Ansible-Vault how-to.md
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.

##Working with ansible-vault

I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@byteshiva
byteshiva / simple_args_parsing.sh
Created May 29, 2017 14:14 — forked from jehiah/simple_args_parsing.sh
a simple way to parse shell script arguments
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"
@byteshiva
byteshiva / start-stop-server-in-background.sh
Created May 24, 2017 07:57 — forked from pwittchen/start-stop-server-in-background.sh
Starting and stopping simple HTTP server in background on Linux. After starting server and closing terminal, server should keep running
# starting simple HTTP server with Python in background
screen -d -m python -m SimpleHTTPServer 7777
# killing process running with screen in background
kill -9 `top -n 1 | pgrep screen`
@byteshiva
byteshiva / 0-README.md
Created May 7, 2017 05:35 — forked from leonardofed/0-README.md
AWS Lambda: Advanced Coding Session - clda.co/aws-lambda-webinar

AWS Lambda: Advanced Coding Session (slides)

Live demos:

  1. Amazon API Gateway Access Control
  2. Amazon Kinesis Streams processing
  3. Amazon Cognito Sync trigger
  4. AWS CloudFormation Custom Resources
@byteshiva
byteshiva / README.md
Created May 7, 2017 05:34 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


@byteshiva
byteshiva / gist:e4c569b257e09ef7e278cc5984943651
Created March 17, 2017 14:57 — forked from chris3000/gist:4740404
Check if Asterisk is running and notify by email if it's not.
#!/usr/bin/ruby
require 'pony' #pony gem takes care of email
require 'syslog' #syslog logs to /var/log/syslog, the core log file for Ubuntu.
def log(msg)
# $0 is the current script name
Syslog.open($0, Syslog::LOG_PID | Syslog::LOG_CONS) { |s| s.warning msg }
end
ps=`ps ax`
@byteshiva
byteshiva / main.go
Created February 28, 2017 17:25 — forked from filewalkwithme/main.go
Listening multiple ports on golang http servers (using http.Handler)
package main
import (
"net/http"
)
func main() {
go func() {
http.ListenAndServe(":8001", &fooHandler{})
}()
@byteshiva
byteshiva / filter_long_emails.js
Created February 16, 2017 13:30 — forked from rboyd/filter_long_emails.js
google apps script to archive and autoreply to long emails.
/* paste into http://script.google.com
run periodically (e.g. every 5 minutes) with a timer by selecting 'Resources' > 'current project's triggers...'
*/
function filterLongEmails() {
var num_messages = 1; // will be applied to the last n messages. Google allows up to 500
var word_limit = 50;
var subj = "Shorter emails will get read.";
var body = "Dear friends, I value my time and yours but I appreciate it if you can keep your emails under " + word_limit + " words. Please edit and resend.";