2018年12月8日 星期六

Ubuntu 16.04 解 LCD 上的水平紋

一直以為是電腦不夠力, 或電視太爛

最近忽然想到來 google 一下, 才發現這是可以解決的

https://askubuntu.com/questions/945895/solution-to-intel-graphics-screen-tearing-flickering-causes-excessive-fan-use

加個 file : /usr/share/X11/xorg.conf.d/20-intel_flicker_fix.conf

內容:
Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option      "TripleBuffer" "true"
   Option      "TearFree"     "true"
   Option      "DRI"          "false"
EndSection

就這樣~~

不過有趣的是, 加了重開機後, xrandr 顯示 screen name 變了, 變回和 Ubuntu 10.04 一樣 : HDMI1 而不是 HDMI-1

2019/03/23 update:
 DRI 要設為 "true"
 換了大電視, 之前沒看出的較小細紋現在看得一清二楚, 設成 ture 之後就解決了~~

2018年1月19日 星期五

Ubuntu 16.04 as wifi hotspot

忘了在哪裏看來的, 但最終這是唯一確定可用的設定, PC 和 RPI 3 皆可用

ubuntu 現在不用 eth0 wlan0 了, 而是用一串很詭異的名字, 要先用 ifconfig 看一下再去改

1.
/etc/dhcpcd.conf
  add denyinterfaces wlan0 (above any interface line)

2.
/etc/network/interfaces
  edit wlan0 setion as
   -------------------
allow-hotplug wlan0
iface wlan0 inet static
    address 172.24.1.1
    netmask 255.255.255.0
    network 172.24.1.0
    broadcast 172.24.1.255
   -------------------

3.
install/config hostapd
/etc/hostapd/hostapd.conf
-------------------------
#this is the name of the WiFi interface we configured above
interface=wlan0

# Use the nl80211 driver with the brcmfmac driver
driver=nl80211

# This is the name of the network
ssid=Pi3-AP

# Use the 2.4GHz band
hw_mode=g

# Use channel 6
channel=6

# Enable 802.11n
ieee80211n=1

# Enable WMM
wmm_enabled=1

# Enable 40MHz channels with 20ns guard interval
ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]

# Accept all MAC addresses
macaddr_acl=0

# Use WPA authentication
auth_algs=1

# Require clients to know the network name
ignore_broadcast_ssid=0

# Use WPA2
wpa=2

# Use a pre-shared key
wpa_key_mgmt=WPA-PSK

# The network passphrase
wpa_passphrase=raspberry

# Use AES, instead of TKIP
rsn_pairwise=CCMP
-------------------------
/etc/default/hostapd
  DAEMON_CONF="/etc/hostapd/hostapd.conf"

4.
install/config dnsmasq.conf
/etc/dnsmasq.conf  ( orig : /etc/dnsmasq.conf.orig)
-------------------------
interface=wlan0      # Use interface wlan0
listen-address=172.24.1.1 # Explicitly specify the address to listen on
bind-interfaces      # Bind to the interface to make sure we aren't sending things elsewhere
server=8.8.8.8       # Forward DNS requests to Google DNS
domain-needed        # Don't forward short names
bogus-priv           # Never forward addresses in the non-routed address spaces.
dhcp-range=172.24.1.50,172.24.1.150,12h # Assign IP addresses between 172.24.1.50 and 172.24.1.150 with a 12 hour lease time
-------------------------

5. IPV4 forwarding
/etc/sysctl.conf
  net.ipv4.ip_forward=1 (# mark/unmark)
command line :
-------------------------
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT

sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"
------------------------
/etc/rc.local
  iptables-restore < /etc/iptables.ipv4.nat

6.
sudo service hostapd start
sudo service dnsmasq start