Skip to content

Instantly share code, notes, and snippets.

View snallami's full-sized avatar

Suresh Nallamilli snallami

  • Los angeles, CA
View GitHub Profile
@snallami
snallami / aws-userdate-http
Last active March 19, 2023 22:02
start httpd server from AWS user data
#!/bin/bash
yum update -y
yum install -y httpd
systemctl start httpd
systemctl enable httpd
echo "<h1> Hello from $(hostname -f) </h1>" > /var/www/html/index.html
@snallami
snallami / Update Jenkins Label
Created June 3, 2016 20:35
Groovy script to update jenkins label
import hudson.model.*
import hudson.model.labels.LabelAtom
updateJenkinsLabel(Hudson.instance.items,"<Replace With Old Label>", "<Replace With new Label")
def updateJenkinsLabel(items, oldLabel, newLabel) {
for (item in items) {
// Find out if it is a folder
if (item.class.canonicalName != 'com.cloudbees.hudson.plugins.folder.Folder') {
https://dkbalachandar.wordpress.com/2016/07/05/thread-dump-from-a-docker-container/
Thread & Heap dumps From a Docker container
Follow the below steps to take the thread and Heap dumps from a docker container
1. Run the below command to bash into the container. Please change the CONTAINER_NAME appropriately
docker exec -it CONTAINER_NAME bash
One of the greatest ways that you add value and make important contributions is:
Your dedicated effort to do the best and goal-oriented attitude
For example, I can think of two scenarios.
- Scenario1 :
I found you to be quite Goal oriented. Right from 8th/9th grade, you seems to have a clear target
in mind on what to do in future and you marched towards it with absolute dedication and kept the unncessary noise/distractions
at Bay. Also, you tried to help others by offering construictive advice but never crossed boundaries.
- Scenario2:
@snallami
snallami / configuire.cmd
Created June 17, 2014 01:13
Reconfigure cygwin
rem This script reconfigures the Cygwin sshd service.
rem It regenerates the computer's host keys. This is necessary
rem when Sysprep is run and a new SID is generated.
@echo off
echo Stopping the Cygwin sshd service...
net stop sshd
echo ERRORLEVEL: %ERRORLEVEL%
@snallami
snallami / ChangePassword.java
Created January 7, 2020 07:25 — forked from zach-klippenstein/ChangePassword.java
The keystore password on Java keystore files is utterly pointless. You can reset it without knowing it, as shown by this code. Note that private keys are still secure, as far as I know. The JKS implementation is copyright Casey Marshall (rsdio@metastatic.org), and the original source is available at http://metastatic.org/source/JKS.java. I've in…
import java.util.*;
import java.io.*;
import java.security.*;
public class ChangePassword
{
private final static JKS j = new JKS();
public static void main(String[] args) throws Exception
{
If minuphours = 0 , code will be evaluating other rules like idle termination time i.e. as if this option doesn't exist.See below code. It prints "Evaluate other rules" message if minUpHours=0
import java.util.concurrent.TimeUnit;
public class MinCheck {
public static void main(String[] args) {
// Check min number of hours instance must be up - if stayed up at least that minimum.
int minUpHours = 0;
@snallami
snallami / gist:3114ee0b70651599aa04
Created September 21, 2015 01:05
Reset jenkins node lables
jenkins.model.Jenkins.instance.labels.each { it.reset() }
@snallami
snallami / gist:8b3957cd7e1426f393991cd5eb3d39e5
Last active May 16, 2019 21:46
Tech Interview preparation
(Picked important points from https://github.com/yangshun/tech-interview-handbook/tree/master/preparing )
1) Pick a programming language to do your interviews in. IMO Python or Java are best bets.
Domain-specific position interviews may differ in some companies - Front End/iOS/Android Engineer roles.
2) Master through practice
a) http://www.crackingthecodinginterview.com/ --> Buy this book and read it
b) For online practice
(Picked important points from https://github.com/yangshun/tech-interview-handbook/tree/master/preparing )
1) Pick a programming language to do your interviews in. IMO Python or Java are best bets.
Domain-specific position interviews may differ in some companies - Front End/iOS/Android Engineer roles.
2) Leet code and 'Cracking the coding interview'
3) Review your concepts
https://github.com/kdn251/interviews
https://medium.com/basecs