Instantly share code, notes, and snippets.

@likebeta /config.txt
Last active Jun 15, 2017

Embed
What would you like to do?
raspbian config
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16
# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720
# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1
# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group=2
hdmi_mode=16
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
hdmi_drive=2
# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
config_hdmi_boost=4
# uncomment for composite PAL
sdtv_mode=2
#uncomment to overclock the arm. 700 MHz is the default.
arm_freq=800
# for more options see http://elinux.org/RPi_config.txt
auto lo
iface lo inet loopback
# dns
dns-nameservers 223.5.5.5
dns-nameservers 202.106.0.20
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.78
netmask 255.255.255.0
gateway 192.168.1.1
network 192.168.1.0
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
# work
iface work inet static
address 172.30.137.7
gateway 172.30.137.1
netmask 255.255.0.0
# home
iface home inet static
address 192.168.0.118
gateway 192.168.0.1
netmask 255.255.255.0
#!/usr/bin/env bash
# -*- coding=utf-8 -*-
# Author: 易思龙 <ixxoo.me@gmail.com>
# Create: 2015-09-05
function log()
{
tm_str=`date +'%Y-%m-%d %H:%M:%S'`
echo -e ${tm_str}" | "$@
}
#value define
urls=("www.baidu.com" "www.ip.com")
http_code=("200" "301" "302" "404")
count=${#urls[@]}
connected=0
log "now start to check net is on or not!"
log "bash file in /root/net_restart.sh"
#check net is conneted or not
for ((i=0; i < $count; i++))
do
url=${urls[$i]}
result=$(curl -o /dev/null --head -s -m 10 -w %{http_code} $url)
for flag in ${http_code}
do
if [ $flag = $result ];then
connected=$(expr $connected + 1)
fi
done
done
#if net is down then restart
if [ $connected -eq 0 ];then
log "network is not very well !"
log "now restart net !"
/etc/init.d/networking restart
fi
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="9527"
psk=""
priority=5
id_str="work"
}
network={
ssid="TP-7-1-402"
psk=""
priority=4
id_str="home"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment