自动下载并合并Hosts文件
hosts.py [--download] [--apply] [--addhosts url] [--pid]
--download
下载Hosts文件(合并至hosts.tmp)--apply
应用至系统(/etc/hosts)--addhosts url
添加URL到HOSTS源列表(hosts.json)--pid
显示pid
默认携带的HOSTS源:
#! /bin sh | |
# only for fedaora23 | |
cd ~ | |
wget http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-23.noarch.rpm | |
rpm -ivh rpmfusion-free-release-23.noarch.rpm | |
rm -rf rpmfusion-free-release-23.noarch.rpm | |
wget http://dl-http.senorsen.com/pub/package/linux/rpm/netease-cloud-music-0.9.0-4.x86_64.rpm | |
dnf install gstreamer1-plugins-ugly openal-soft opencore-amr qt5-qtmultimedia qt5-qtx11extras -y | |
rpm -ivh netease-cloud-music-0.9.0-4.x86_64.rpm | |
rm -rf netease-cloud-music-0.9.0-4.x86_64.rpm |
自动下载并合并Hosts文件
hosts.py [--download] [--apply] [--addhosts url] [--pid]
--download
下载Hosts文件(合并至hosts.tmp)--apply
应用至系统(/etc/hosts)--addhosts url
添加URL到HOSTS源列表(hosts.json)--pid
显示pid默认携带的HOSTS源:
echo "Setting up env." | |
# | |
apt update -y | |
# | |
apt upgrade -y | |
# Basic tools | |
apt install wget curl tar unzip patch man less nodejs python -y |
Call function in protection mode, it's more comfortable way to handle errors.
How to use:
void _handleMessage(WebSocket wsock, String data){
var parts = pcall(() => _parseMessage(data), (error, st){
_messageFormatNotAcceptedHandler(wsock, error, st);
});
if (isFail(parts)) return;
var command = parts[0];
Map playload = pcall(() => JSON.decode(parts[1]), (error, st){
I hereby claim:
To claim this, I am signing this object:
import os | |
import glob | |
import yaml | |
import json | |
import glob | |
import argparse | |
from pluginbase import PluginBase | |
try: | |
from yaml import CLoader as Loader, CDumper as Dumper | |
except ImportError: |
//! Fast and small locks. | |
//! This implementation based on WebKit's https://webkit.org/blog/6161/locking-in-webkit/ | |
const std = @import("std"); | |
const futex = std.Thread.Futex; | |
const Allocator = std.mem.Allocator; | |
const Atomic = std.atomic.Atomic; | |
const assert = std.debug.assert; | |
const ThreadData = struct { | |
shouldPark: bool = false, |
#!/bin/sh | |
WAN_IF="wan" | |
if [ "$INTERFACE" = "$WAN_IF" ]; then | |
if [ "$ACTION" = "ifup" ]; then | |
if [ "$(bbgu_netlogin loginp)" = "0" ]; then | |
IFACE="$INTERFACE" bbgu_netlogin login | |
fi | |
fi |