This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.smc.utils; | |
| import java.io.FileInputStream; | |
| import java.io.FileOutputStream; | |
| import java.security.Key; | |
| import java.security.KeyStore; | |
| import java.util.Base64; | |
| import java.util.Date; | |
| import java.util.HashMap; | |
| import java.util.Map; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.smc.utils; | |
| import java.util.List; | |
| import com.fasterxml.jackson.annotation.JsonProperty; | |
| public class ResponseModel { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //user profile | |
| namaste_user.profile = function(data, callback) { | |
| console.log('sending user details....'); | |
| namaste_user.find({ | |
| where: { | |
| mobile: data.mobile | |
| } | |
| }, function(err, mobileResult) { | |
| if (err) { | |
| callback(err, null); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo "Description : This scipts will display system information" | |
| echo "Disk Consumption : " | |
| df | |
| echo "Memory Usage : " | |
| free | |
| echo "Network Connections : " | |
| vmstat | |
| netstat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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..... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| */5 * * * * /home/aws/scripts/savelogs.sh | |
| */10 * * * * /home/aws/scripts/cps3z.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 { |