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
@CypherpunkSamurai
CypherpunkSamurai / Install-pkg-for-all-repls.md
Last active March 6, 2022 14:49
Replit Install Pkg Command Backup

Replit Install Pkg

This is a backup of replit command when it's not available in the repl we are using. We can just copy it to the repl folder and it should work.

Default

Usually a bash repl contains a replit.nix file with contents:

{ pkgs }: {
    deps = [
 pkgs.bashInteractive
@CypherpunkSamurai
CypherpunkSamurai / Installing-masscan-on-replit.md
Last active March 6, 2022 15:01
How to install masscan on replit

Installing Masscan on Replit

To install masscan on replit we run

install-pkg libpcap* masscan

and this should give us masscan

A good collection of nix files at nix-security-box

Access 4shared WEBDAV

To Access 4shared as webdav we need to use the following configurations:

  • WebDAV URL: https://webdav.4shared.com/
  • WebDAV Username: Get your username from Settings
  • WebDAV Password: Get your password from Settings

( If username does'nt work try email )

@CypherpunkSamurai
CypherpunkSamurai / worker.js
Created March 16, 2022 16:55
Cloudflare Worker Unblock Website (proxy)
'use strict'
/**
* static files (404.html, sw.js, conf.js)
*/
const ASSET_URL = 'https://1337x.to'
const JS_VER = 10
const MAX_RETRY = 1
name: Github Pages
on:
push:
branches:
- master # Here source code branch is `master`, it could be other branch
jobs:
build_and_deploy:
runs-on: ubuntu-latest
@CypherpunkSamurai
CypherpunkSamurai / dump_database_from_django_app.md
Last active March 18, 2022 19:17
Dump Database from Django App

Dump Database from Django App

Here's the two ways i found to dump data from Django application.

Using Django-DBbackup

As the django-dbbackup documentation states, we need to install the module django-dbbackup (django-dbbackup==3.3.0 latest at the time). Then we need to add these to the settings.py:

@CypherpunkSamurai
CypherpunkSamurai / python3_get_oldest_file_from_dir.md
Last active March 18, 2022 18:55
Get the oldest file from a directory with python3

Get the oldest file from a directory with python3

This example is taken from stackoverflow.

Solution 1

list_of_files = os.listdir('log')    

if len(list_of_files) >= 25:
    oldest_file = min(list_of_files, key=os.path.getctime)
 os.remove(os.path.abspath(oldest_file))
@CypherpunkSamurai
CypherpunkSamurai / README.md
Last active March 20, 2022 20:34
Obisidian.md Custom Commit System

Obsidian Commit System

This was a POC of a custom commit system leveraging SHA hashes like Github. Initially SHA1 was used to make using Github API easier, later on project shifted motives towards Dropbox integration.

Please remove unused Dropbox Code before using, or just use the functions required.

This is an old piece of snippet from August 2021. If anyone wants to borrow the code feel free, just link to this gist in the credits and that'd do :P

Commit Function - L180

Credits

@CypherpunkSamurai
CypherpunkSamurai / making_remotely-save_work_on_dropbox_root_directory.md
Last active March 21, 2022 21:07
Making Obsidian `remotely-save/remotely-save` work on dropbox root directory

Making Obsidian remotely-save/remotely-save work on dropbox root directory

So, remotely-save is a plugin that allows saving to dropbox and onedrive and webdav. I was using it but it didn't match my workflow with dillinger. So i patched it to save vaults in the root (i.e. /) of the cloud storages.

Finding what to patch

As remotely-save is opensource i looked up the source code and found that there's a method in settings.ts that uses the plugin id.

I then used notepad3 (a notepad alternative for windows) to open the large main.js from my obsidian vault folder. I then searched for it, and sure enough it was there.

So I edited, this line:

@CypherpunkSamurai
CypherpunkSamurai / chrome_debug_tools_on_obsidian.md
Created March 21, 2022 15:45
Accessing Chrome Debug tools on Obsidian.md