Skip to content

Instantly share code, notes, and snippets.

@Mahedi-61
Mahedi-61 / cuda_11.8_installation_on_Ubuntu_22.04
Last active June 12, 2024 10:40
Instructions for CUDA v11.8 and cuDNN 8.9.7 installation on Ubuntu 22.04 for PyTorch 2.1.2
#!/bin/bash
### steps ####
# Verify the system has a cuda-capable gpu
# Download and install the nvidia cuda toolkit and cudnn
# Setup environmental variables
# Verify the installation
###
### to verify your gpu is cuda enable check
adb shell dumpsys window windows | grep 'mCurrentFocus'
adb shell am start -n com.example.demo/com.example.test.MainActivity
am start -n "com.example.app.dev/com.example.app.phonebook.PhoneBookActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
adb shell am start -n net.kishonti.gfxbench.gl.v50000.corporate/net.kishonti.benchui.initialization.InitActivity
net.kishonti.app.MainActivity
/storage/emulated/0/Android/data/net.kishonti.gfxbench.gl.v50000.corporate/files/data/top-results.sqlite
adb install sgfxbench_gl-5.0.0-RC5+corporate.armeabi-v7a.x86_64.arm64-v8a.x86.apk
.adb shell am start -n net.kishonti.gfxbench.gl.v50000.corporate/net.kishonti.app.MainActivity
#% before, # after
echo "deb http://deb.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list
echo "deb http://deb.debian.org/debian jessie-backports-sloppy main" >> /etc/apt/sources.list.d/jessie-backports.list
apt update
apt install shadowsocks-libev simple-obfs curl -y
cat > /etc/shadowsocks-libev/config.json <<EOF
{
"server":"0.0.0.0",
"server_port":443,
"local_port":1080,
@fffaraz
fffaraz / bs4.py
Created November 25, 2016 20:21
Python YouTube Playlist Link Collector
from bs4 import BeautifulSoup
import requests
def getPlaylistLinks(url):
sourceCode = requests.get(url).text
soup = BeautifulSoup(sourceCode, 'html.parser')
domain = 'https://www.youtube.com'
for link in soup.find_all("a", {"dir": "ltr"}):
href = link.get('href')
if href.startswith('/watch?'):
@waveacme
waveacme / append.cpp
Created April 15, 2016 03:54
append int to string in c++
// from http://stackoverflow.com/questions/191757/c-concatenate-string-and-int
std::string name = "John";
int age = 21;
std::string result;
// 1. with Boost
result = name + boost::lexical_cast<std::string>(age);
// 2. with C++11
@messense
messense / shadowsocks-on-openwrt.md
Last active June 8, 2023 07:49
shadowsocks on openwrt

配置 shadowsocks

架设好 shadowsocks 服务端,在路由器上安装 shadowsocks 客户端,并配置 /etc/config/shadowsocks.json ,假设本地监听端口为 1080 。启动 shadowsocks

/etc/init.d/shadowsocks start

配置 privoxy

安装 privoxy openwrt 版。