Skip to content

Instantly share code, notes, and snippets.

View CypherpunkSamurai's full-sized avatar
😶
Currently Busy 🌻🐢

Cypherpunk Samurai CypherpunkSamurai

😶
Currently Busy 🌻🐢
View GitHub Profile
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@CypherpunkSamurai
CypherpunkSamurai / README.md
Last active October 12, 2021 18:44
xaria2-x
@CypherpunkSamurai
CypherpunkSamurai / encrypt_openssl.md
Created October 12, 2021 18:23 — forked from dreikanter/encrypt_openssl.md
File encryption using OpenSSL

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

@CypherpunkSamurai
CypherpunkSamurai / README.md
Last active October 12, 2021 18:30
OpenSSL Quick AES256-CBC

How to encrypt decrypt ASE 256 CBC using Openssl

Prepare input text:

echo "We're blown. Run" >input.txt

Encrypt:

openssl enc -aes-256-cbc -nosalt -e \
 -in input.txt -out input.txt.enc \

Heroku

  • Apps
curl 'https://api.heroku.com/users/~/apps' -H 'User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0' -H 'Accept: application/vnd.heroku+json; version=3.cedar-acm' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Referer: https://dashboard.heroku.com/' -H 'Range: name ..; order=asc, max=1000' -H 'X-Origin: https://dashboard.heroku.com' -H 'X-Heroku-Requester: dashboard' -H 'Authorization: Bearer API_KEY' -H 'Origin: https://dashboard.heroku.com' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-site' -H 'Sec-GPC: 1' -H 'TE: trailers'
  • Get App Data
@CypherpunkSamurai
CypherpunkSamurai / code.cpp
Created October 27, 2021 12:54 — forked from rla/code.cpp
Sending JSON POST request with Qt
void SyncService::sync()
{
QUrl url(SYNC_URL);
QNetworkRequest request(url);
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply*)),
@CypherpunkSamurai
CypherpunkSamurai / sha1_nodejs.ts
Created November 7, 2021 18:38
A Typescript Code to generate SHA1 hash with pure js jhash module
// uses jhash to generate SHA1 (https://www.npmjs.com/package/jhash)
// `npm install jhash`
var Hashes = require('jshashes');
var str = 'This is a sample text!';
new SHA1 instance and base64 string encoding
use SHA1.hex(str) for hex encoding
var SHA1 = new Hashes.SHA1().b64(str);
new Notice(SHA1);
FROM ghcr.io/linuxserver/baseimage-alpine:3.13
ARG BUILD_DATE
ARG VERSION
ARG TRANSMISSION_VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="aptalca"
RUN \
echo "**** install packages ****" && \
@CypherpunkSamurai
CypherpunkSamurai / linebreak.md
Last active November 18, 2021 20:18
Line breaks in markdown (github softwrap)
Hello  (<-- two spaces)
World

Hello
World