跳至主要内容

博文

目前显示的是 七月, 2016的博文

centos 7 禁用ipv6

Upstream employee Daniel Walsh  recommends  not disabling the  ipv6  module, as that can cause issues with SELinux and other components, but adding the following to /etc/sysctl.conf: net. ipv6 .conf.all. disable _ ipv6 = 1 net. ipv6 .conf.default. disable _ ipv6 = 1 take out the  ipv6  localhost from /etc/hosts . Additional Note #3  : To  disable  RPCBIND  ipv6  (rpcbind, rpc.mountd, prc.statd) remark out the udp6 and tcp6 lines in /etc/netconfig: udp tpi_clts v inet udp - - tcp tpi_cots_ord v inet tcp - - #udp6 tpi_clts v inet6 udp - - #tcp6 tpi_cots_ord v inet6 tcp - - rawip tpi_raw - inet - - - local tpi_cots_ord - loopback - - - unix tpi_cots_ord - loopback - - -

用cryptsetup加密U盘

cryptsetup是linux自带的加密程序,使用起来很方便,基本和truecrypt差不多。 1、用cryptsetup格式化分区 cryptsetup luksFormat /dev/sda1 2、用cryptsetup进行分区映射 cryptsetup open /dev/sda1 sdisk<-这是自定义的映射后的设备名 3、用系统标准格式化程序格式化分区 mkfs.ext4 /dev/mapper/sdisk 4、挂载分区 mount /dev/mapper/sdisk /mnt/udisk ... sync 5、卸载分区 umount /dev/mapper/sdisk 6、断开映射 cryptsetup close sdisk

freebsd 使用初体验

一直很仰慕FREEBSD的大名,抽空在虚机上安装了一份。 总体感觉是10.3较8.X版有很大的进步。安装过程相当简单,分区、系统安装、网络配置,一路走下来都是自动完成。 10.3版安装后,ports和pkg都缺省配置好了,系统默认的shell是csh,使用上比较不习惯,但是可以用pkg安装bash。 总体上说freebsd还是有了巨大的发展和改善,但是要熟悉和用起来还需要认真的阅读下官方的handbook,毕竟与linux相比,freebsd还是要使用者更多的手动操作,定制性非常好。

vcgencmd 常用命令

vcgencmd commands vcgencmd get_mem arm && vcgencmd get_mem gpu for src in arm core h264 isp v3d uart pwm emmc pixel vec hdmi dpi ; do echo -e "$src:\t$(vcgencmd measure_clock $src)" ; done for id in core sdram_c sdram_i sdram_p ; do  echo -e "$id:\t$(vcgencmd  measure_volts $id)" ;  done vcgencmd version vcgencmd measure_temp for codec in H264 MPG2 WVC1 MPG4 MJPG WMV9 ; do echo -e "$codec:\t$(vcgencmd codec_enabled $codec)" ; done

raspberry pi 获取CPU/GPU温度

#!/usr/bin/python # -*- coding: utf-8 -*- import commands def get_cpu_temp(): tempFile = open( "/sys/class/thermal/thermal_zone0/temp" ) cpu_temp = tempFile.read() tempFile.close() return float(cpu_temp)/1000 # Uncomment the next line if you want the temp in Fahrenheit #return float(1.8*cpu_temp)+32 def get_gpu_temp(): gpu_temp = commands.getoutput( '/opt/vc/bin/vcgencmd measure_temp' ).replace( 'temp=', '' ).replace( '\'C', '' ) return float(gpu_temp) # Uncomment the next line if you want the temp in Fahrenheit # return float(1.8* gpu_temp)+32 def main(): print "CPU temp: ", str(get_cpu_temp()), "'C" print "GPU temp: ", str(get_gpu_temp()), "'C" if __name__ == '__main__': main()