关闭 FireWall
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
安装 iptables
yum install iptables-services
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
yum install iptables-services
The quickest way to Penetrate GFW With ShadowSocks(Docker Container) On Centos7.
1 2 3 | |
1
| |
1
| |
1
| |
You can configure the service to run on a port of your choice. Just make sure the port number given to Docker is the same as the one given to shadowsocks. Also, it is highly recommended that you store the shadowsocks password in an environment variable as shown above. This way the password will not show in plain text when you run docker ps.
For more command line options, refer to the shadowsocks documentation
Client is the machine you want to bypass the GFW.
Download the client package Shadowsocks-win-latest-release, extract it, and run.
You can check its “System Proxy” option, which is convenient for all browsers and terminal.
看网易公开课的博弈论,很有意思,记下笔记:
don’t play a strictly dominated strategy
rational choice in case lead to outcomes suck
you can’t get what you want ,till you know what you want
put yourself in others’ shoes and try to figure out what they will do
most people are evil
年老记忆力下降,做了N+1遍了,还是忘。
apt-get purge samba
rm -rf /etc/samba /etc/default/samba
apt-get install samba
vim /etc/samba/smb.conf
[share_name]
public = yes
browseable = yes
path = /home
guest ok = yes
read only = no
writeable = yes
create mask = 0644
directory mask = 2777
systemctl restart smbd
绝大多数的不能访问的错误都是由两个原因引起:
权限问题;特别是你应该仔细检查最上层目录的权限和拥有者;大多数时候你用root创建的目录,但是访问共享的时候却用samba用户
防火墙问题,特别是selinux,关闭它试试
HTTP的图片防盗链技术基本上人民群众喜闻乐见了。 今天突然发现一种比较通用的隐藏referer来反盗链的hack手段,记录之。
简单来说,Referer是HTTP协议中的一个请求报头,用于告知服务器用户的来源页面。比如说你从Google搜索结果中点击进入了某个页面,那么该次HTTP请求中的Referer就是Google搜索结果页面的地址。
一般Referer主要用于统计,像CNZZ、百度统计等可以通过Referer统计访问流量的来源和搜索的关键词(包含在URL中)等等,方便站长们有针性对的进行推广和SEO什么的~
当然Referer另一个用处就是防盗链了,主要是图片和网盘服务器使用的较多。盗链的危害不言而喻,侵犯了版权不说,增加了服务器的负荷,却没有给真正的服务提供者带来实际利益(广告点击什么的)
另外要注意的是,Referer是由浏览器自动为我们加上的,以下情况是不带Referer的
直接输入网址或通过浏览器书签访问
使用JavaScript的Location.href或者是Location.replace()
HTTPS等加密协议
很多网站挟持脚本一般是注入https链接来隐藏referer,这样固然好用,但是一定要一个域名,有点不方便。前人实践发现只要在iframe里面的src属性填上 javascript: <html>....的内容就可以隐藏referer了。一试果然如此。
比如大家常见的微信公众号文章,如果引用过来,一般就是防盗链了,这个时候可以用下面的通用代码解决:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
这样看出来的效果就是原来引用微信的图片:
<img src="http://mmbiz.qpic.cn/mmbiz/cfxQzmUp8b0E12wMVv6SzROhSAgmxENxKPSQibVNhXAx8vr3BQW1lnlakR8wDVLc38QSZwnRfiaDtPZ0d3PhBMtQ/640?"/>
就会被替换到iframe里面,同时iframe的src属性包括了完整的html内容,这样浏览器请求图片的时候,就不会带referrer了,微信的盗链就被绕过。
不知道微信啥时候堵上这个洞呢?
UTC时间 2017-08-01 18:12,UAHF第一个大于1MB的块被挖出,虽然现在算力占比很小,但值得关注,UAHF是否能存活下去,算力来决定吧。
想要挂载一个iso安装镜像作为本地repo
mkdir -p /mnt/cdrom
mount -t iso9660 -o loop /home/Centosxxxx.iso /mnt/cdrom
vi /etc/yum.repos.d/local.repo
[localrepo]
name=Unixmen Repository
baseurl=file:///mnt/cdrom
gpgcheck=0
enabled=1
yum clean all
yum repolist
有时候需要内网环境搭建一个ntp服务器同步内网的几台机器。
四步走:
yum -y install ntp ntpdate
# line 18: add the network range you allow to receive requests
restrict 10.0.0.0 mask 255.255.255.0 nomodify notrap
# local clock
server 127.127.1.0
fudge 127.127.1.0 stratum 10
systemctl start ntpd
systemctl enable ntpd
firewall-cmd --add-service=ntp --permanent
firewall-cmd --reload
watch ntpq -p
注意reach这个值,在启动ntp server服务后,这个值就从0开始不断增加,当增加到17的时候,从0到17是5次的变更,每一次是poll的值的秒数,是64秒*5=320秒的时间。
如果之后从ntp客户端同步ntp server还失败的话,用ntpdate –d来查询详细错误信息,再做判断。
现在很多软件包默认编译要求GLIBCXX >=3.4.20,碰到这种事redhat系又哭了,目前Centos7.x默认仓库里的gcc还是4.8.5的,所以需要一个办法升级gcc相关组件>=4.9.1。
CentOS下升级gcc版本有两个途径,一个是添加其他源进行自动升级,一个是手动编译升级,这里先顺便讲下自动升级的两个办法:
在 /etc/yum.repos.d 目录中添加文件 FedoraRepo.repo ,并输入以下内容:
[warning:fedora]
name=fedora
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-23&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=https://getfedora.org/static/34EC9CBA.txt
然后执行
yum update gcc gcc-c++
yum install centos-release-scl
yum install devtoolset-4-gcc*
scl enable devtoolset-4 bash
which gcc
gcc --version
没有盈利前景的产品死掉了,话说disqus是怎么活的?