- 开启ipv4转发
vi /etc/sysctl.conf
# 将net.ipv4.ip_forward=0更改为net.ipv4.ip_forward=1
sysctl -p
- 安装dnsmasq 和pdnsd解决dns污染
DNS的解析方案为 resolve.conf ==> dnsmasq ==> pdnsd
# no 64 bit version of the flash debug player is available, thus we will use the 32 bit version and use nspluginwrapper to make it work | |
sudo killall -9 firefox | |
sudo apt-get remove -y --purge flashplugin-nonfree gnash gnash-common mozilla-plugin-gnash swfdec-mozilla libflashsupport nspluginwrapper | |
sudo rm -f /usr/lib/mozilla/plugins/*flash* | |
sudo rm -f ~/.mozilla/plugins/*flash* | |
sudo rm -f /usr/lib/firefox/plugins/*flash* | |
sudo rm -f /usr/lib/firefox-addons/plugins/*flash* | |
sudo apt-get install ia32-libs nspluginwrapper libcurl3 libnss3-1d libnspr4-0d | |
cd ~ |
public static void printPermissions(Context context) { | |
PackageInfo android; | |
try { | |
android = context.getPackageManager().getPackageInfo("android", PackageManager.GET_PERMISSIONS); | |
} catch (PackageManager.NameNotFoundException e) { | |
e.printStackTrace(); | |
return; | |
} | |
PermissionInfo[] permissions = android.permissions; |
package me.barrasso.android.volume.ui; | |
/* | |
* Copyright (C) 2010 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 |
import java.util.ArrayList; | |
import java.util.List; | |
import android.content.Context; | |
import android.graphics.Typeface; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.ArrayAdapter; | |
import android.widget.TextView; |
vi /etc/sysctl.conf
# 将net.ipv4.ip_forward=0更改为net.ipv4.ip_forward=1
sysctl -p
DNS的解析方案为 resolve.conf ==> dnsmasq ==> pdnsd
import java.util.List; | |
public interface DiskCache<T> { | |
/** | |
* Sets the value to {@code value}. | |
*/ | |
public void set(String key, T value); | |
/** |
wget -q http://mirrors.kernel.org/ubuntu/pool/universe/g/goocanvas/libgoocanvas-common_1.0.0-1_all.deb
wget -q http://mirrors.kernel.org/ubuntu/pool/universe/g/goocanvas/libgoocanvas3_1.0.0-1_amd64.deb
wget -q http://mirrors.kernel.org/ubuntu/pool/universe/libg/libgoo-canvas-perl/libgoo-canvas-perl_0.06-2ubuntu3_amd64.deb
sudo dpkg -i libgoocanvas-common_1.0.0-1_all.deb ; sudo apt-get -f install ; sudo dpkg -i libgoocanvas3_1.0.0-1_amd64.deb ; sudo apt-get -f install; sudo dpkg -i libgoo-canvas-perl_0.06-2ubuntu3_amd64.deb ; sudo apt-get -f install
#!/bin/bash | |
apt-get install mc htop git unzip wget curl -y | |
echo | |
echo "=====================================================" | |
echo " WELCOME" | |
echo "=====================================================" | |
echo | |
echo "Hub" |
def splitDataFrameList(df,target_column,separator): | |
''' df = dataframe to split, | |
target_column = the column containing the values to split | |
separator = the symbol used to perform the split | |
returns: a dataframe with each entry for the target column separated, with each element moved into a new row. | |
The values in the other columns are duplicated across the newly divided rows. | |
''' | |
def splitListToRows(row,row_accumulator,target_column,separator): | |
split_row = row[target_column].split(separator) |
resolver 8.8.8.8; | |
location /video/ { | |
if ($request_uri ~ "^/video/(.+?)/.+") { | |
set $upstream_host $1.googlevideo.com; | |
add_header Content-Disposition "attachment; filename=video.mp4;"; | |
} | |
rewrite /video/.+?/(.+)$ /$1 break; | |
proxy_buffering off; | |
proxy_pass https://$upstream_host; | |
proxy_set_header Host $upstream_host; |