Skip to content

Instantly share code, notes, and snippets.

View sivaprabug's full-sized avatar
🏠

Sivaprabu Ganesan sivaprabug

🏠
View GitHub Profile
@sivaprabug
sivaprabug / journalctl-cheatsheet.md
Created September 10, 2023 13:51 — forked from sergeyklay/journalctl-cheatsheet.md
Journalctl Cheat Sheet

Journalctl Cheat Sheet

Configuration

Permissions

To see messages from other users and the system as well as performing various log operations from a regular user add it to the group:

sudo usermod -aG systemd-journal $USER
@sivaprabug
sivaprabug / sample_base_64_jpeg
Created August 31, 2023 13:44
sample_base_64_jpeg for API testing purpose
/9j/4AAQSkZJRgABAQAAAQABAAD/4QAqRXhpZgAASUkqAAgAAAABADEBAgAHAAAAGgAAAAAAAABHb29nbGUAAP/bAIQAAwICCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCAsNCggNCAgKCAEDBAQGBQYKBgYKDQ0KDQ8NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0N/8AAEQgDwAeAAwEiAAIRAQMRAf/EAB4AAAIDAQEBAQEBAAAAAAAAAAUGAwQHCAIBAAkK/8QAThAAAgECBAQEAwYFAwMDAQERAQIRAyEABBIxBQZBUQcTImEycYEjQpGhsfAIFFLB0TNi4RVy8SRDghZTkgkXojRjsiVzk8KD0hg1RBn/xAAcAQACAwEBAQEAAAAAAAAAAAACAwEEBQAGBwj/xAA/EQACAgEEAQMCBAQGAQMCBgMAAQIRAwQSITFBBRNRImEycYGRBhShsSNCwdHh8DMVUvEHohYXJDRigkNykv/aAAwDAQACEQMRAD8A5L4ly5URyQVq0TDJpJ2N9MR02kE97XiwOXQ4Bo1SrRPk5jZj2WqoAW+0iMGOBZlkphaiMoGxYQt+l+t/+cR53KgEkbbx2+X9sYEXXkLK/oWTE+V8ADhlcqxWopUi3cfMEWIwx5SiJxBkkDqCLg/X2P8Az74K5akOkWxfw5qf1Hrf4e/iP2Z+1q5NxfTfNMI0kAFzA6nYD3wKy3MauSujTEgFjcx+Q7j9cCeduOlFQbBj0PUCRPtbC3m+JDQWFjH67Yfm1StKPR6PXfxHB5YywyuMWuFxd/7D9UyuPFMxjOqXMFfyiqt+hM/PoMDqorn1eY2odzY/v37YlaleC9P+L4xrbC/nk2mlTkYhr5bGX8M8Sc1TA10RUA7KQx7xpJ2/7Yww8K8YaNT4qb0z8w4/EAH8RizHPBrk1sP8XaDIvqk4v7oZ3pYSPEPM
@sivaprabug
sivaprabug / File extension Validation
Created February 28, 2022 06:55
File extension Validation
<!DOCTYPE html>
<html>
<head>
<title>
File Type Validation while - Uploading it using JavaScript
</title>
<p>Upload an Image</p>
<input type="file" id="file" onchange="return fileValidation()" />
<div id="imagePreview"></div>
@sivaprabug
sivaprabug / backbone_trigger_on.html
Created June 25, 2021 13:31
Backbonejs triger the functionality with parameter
<!DOCTYPE html>
<head>
<title>Event On Example</title>
<script src="https://code.jquery.com/jquery-2.1.3.min.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.2/underscore-min.js"
type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.2/backbone-min.js"
type="text/javascript"></script>
</head>
@sivaprabug
sivaprabug / embeded_markdown_in_html.html
Created August 14, 2020 13:46
We embeded a markdown file in html with web components loader
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<!-- Lightweight client-side loader that feature-detects and load polyfills only when necessary -->
<script src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs@2/webcomponents-loader.min.js"></script>
<!-- Load the element definition -->
function siva(value){
if(!value) return '';
value = value.toString();
var a = value.charAt(0).toUpperCase()+value.slice(1)+'<br>';
document.write(a);
}
siva('Sivaprabu Ganesan');
siva('<br>');
siva('@$@$@$');
siva('a$lert');
@sivaprabug
sivaprabug / youtube_remove_like_videos.js
Last active September 12, 2019 02:07
How to Delete all liked YouTube Videos at once!
/* For more https://www.youtube.com/watch?v=wg3ubtxyfyQ */
/* How to delete all liked YouTube Videos at once!
IMPORTANT! You have to click on "Edit" after you click on the "Liked videos" playlist, then you open up the console and use the code! This method does not work if you don't click on "Edit"!
1. Click on "Liked videos" under "Library".
2. Click on "Edit".
3. Open the browser console.
@sivaprabug
sivaprabug / importJSON.js
Created February 8, 2019 17:22
Fetching JSON using google spread sheet
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
#include <stdio.h>
void main() {
int i = 0, recid = i = 320;
int lastRecordId = 0;
printf(" enter last record id :");
scanf("%d", & lastRecordId);
printf("lastRecordId:%d", lastRecordId);
i = recid;
while (i > 0) {
if (i <= lastRecordId && i > (lastRecordId - 300))
@sivaprabug
sivaprabug / postman.js
Created July 5, 2017 10:23
Set cookie value and csrf value as global postaman value
tests["Status code is 200"] = responseCode.code === 200;
// getting CSRF token value from responseBody and stored in global variable
var data = JSON.parse(responseBody);
console.info("CSRF Token Value = " + data.CSRFToken);
postman.setGlobalVariable("csrftoken", data.CSRFToken);
// getting QSESSIONID value from Cookie and stored in global variable
var qsessionidValue = postman.getResponseCookie("QSESSIONID").value
console.log(qsessionidValue);