Skip to content

Instantly share code, notes, and snippets.

View DrayChou's full-sized avatar
😸

Dray DrayChou

😸
View GitHub Profile
@noobnooc
noobnooc / cloudflare-worker-proxy.js
Last active April 23, 2024 09:42
cloudflare-worker-proxy
// Website you intended to retrieve for users.
const upstream = 'api.openai.com'
// Custom pathname for the upstream website.
const upstream_path = '/'
// Website you intended to retrieve for users using mobile devices.
const upstream_mobile = upstream
// Countries and regions where you wish to suspend your service.
$remoteport = bash.exe -c "ip addr show eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}
@aymericbeaumet
aymericbeaumet / delete-likes-from-twitter.md
Last active April 22, 2024 22:01
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
@estorgio
estorgio / Mounting VirtualBox shared folders on Ubuntu Server 18.04 LTS (Bionic Beaver).md
Last active April 19, 2024 16:34
Mounting VirtualBox shared folders on Ubuntu Server 18.04 LTS (Bionic Beaver)

Mounting VirtualBox shared folders on Ubuntu Server 18.04 LTS (Bionic Beaver)

This guide will walk you through the steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest.

Prerequisites

This guide assumes that you are using the following setup:

You could still make this guide work with other setups (possibly with some modifications to the commands and whatnot).

@xmeng1
xmeng1 / wsl2-network.ps1
Created July 14, 2019 06:50
WSL2 Port forwarding port to linux
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}
@chenqiyue
chenqiyue / twitter_deleter.js
Last active March 16, 2021 14:50
twitter deleter
document.querySelector(".Icon--caretDownLight").click();
setTimeout(()=>{
document.querySelector(".js-actionDelete button.dropdown-link").click();
setTimeout(()=>{
document.querySelector(".delete-action").click();
},300)
}
,300);
@githubgobi
githubgobi / zip-files-with-password.md
Created July 11, 2018 06:00
Creating encrypted ZIP files with password in PHP

Creating encrypted ZIP files with password in PHP

You need at least PHP 7.2 to encrypt ZIP files with a password.

<?php

$zip = new ZipArchive();

$zipFile = __DIR__ . '/output.zip';
@harryawk
harryawk / delete_tweets_and_replies.py
Last active May 31, 2023 03:52
Script to delete all your tweets and replies
"""
This script is using python-twitter SDK (https://github.com/bear/python-twitter)
All key and secret strings can be generated by creating an app in https://apps.twitter.com/
"""
import twitter
consumer_key = ''
consumer_secret = ''
access_token_key = ''
@pythoninthegrass
pythoninthegrass / install_mosh_centos7.sh
Created May 25, 2018 23:10
Install mosh on CentOS 7
#!/usr/bin/env bash
# SOURCE: https://eligiblestore.com/blog/2017/05/02/how-to-install-mosh-on-centos/
# ensure running as root
if [[ "$(id -u)" != "0" ]]; then
exec sudo "$0" "$@"
fi
# install mosh
yum install -y epel-release
@duhow
duhow / CronExp.php
Created March 8, 2018 18:53
Cron Expression Match PHP
<?php
class CronExp {
public function match($expression, $time = NULL){
if(empty($time)){
$time = time() - time() % 60; // rounded to current minute
}elseif(is_string($time)){
$time = strtotime($time);
}