Skip to content

Instantly share code, notes, and snippets.

View sachinsmc's full-sized avatar
🕸️
👨🏼‍💻

Sachin Chavan sachinsmc

🕸️
👨🏼‍💻
View GitHub Profile
@sachinsmc
sachinsmc / main.go
Created June 24, 2019 11:33
learn go cheat.sh
package main
import(
"fmt"
m "math"
"os"
"io/ioutil"
"net/http"
"strconv"
)
@sachinsmc
sachinsmc / jdbc-sample.java
Last active April 7, 2018 19:07
JDBC Example
package com.smc.jdbc;
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
public class JDBCStatementCreateExample {
private static final String DB_DRIVER = "oracle.jdbc.driver.OracleDriver";
import java.io.*;
import java.util.*;
public class TestClass {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter wr = new PrintWriter(System.out);
int T = Integer.parseInt(br.readLine().trim());
for(int t_i=0; t_i<T; t_i++)
import java.io.*;
import java.util.*;
import java.text.*;
public class Template {
private static Scan scanner = new Scan(System.in);
private static Print printer = new Print();
public static void main(String args[]) throws Exception {
import java.io.BufferedReader;
import java.io.InputStreamReader;
class Hit {
static int arr[][], N;
public static void main(String args[]) throws Exception {
BufferedReader ob = new BufferedReader(new InputStreamReader(System.in));
N = Integer.parseInt(ob.readLine());
Files.upload = function (ctx,options,cb) {
if(!options) options = {};
console.log('File Uploading.....');
//console.log(ctx.req.headers['mobile']);
//console.log(ctx.mobile);
ctx.req.params.container = 'common';
Files.app.models.container.upload(ctx.req,ctx.result,options,function (err,fileObj) {
if(err) {
cb(err);
} else {
*/5 * * * * /home/aws/scripts/savelogs.sh
*/10 * * * * /home/aws/scripts/cps3z.sh
#!/bin/bash
#script for creating zip file
echo "create a zip and cp to s3 "
DATE="`date '+%Y%m%d%H%M%S'`.zip"
zip -e $DATE ../logs
aws s3 cp ../logs https://s3-external-1.amazonaws.com/cf-templates-............w.templatek.....
#!/bin/sh
#create a log file with current timestamp
DATE="`date '+%Y%m%d%H%M%S'`.log"
./systeminfo.sh > ../logs/$DATE
echo "Log file saved."
#!/bin/bash
echo "Description : This scipts will display system information"
echo "Disk Consumption : "
df
echo "Memory Usage : "
free
echo "Network Connections : "
vmstat
netstat