Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Chun-Sheng, Li peter279k

🎯
Focusing
View GitHub Profile
@peter279k
peter279k / frp systemd.md
Created March 18, 2023 15:43 — forked from ihipop/frp systemd.md
FRP systemd 启动脚本 FRP systemd init config
View frp systemd.md
@peter279k
peter279k / dl_requests_tqdm.py
Created December 16, 2022 14:09 — forked from yanqd0/dl_requests_tqdm.py
Python requests download file with a tqdm progress bar
View dl_requests_tqdm.py
import requests
from tqdm import tqdm
def download(url: str, fname: str, chunk_size=1024):
resp = requests.get(url, stream=True)
total = int(resp.headers.get('content-length', 0))
with open(fname, 'wb') as file, tqdm(
desc=fname,
total=total,
View build.yml
name: build
on: [ push, pull_request ]
jobs:
run:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest ]
@peter279k
peter279k / curl_progress.php
Created April 26, 2022 13:48 — forked from bdunogier/curl_progress.php
PHP/cURL download progress monitoring
View curl_progress.php
<?php
file_put_contents( 'progress.txt', '' );
$targetFile = fopen( 'testfile.iso', 'w' );
$ch = curl_init( 'http://ftp.free.org/mirrors/releases.ubuntu-fr.org/11.04/ubuntu-11.04-desktop-i386-fr.iso' );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt( $ch, CURLOPT_NOPROGRESS, false );
curl_setopt( $ch, CURLOPT_PROGRESSFUNCTION, 'progressCallback' );
curl_setopt( $ch, CURLOPT_FILE, $targetFile );
@peter279k
peter279k / clear_cache_MS_Teams.sh
Created November 30, 2021 03:03 — forked from mrcomoraes/clear_cache_MS_Teams.sh
Clear cache Microsoft Teams on Linux
View clear_cache_MS_Teams.sh
#!/bin/bash
# This script cleans all cache for Microsoft Teams on Linux
# Tested on Ubuntu-like and Debian by @necrifede. Feel free to test/use in other distributions.
# Tested with Teams via snap package.
#
# How to use in terminal:
# ./clear_cache_MS_Teams.sh ( deb-stable | deb-insider | snap )
# or
# bash clear_cache_MS_Teams.sh ( deb-stable | deb-insider | snap )
@peter279k
peter279k / install-xrdp-ubuntu-18.04.md
Created July 3, 2021 16:05 — forked from hehuan2112/install-xrdp-ubuntu-18.04.md
Install Remote Desktop (xRDP) for Ubuntu Server 18.04
View install-xrdp-ubuntu-18.04.md

Install Remote Desktop (xRDP) for Ubuntu Server 18.04

Step 1 – Install xRDP:

sudo apt update
sudo apt install xrdp

Step 2 – Install XFCE4

sudo apt install xfce4

@peter279k
peter279k / download.php
Created April 9, 2021 17:43 — forked from beyerz/download.php
Symfony console, download remote file with progress bar using guzzle
View download.php
/**
* @param SymfonyStyle $io
* @param $remotePath
*
* @return string
*/
public function download(SymfonyStyle $io, $remotePath)
{
$io->section("Download " . $remotePath);
$parts = parse_url($remotePath);
@peter279k
peter279k / facebook_login.py
Last active March 12, 2021 18:23 — forked from UndergroundLabs/gist:fad38205068ffb904685
Facebook Python Login Script
View facebook_login.py
#!/home/drspock/scripts/FBInvite/bin/python
import argparse
import requests
import pyquery
def login(session, email, password):
'''
Attempt to login to Facebook. Returns user ID, xs token and