Skip to content

Instantly share code, notes, and snippets.

View balaprasanna's full-sized avatar
🎯
Focusing

prasanna balaprasanna

🎯
Focusing
  • Singapore
View GitHub Profile
// These two need to be declared outside the try/catch
// so that they can be closed in the finally block.
HttpURLConnection urlConnection = null;
BufferedReader reader = null;
// Will contain the raw JSON response as a string.
String forecastJsonStr = null;
try {
// Construct the URL for the OpenWeatherMap query
@balaprasanna
balaprasanna / gist:7f74ecbe809e95b8dc34
Created January 15, 2015 17:35
simple web config for custom asp.netweb web form project
1.web config....
<configuration>
<system.web>
<authorization>
<deny users="?" />
<allow users="bala" />
<allow users="prasanna" />
</authorization>
<authentication mode="Forms" />
@balaprasanna
balaprasanna / setup.md
Last active November 5, 2016 16:04 — forked from chris-jamieson/setup.md
Set up Franz for Ubuntu
  • Download Franz for your distribution from MeetFranz.com
  • change into the same directory as the downloaded file, then sudo tar -xf Franz-linux-x64-0.9.10.tgz -C /opt/franz
  • (optional) wget "https://cdn-images-1.medium.com/max/360/1*v86tTomtFZIdqzMNpvwIZw.png" -O franz-icon.png then sudo cp franz-icon.png /opt/franz
  • (optional) sudo touch /usr/share/applications/franz.desktop then sudo vim /usr/share/applications/franz.desktop

paste the following lines into the file, then save the file:

[Desktop Entry]
Name=Franz
Comment=
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network.target docker.socket firewalld.service
Requires=docker.socket
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
@balaprasanna
balaprasanna / gist:7b6d2db3351c88ab74bcf2bab2d2a4b6
Created February 19, 2017 09:29
install-and-start-docker-in-debian
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -
apt-key fingerprint 58118E89F3A912897C070ADBF76221572C52609D
sudo add-apt-repository \
"deb https://apt.dockerproject.org/repo/ \
@balaprasanna
balaprasanna / basic-bash-commands.txt
Created March 19, 2017 15:26
Basic Linux Command Tutorials Links
http://ryanstutorials.net/linuxtutorial/
@balaprasanna
balaprasanna / cron-tab-in-docker.txt
Created March 20, 2017 10:44
how to run a cron tab inside a docker container ??
#### STEP 1
#### Sample cron file (filename: crontab)
* * * * * root echo "Hello world" >> /var/log/cron.log 2>&1
This will run "echo" command & send the output to a file (specified above), every ( * * * * * ) min... this defines the timing pattern
#### STEP 2
#### Dockerfile (filename: Dockerfile)
@balaprasanna
balaprasanna / wordpress-cf-template.json
Created March 23, 2017 03:43
Wordpress Cloud Formation template
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS CloudFormation Sample Template WordPress_Single_Instance: WordPress is web software you can use to create a beautiful website or blog. This template installs WordPress with a local MySQL database for storage. It demonstrates using the AWS CloudFormation bootstrap scripts to deploy WordPress. **WARNING** This template creates an Amazon EC2 instance. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters" : {
"KeyName": {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances",
"Type": "AWS::EC2::KeyPair::KeyName",
@balaprasanna
balaprasanna / wordpress-multi-AZ-cf-template.json
Created March 23, 2017 03:51
wordpress-multi-AZ cloud formation template
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "AWS CloudFormation Sample Template WordPress_Multi_AZ: WordPress is web software you can use to create a beautiful website or blog. This template installs a highly-available, scalable WordPress deployment using a multi-az Amazon RDS database instance for storage. It demonstrates using the AWS CloudFormation bootstrap scripts to deploy WordPress. **WARNING** This template creates an Amazon EC2 instance, an Elastic Load Balancer and an Amazon RDS database instance. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters": {
"KeyName": {
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances",
"Type": "AWS::EC2::KeyPair::KeyName",
"ConstraintDescription": "must be the name of an existing EC2 KeyPair."
},
"InstanceType": {
@balaprasanna
balaprasanna / Ref-VPC-CF.json
Created March 23, 2017 05:42
Reference VPC Cloud Formation Template
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "VPC with 4 subnets across 2 Availability Zones.",
"Parameters": {
"NATInstanceType": {
"Description": "NAT EC2 instance type",
"Type": "String",
"Default": "m1.small",
"AllowedValues": [
"m1.small",