Skip to content

Instantly share code, notes, and snippets.

View rajendarreddyj's full-sized avatar
💭
I may be slow to respond.

Rajendarreddy Jagapathi rajendarreddyj

💭
I may be slow to respond.
View GitHub Profile
@rajendarreddyj
rajendarreddyj / pdfprint.html
Created February 5, 2017 20:06
print pdf from html using jspdf
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Hello world</title>
</head>
<body>
<h1>Hello world</h1>
@rajendarreddyj
rajendarreddyj / footer.jsp
Last active October 19, 2022 13:38
to print current year in copy right footer using jstl
@rajendarreddyj
rajendarreddyj / DbeaverStringEncrypter.java
Created January 25, 2017 22:36
program to decrypt password values in .dbeaver-data-sources.xml
package com.rajendarreddyj.java;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.util.Arrays;
/**
@rajendarreddyj
rajendarreddyj / create_new_user.md
Created August 28, 2022 19:16 — forked from JeremyIglehart/create_new_user.md
How to create a new user and remove the `pi` user on a Raspberry Pi

How to create a new user and remove the pi user on a Raspberry Pi

Note: This has been tested in Rasbian Buster released on 2019-06-20

Important: replace jeremy below with whatever username you'd like as your new user.

  1. sudo adduser jeremy
    • You will be asked to enter a password
    • When filling out basic information about the user, you may leave it blank
@rajendarreddyj
rajendarreddyj / updateJDK.ps1
Created August 4, 2021 00:24 — forked from mavaddat/updateJDK.ps1
Automated update of JDK path for AdoptOpenJDK triggered by update in Chocolatey. PowerShell directives are provided to the VBS Windows Script Host as encoded commands so as to avoid a shell screen popping up on trigger.
# This contains two lines (#4, #7) which will be run as an encoded PowerShell command inside a Visual Basic Script (VBScript) scheduled task below.
# Check if 'updateJDK.vbs' is already running in another process; if so, let's quit and just let that finish the task
Get-Process -Name '*WScript*' | foreach{if($_.CommandLine -imatch 'updateJDK.vbs' -and $_.Id -ne $PID){ exit } }
# We will update the %JAVA_HOME% path upon observing discrepency between the newest available JDK (local directory) and the %JAVA_HOME%
$jdk = Get-ChildItem (Resolve-Path 'C:\Program Files\AdoptOpenJDK\') -Depth 0 -Directory | Sort-Object -Property LastWriteTime -Descending | Select-Object -First 1; if(($null -ne ([System.Environment]::GetEnvironmentVariable('JAVA_HOME'))) -and ($env:JAVA_HOME -ne $jdk)) { [System.Environment]::SetEnvironmentVariable('JAVA_HOME',$($jdk.FullName),[System.EnvironmentVariableTarget]::User) }
# Whenever we change the script (i.e., the above line of PowerShell commands), we generate the new encoded command
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@rajendarreddyj
rajendarreddyj / git-apply-patch.md
Created May 14, 2021 04:43 — forked from emmanueltissera/git-apply-patch.md
Generate a git patch for a specific commit

Creating the patch

git format-patch -1 <sha>
OR
git format-patch -1 HEAD

Applying the patch

git apply --stat file.patch # show stats.
git apply --check file.patch # check for error before applying

@rajendarreddyj
rajendarreddyj / pi_mount_usb.md
Created May 7, 2021 02:15 — forked from etes/pi_mount_usb.md
How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

Follow the simple steps in the order mentioned below to have your USB drive mounted on your Raspberry Pi every time you boot it.

These steps are required especially if your are setting up a Samba share, or a 24x7 torrent downloader, or alike where your Raspberry Pi must have your external storage already mounted and ready for access by the services / daemons.

Step 0. Plug in your USB HDD / Drive to Raspberry Pi If you are using a NTFS formatted drive, install the following

@rajendarreddyj
rajendarreddyj / geojson-spec-1.1
Created April 20, 2021 19:41 — forked from virtualandy/geojson-spec-1.1
The GeoJSON Specification
================================
The GeoJSON Format Specification
================================
:Abstract:
GeoJSON is a geospatial data interchange format based on JavaScript Object
Notation (JSON).
:Authors:
Howard Butler (Hobu Inc.),
@rajendarreddyj
rajendarreddyj / index.html
Created April 20, 2021 03:44 — forked from milkbread/index.html
JavaScript: Leaflet Polygon Example
<!DOCTYPE html>
<html>
<head>
<title>Simple polygon visualisation</title>
<meta charset="utf-8" />
<script src="http://cdn.leafletjs.com/leaflet-0.6.1/leaflet.js"></script>
<script src="http://d3js.org/d3.v3.min.js"></script>
<style>
@import url(http://cdn.leafletjs.com/leaflet-0.6.1/leaflet.css);
</style>