Skip to content

Instantly share code, notes, and snippets.

@vbuterin2
vbuterin2 / xpath_soup.py
Created June 12, 2021 07:01 — forked from ergoithz/xpath_soup.py
Generate unique XPATH for BeautifulSoup element
#!/usr/bin/python
# -*- coding: utf-8 -*-
def xpath_soup(element):
# type: (typing.Union[bs4.element.Tag, bs4.element.NavigableString]) -> str
"""
Generate xpath from BeautifulSoup4 element.
:param element: BeautifulSoup4 element.
:type element: bs4.element.Tag or bs4.element.NavigableString
@vbuterin2
vbuterin2 / delete-likes-from-twitter.md
Created October 19, 2020 08:01 — forked from aymericbeaumet/delete-likes-from-twitter.md
[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()
 }

How not to rm yourself

Copied from https://github.com/sindresorhus/guides/blob/master/how-not-to-rm-yourself.md

The rm command is inherently dangerous and should not be used directly. It can at worst let you accidentally remove everything. Here's how you can protect you from yourself.

Use trash

The trash command-line tool will move stuff to the trash instead of permanently deleting it. You should not alias rm to trash as it will break external scripts relaying on the behavior of rm. Instead use it directly: trash image.jpg.

@vbuterin2
vbuterin2 / tcp_speed.sh
Created July 5, 2020 13:06 — forked from SpeedMe/tcp_speed.sh
tcp_speed
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#=================================================
# System Required: CentOS 6+,Debian7+,Ubuntu12+
# Description: BBR+BBR魔改版+Lotserver
# Version: 1.0.6
# Author: 千影
# Blog: https://www.94ish.me/
@vbuterin2
vbuterin2 / haproxy.cfg
Created May 24, 2020 08:26 — forked from SilverBut/haproxy.cfg
[Haproxy cfg checking Socks5] Haproxy cfg to check the Socks5 connection #tags: GFW, network, haproxy, config
#---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#---------------------------------------------------------------------
global
log 127.0.0.1 local2