Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
yum -y update
yum -y groupinstall "Development Tools"
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel
version=7.15
cd /opt
wget --no-check-certificate https://www.python.org/ftp/python/2.$version/Python-2.$version.tgz
tar xzf Python-2.$version.tgz
cd Python-2.$version
./configure --prefix=/usr/local
#!/bin/sh
version=$1
yum -y install gcc gcc-c++ kernel-devel glibc-static libstdc++-static
cd /opt
wget ftp://gcc.gnu.org/pub/gcc/releases/gcc-$version/gcc-$version.tar.$2
tar $3 gcc-$version.tar.$2 -C /usr/local/src
cd /usr/local/src/gcc-$version
./contrib/download_prerequisites
mkdir /usr/local/build
mkdir /usr/local/build/gcc-$version
ALTER USER 'root'@'localhost' IDENTIFIED BY 'FUcK_Y0u_new_My$ql_pa$$wd_p0licy';
SET GLOBAL validate_password.check_user_name = OFF;
SET GLOBAL validate_password.length = 1;
SET GLOBAL validate_password.mixed_case_count=0;
SET GLOBAL validate_password.number_count=0;
SET GLOBAL validate_password.policy=LOW;
SET GLOBAL validate_password.special_char_count=0;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
# -*- coding: utf-8 -*-
import csv
import math
import datetime
import pytz
class _5coin_structure:
def __init__(self, row: tuple):
self.datetime = row[0]
self.category = row[1]

Install armhf debian system on qemu

Environment

Operation system: Ubuntu 16.04.6 LTS

QEMU emulator version: 2.5.0

Installation

# -*- coding: utf-8 -*-
import subprocess
import os
from typing import NoReturn
def walksdir(_dir: str='.') -> NoReturn:
for root, dirs, _ in os.walk(_dir):
#print(dirs)
for x in dirs:
subp = subprocess.Popen(['du', '-sh', x], stdout=subprocess.PIPE)
# -*- coding: utf-8 -*-
from dataclasses import dataclass
from typing import NoReturn
import bs4
import requests
@dataclass
class UserStatus:
@KunoiSayami
KunoiSayami / jupyter-lab.service
Created October 13, 2020 17:15
Systemd file for jupyter lab
; Works on Arch Linux 5.8.14-arch1-1
[Unit]
Description=Jupyter lab
[Service]
Type=simple
ExecStart=/usr/bin/jupyter-lab --ip 0.0.0.0 --port 9090
ExecStop=sh -c 'kill -2 $MAINPID && kill -2 $MAINPID && tail --pid=$MAINPID -f /dev/null'
WorkingDirectory=/home/user/notebook
User=user
# Try to find the GMP library
# https://gmplib.org/
#
# This module supports requiring a minimum version, e.g. you can do
# find_package(GMP 6.0.0)
# to require version 6.0.0 to newer of GMP.
#
# Once done this will define
#
# GMP_FOUND - system has GMP lib with correct version