Skip to content

Instantly share code, notes, and snippets.

View sonuame's full-sized avatar
😀
Life z good

Sunil sonuame

😀
Life z good
View GitHub Profile
@sonuame
sonuame / pstoricohddst-gdi
Last active November 13, 2021 22:45
Ricoh-SP111 RaspberryPi Setup
#!/bin/bash
# Debug mode: change to 'yes' to enable
DEBUG=no
function log() {
[ "${DEBUG}" = "yes" ] && echo $* | logger -t "$0[$$]"
}
function logpipe() {
@sonuame
sonuame / docker-install.sh
Last active July 14, 2021 19:25
Docker and Kube Setup
sudo apt update
sudo apt install -y docker.io
sudo systemctl enable docker --now
sudo docker info
sudo usermod -aG docker $USER
newgrp docker
# docker-ce - raspberry-64
@sonuame
sonuame / expand-rootfs.sh
Created July 13, 2021 03:40
Raspi-Issues
#!/bin/bash
#copied from https://raw.githubusercontent.com/Snoop05/raspberrypi/master/expand-rootfs.sh
VERSION="0.1"
if (($EUID < 1)); then
export ROOTDEV=$(mount | grep ' / '|cut -d' ' -f 1)
export ROOTPART=$(lsblk -no NAME $ROOTDEV)
export ROOTDISK=$(lsblk -no PKNAME $ROOTDEV)
export ROOTPARTNUM=$(cat /sys/class/block/$ROOTPART/partition)
@sonuame
sonuame / clean.sh
Last active November 16, 2021 03:24
Ubuntu Cleanup
#!/bin/sh -eux
# Delete all Linux headers
dpkg --list \
| awk '{ print $2 }' \
| grep 'linux-headers' \
| xargs apt-get -y purge;
# Remove specific Linux kernels, such as linux-image-3.11.0-15-generic but
# keeps the current kernel and does not touch the virtual packages,
# e.g. 'linux-image-generic', etc.
dpkg --list \
@sonuame
sonuame / graylog-docker.sh
Last active March 6, 2021 08:12
graylog-docker.sh
sudo docker stop graylog
sudo docker rm graylog
sudo docker run --name graylog --link mongo --link elasticsearch -p 9100:9000 -p 12201:12201 -p 1514:1514 -e GRAYLOG_HTTP_EXTERNAL_URI="http://core.tripsaathi.com:9100/" -d graylog/graylog:4.0
@sonuame
sonuame / rabbitmq-setup-deb.sh
Last active October 30, 2021 20:52
RabbitMQ setup
#!/bin/sh
## If sudo is not available on the system,
## uncomment the line below to install it
# apt-get install -y sudo
sudo apt-get update -y
## Install prerequisites
sudo apt-get install curl gnupg -y
@sonuame
sonuame / webmin-centos.sh
Created October 13, 2020 20:10
centos - webmin
#nano sudo vi /etc/yum.repos.d/webmin.repo
echo "[Webmin]" >> /etc/yum.repos.d/webmin.repo
echo "name=Webmin Distribution Neutral" >> /etc/yum.repos.d/webmin.repo
echo "#baseurl=http://download.webmin.com/download/yum" >> /etc/yum.repos.d/webmin.repo
echo "mirrorlist=http://download.webmin.com/download/yum/mirrorlist" >> /etc/yum.repos.d/webmin.repo
echo "enabled=1" >> /etc/yum.repos.d/webmin.repo
echo "" >> /etc/yum.repos.d/webmin.repo
@sonuame
sonuame / ignore-ssl.ps1
Created October 7, 2020 18:52
powershell ignore ssl
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
sudo nano /etc/apt/sources.list
add
deb http://download.webmin.com/download/repository sarge contrib
sudo apt update
wget -q -O- http://www.webmin.com/jcameron-key.asc | sudo apt-key add
sudo apt update
sudo apt install webmin
sudo ufw allow 10000
use admin
db.createUser({ user :"sonuame", pwd :"xxx", roles :["root"]});
db.changePassword("sonuame", "xxxxxxx")