Skip to content

Instantly share code, notes, and snippets.

View prashantsolanki3's full-sized avatar
🎯
Focusing

Prashant Solanki prashantsolanki3

🎯
Focusing
View GitHub Profile
@Oratorian
Oratorian / create-cloud-template.sh
Last active January 4, 2023 21:07 — forked from chriswayg/create-cloud-template.sh
This script will download a cloud image of many Linux distros and create a Proxmox 6 KVM template from it.
#!/bin/bash
set -o errexit
clear
printf "\n*** This script will download a cloud image and create a Proxmox VM template from it. ***\n\n"
### HOW TO USE
### Pre-req:
### - run on a Proxmox 6 server
### - a dhcp server should be active on vmbr1
@cidermole
cidermole / jenkins-agent.service
Last active February 20, 2024 11:53
Systemd service file for Jenkins agent on Ubuntu 20.04 Focal Fossa
# Steps to install Jenkins Agent using JNLP connection on Ubuntu 20.04 Focal Fossa
#
# * create an Agent node on the web GUI: https://wiki.jenkins.io/display/JENKINS/Step+by+step+guide+to+set+up+master+and+agent+machines+on+Windows
# * $ sudo apt-get install -y openjdk-14-jre-headless
# * $ sudo adduser jenkins
# * $ curl http://jenkins-master.internal/jnlpJars/agent.jar -o /home/jenkins/agent.jar
# * create systemd service: place this file in /lib/systemd/system/jenkins-agent.service
# * $ sudo systemctl enable myservice
# * $ sudo systemctl start jenkins-agent
@smola
smola / GLUSTER_SETUP.sh
Created October 18, 2018 09:24
Quick and dirty single-node GlusterFS setup
#
# Instructions for quick gluster server (1 node) setup with a volume on LVM.
# No replication, just using localhost.
#
# See https://docs.gluster.org/en/latest/Administrator%20Guide/Brick%20Naming%20Conventions/
#
# Install GlusterFS
add-apt-repository ppa:gluster/glusterfs-4.0
apt-get install glusterfs-server
@marians
marians / CouchDB_Python.md
Last active April 9, 2024 12:21
The missing Python couchdb tutorial

This is an unofficial manual for the couchdb Python module I wish I had had.

Installation

pip install couchdb

Importing the module

@imran0101
imran0101 / EndlessRecyclerOnScrollListener.java
Last active February 22, 2022 12:50
RecyclerView position helper to get first and last visible positions
/**
* Custom Scroll listener for RecyclerView.
* Based on implementation https://gist.github.com/ssinss/e06f12ef66c51252563e
*/
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = "EndlessScrollListener";
private int previousTotal = 0; // The total number of items in the dataset after the last load
private boolean loading = true; // True if we are still waiting for the last set of data to load.
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more.
@markusfisch
markusfisch / DemoBubblesView.java
Last active February 21, 2023 19:58
Draw text in a given rectangle and automatically wrap lines on a Android Canvas
package de.markusfisch.android.textrect.widget;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.view.View;
import de.markusfisch.android.textrect.graphics.TextRect;