Skip to content

Instantly share code, notes, and snippets.

View bkrajendra's full-sized avatar

Rajendra bkrajendra

View GitHub Profile
bkrajendra / cleanupUnusedWorkspaceInSlaves.groovy
Created September 6, 2023 06:17 — forked from ceilfors/cleanupUnusedWorkspaceInSlaves.groovy
When you delete jobs in Jenkins, the corresponding workspaces in the build slaves won't be deleted automatically. This Jenkins script will go to each slave and check if the jobs are already deleted in Jenkins master and delete the workspace.
import com.cloudbees.hudson.plugins.folder.Folder
import hudson.FilePath
import jenkins.model.Jenkins
def boolean isFolder(String name) {
def item = Jenkins.instance.getItemByFullName(name)
return item instanceof Folder
def deleteUnusedWorkspace(FilePath root, String path) {
bkrajendra /
Last active July 30, 2023 07:17 — forked from npearce/
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command
bkrajendra / merge_properties.js
Created January 14, 2023 04:23
Application property processor
// Simple appproach for merging with subset of properties from json oject.
// Default Properties
const default_rolestudio = {
portal_name: 'Role Studio',
rolename_maxwidth: 200,
nested_property1: {value1: 30, value2: 20},
nested_property2: {value1: 30, value2: 20}
// Custom Properties
bkrajendra /
Last active October 23, 2020 07:11
Datacamp - - Machine Translation in Python

Understanding one-hot vectors

from tensorflow.python.keras.utils import to_categorical

# Create a list of words and convert them to indices
words = ["I", "like", "cats"]
word_ids = [word2index[w] for w in words]
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 8 columns, instead of 5. in line 6.
Name Vendor Architecture Repository Boards Manager URL Repository Data Folder Branch Name Notes
Adafruit AVR Boards adafruit avr / master
Adafruit nRF52 adafruit nrf52 / master
Adafruit SAMD Boards adafruit samd / master
Adafruit TeeOnArdu TeeOnArdu avr / master
Adafruit WICED adafruit wiced / master
Adelino AVR Boards adelino avr
bkrajendra /
Created July 6, 2020 06:42 — forked from protrolium/
ffmpeg guide


Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

bkrajendra / nrfrx.ino
Created November 21, 2019 11:20
NRF Transmitter / Receiver Code
* Arduino Wireless Communication Tutorial
* Example 1 - Receiver Code
* Library: TMRh20/RF24,
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CE, CSN
bkrajendra /
Last active September 1, 2019 10:02 — forked from elktros/
LED Blink with Python RPI
#!/usr/bin/env python
import RPi.GPIO as GPIO # RPi.GPIO can be referred as GPIO from now
import time
ledPin = 22 # pin22
def setup():
GPIO.setmode(GPIO.BOARD) # GPIO Numbering of Pins
GPIO.setup(ledPin, GPIO.OUT) # Set ledPin as output
GPIO.output(ledPin, GPIO.LOW) # Set ledPin to LOW to turn Off the LED
# Specifies intentionally untracked files to ignore when using Git