Skip to content

Instantly share code, notes, and snippets.

View gridhead's full-sized avatar
🚀
Underpromise and overdeliver

Akashdeep Dhar gridhead

🚀
Underpromise and overdeliver
View GitHub Profile
@gridhead
gridhead / default.md
Last active September 27, 2020 09:33
Transferring issues from Pagure to GitHub

Transferring issues from Pagure to Github

Akashdeep Dhar. t0xic0der

The following snippet of Python code uses Selenium Webdriver and JSON to scrape through the issues available at Pagure and copies them into a dictionary. The same dictionary is then parsed into a JSON string and then written to a file.

from selenium import webdriver
import json

def getissue(link:str, brws:webdriver):
@gridhead
gridhead / default.py
Last active September 28, 2020 11:28
Automating issue creation in GitHub using GitHub CLI
import json, os
def appender(lict:list):
textdata = ""
for indx in lict:
textdata += indx + ","
return textdata[:-1]
def create_issues_from_json():
lict = json.loads(open("issulist.json", "r").read())
@gridhead
gridhead / build-svdriver-docker-image.yml
Last active May 12, 2021 17:42
Automating arm64 Docker Image Builds Locally for SuperVisor Driver Service
- name: Build SuperVisor Driver Service Docker image
hosts: server1
remote_user: ubuntu
tasks:
- name: "STEP 1 - Clone the repository in the working directory and checkout the release branch"
ansible.builtin.git:
repo: "https://github.com/t0xic0der/supervisor-driver-service.git"
dest: "/home/ubuntu/data/svdriver"
version: "v1.2.1-beta"
- name: "STEP 2 - Change the current working directory to the repository directory"
@gridhead
gridhead / mote.spec
Created May 14, 2021 04:24
Mote 0.7.0 RPM SPEC file
# There is no need to make our lives so difficult!
# %{!?python_sitelib: %global python_sitelib %(%{__python3} -c "from
# %distutils.sysconfig import get_python_lib; print (get_python_lib())")}
Name: mote
Version: 0.7.0
Release: 4%{?dist}
Summary: A MeetBot log wrangler, providing a user-friendly interface for Fedora's logs
License: GPLv2+
@gridhead
gridhead / inventory.ini
Last active May 15, 2021 12:55
How do you ping the remote systems in your inventory to check if they are up or not?
[web]
server1 ansible_host=192.168.0.163
server1 ansible_ssh_user=ubuntu
server1 ansible_ssh_pass=<add-your-ssh-password-here>
server1 ansible_sudo_pass=<add-your-sudo-password-here>
server2 ansible_host=192.168.0.115
server2 ansible_ssh_user=soumadeepdhar
server2 ansible_ssh_pass=<add-your-ssh-password-here>
server2 ansible_sudo_pass=<add-your-sudo-password-here>
@gridhead
gridhead / cpugovnr.tyml
Last active May 15, 2021 13:05
Using Templating Engines for Generating Ansible Playbooks
- name: Enabling the {{ governor }} CPU Governor on System Boot
hosts: server2
remote_user: soumadeepdhar
become: yes
become_method: sudo
become_user: root
tasks:
- name: "STEP 1 - Creating a shellscript to enable {{ governor }} governor"
copy:
dest: "/usr/local/bin/perf-prof.sh"
@gridhead
gridhead / al-wpa-setup.sh
Created May 16, 2021 03:45
Installing Arch Linux on Raspberry Pi with Immediate WiFi Access
#!/bin/sh
set -e
if [[ $# -ne 3 ]] ; then
echo "Usage: $0 </dev/disk> <ssid> <passphase>"
exit 1
fi
DISK="$1"
@gridhead
gridhead / inventory.ini
Last active May 16, 2021 15:32
Pull Docker Images on an Ubuntu Docker Host Constructed From a Jinja2 Template
[web]
server1 ansible_host=192.168.0.165
server1 ansible_ssh_user=ubuntu
server1 ansible_ssh_pass=<your-ssh-password>
server1 ansible_sudo_pass=<your-sudo-password>
@gridhead
gridhead / inventory.ini
Last active May 16, 2021 15:32
Setup Ravermeister/Gitlab Container on Docker Host
[web]
server1 ansible_host=192.168.0.165
server1 ansible_ssh_user=ubuntu
server1 ansible_ssh_pass=<your-ssh-password>
server1 ansible_sudo_pass=<your-sudo-password>
@gridhead
gridhead / centos-cdrsrv-amd64.Dockerfile
Last active May 28, 2021 04:41
CentOS Code Server Dockerfile
FROM centos:latest
LABEL maintainer "Akashdeep Dhar <t0xic0der@fedoraproject.org>"
WORKDIR /data
RUN dnf install wget git -y
RUN wget https://github.com/cdr/code-server/releases/download/v3.10.1/code-server-3.10.1-amd64.rpm
RUN dnf remove wget -y
RUN dnf install code-server-3.10.1-amd64.rpm -y
RUN rm code-server-3.10.1-amd64.rpm
ENTRYPOINT ["code-server", "--bind-addr", "0.0.0.0:4444", "--auth", "none"]
EXPOSE 4444