Skip to content

Instantly share code, notes, and snippets.

@Ompragash
Ompragash / curl-with-tinyproxy.md
Created October 1, 2024 14:17
Testing curl with Tinyproxy as an HTTP Proxy

Start Tinyproxy Container with Podman or Docker

podman run -d --name='tinyproxy' -p 8888:8888 dannydirect/tinyproxy:latest ANY

For Docker Users: docker run -d --name='tinyproxy' -p 8888:8888 dannydirect/tinyproxy:latest ANY

Run curl with -x (proxy URL) in verbose mode to test network traffic

curl -x http://localhost:8888 https://httpbin.org/ip -vv
@Ompragash
Ompragash / print-drone-env.sh
Created September 13, 2024 11:11
DRONE_* ENV
echo "DRONE_BUILD_BRANCH: $DRONE_BUILD_BRANCH"
echo "DRONE_BUILD_NUMBER: $DRONE_BUILD_NUMBER"
echo "DRONE_BUILD_PARENT: $DRONE_BUILD_PARENT"
echo "DRONE_BUILD_EVENT: $DRONE_BUILD_EVENT"
echo "DRONE_BUILD_ACTION: $DRONE_BUILD_ACTION"
echo "DRONE_BUILD_STATUS: $DRONE_BUILD_STATUS"
echo "DRONE_BUILD_CREATED: $DRONE_BUILD_CREATED"
echo "DRONE_BUILD_STARTED: $DRONE_BUILD_STARTED"
echo "DRONE_BUILD_FINISHED: $DRONE_BUILD_FINISHED"
echo "DRONE_BUILD_LINK: $DRONE_BUILD_LINK"
package main
import (
"io/ioutil"
"os"
"regexp"
"strings"
"github.com/sirupsen/logrus"
)
@Ompragash
Ompragash / gist:80eeec109c45eb801d344aa5c1755c75
Created June 26, 2022 16:11
How To Validate A PyPI Package Using Its PGP Signature?
This gist explains validating a package's PGP signature downloaded from PyPI.
## Requirements
- `curl`
- `wget`
### Issue
In some instances, verifying the package downloaded from PyPi using its PGP signature is necessary. This is to ensure that the source code has not been modified/tampered with since it was packaged.
@Ompragash
Ompragash / setup_testrpc.md
Last active February 1, 2022 19:10
How To Setup And Run TestRPC As A Docker Container For Ethereum Development?

How To Setup And Run TestRPC As A Docker Container For Ethereum Development?

TestRPC is a Node.js based Ethereum client for testing and development. This article explains how to setup and run TestRPC as a Docker Container.

  • It uses ethereumjs to simulate full client behavior and make developing Ethereum applications much faster.
  • It's a complete blockchain-in-memory that runs only on your development machine.
  • It processes transactions instantly instead of waiting for the default block time.

Requirement:

@Ompragash
Ompragash / set_default_python_version_in_linux.txt
Created October 15, 2021 23:55
Set Default Version of Python
If you have more than one version of Python installed on your CentOS 8, you may need to set the default version of Python. Configuring the default version helps applications and programs that require a python command to navigate to the appropriate location.
Set Python 3 or Python 2 as the system-wide python command.
To assign Python 3 as the default version, use the command:
```
alternatives --set python /usr/bin/python3
```
@Ompragash
Ompragash / 0fixup.md
Created September 7, 2021 08:48 — forked from silent1mezzo/0fixup.md
On undoing, fixing, or removing commits in git

A git choose-your-own-adventure!

This document is an attempt to be a fairly comprehensive guide to recovering from what you did not mean to do when using git. It isn't that git is so complicated that you need a large document to take care or your particular problem, it is more that the set of things that you might have done is so large that different techniques are needed depending on exactly what you have done and what you want to have happen.

@Ompragash
Ompragash / sync_upstream_fork.md
Last active April 3, 2019 18:16
How To Update A Forked GitHub Repository.

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
For Tower v3.6
# curl -XPOST -kfs -H 'Content-Type: application/json' --user admin:teamansible --data @/home/ompragash/license/license.txt https://tower_serverapi/v2/config/
# cat ./license.txt
{"subscription_name": "Enterprise Tower up to 2000 Nodes", "features": {},
"instance_count": 2000, "trial": false, "contact_email":
"oviswana@redhat.com", "company_name": "RedHat", "license_type": "enterprise",
"contact_name": "Ompragash Viswanathan", "license_date": 642567537,