昨天,今天,明天,每天的每天,你是否都多懂得一点点...

星期一, 六月 25, 2018

Docker pull 503 Service Unavailable

Today, one of my colleagues asked me to try to download a docker image because he encountered a network issue. 

Then I tried and found out I had the exact issue as he had.

λ docker pull tiangolo/uwsgi-nginx-flask
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/tiangolo/uwsgi-nginx-flask/manifests/latest: received unexpected HTTP status: 503 Service Unavailable

Obviously, this is not a network issue, it's docker's registry issue.

So if you can't wait, you can use a mirror registry to download the docker images you want. Here are two examples. 


Docker official china mirror (Fast in China, slow outside):


Google Cloud's mirror (less images)


--
Feng

星期六, 六月 23, 2018

海外党如何看CCTV5 的世界杯直播 - 第二弹


上期分享了飞流直播和几个高清源, 给我带来了可观的订阅数, 这里非常感谢订阅我频道的朋友 , 也希望更多的朋友订阅我的频道. 这期整合了四个在线网站, 两个APP, N个直播源, 更多的方法, 更多的选择. 喜欢我的频道的话, 请一定要订阅哦. 你的订阅就是我的动力. 相关下载和网站地址请到这里: http://www.dengnz.com/youtube/ 上期分享的方法看这里: https://youtu.be/R9iywpPtQM8 直播源和分享码的使用方法看这个视频 https://youtu.be/-8aWlHjkcd4

--
Feng

星期五, 六月 22, 2018

Youtube Partner 终于审核通过了!!!

我X, 足足审批了半年, Monetisation 终于是 Enabled了. Youtube也没有给我发邮件,就这么偷偷的Enable 了. 

激动呀!!!




--
Feng

星期二, 六月 19, 2018

继续mark 我的 alexa 排名




--
Feng

海外党如何看CCTV5 的世界杯直播


一到世界杯或是别的什么重要赛事, 很多直播软件的中央5套就废了, 这里分享一些看CCTV5的方法, 直播源我会尽可能更新.

喜欢我的频道的话, 请一定要订阅哦. 你的订阅就是我的动力.

相关下载和网站地址请到这里:

直播源和分享码的使用方法看这个视频 https://youtu.be/-8aWlHjkcd4


--
Feng

星期五, 六月 15, 2018

Alexa 排名隔一天,又涨了

才隔一天, 排名又涨两万, 中国区更是4万以内。



--
Feng

星期四, 六月 14, 2018

Alexa Rank


之前从来没有关注过自己网站的Alexa排名。 今天心血来潮看了一下,居然全球在43万5左右。三个月排名提高一百多万。

 还不错! 在中国的排名更是在5万以内







--
Feng

星期二, 六月 12, 2018

Remote desktop without setting up VPN on client machine, use a middle man

I setup my VPN on both of my mac os and Windows. I usually work on my Mac OS. The VPN and remote desktop is working fine.

Today is a bit cold. I work with my surface pro in the bed. But suddenly, the remote desktop via VPN stop working. The VPN can be connected, but I couldn't ping my PC in office.

I don't have time to do the troubleshooting. While my mac os is working fine, I decide to use it as a middle man to connect to my office PC.

Only one command is needed to make this work.

putty -L 127.0.0.1:1234:192.168.0.75:3389 fengnz@fengmac-2


I use putty instead of openSSH on windows.


What this command does is forwarding the connection to my local port 1234 to 192.168.0.75's 3389 port via my mac os. 192.168.0.75 is my office pc's IP. 3389 is the remote desktop port. 

Then start remote desktop client and connect to 127.0.0.1:1234

You may need to change the login account. The login account should contains office network's name. For example, company/username



--
Feng

怎么看待微软收购超大开源社区Github

微软在6月4号公布对Github的收购事宜. 
没过两天Gitlab 就发布数据说它们每天创建的代码库增长了10倍。 

Gitlab 的网站上一边说恭喜微软, 另一边急不可耐的推出数据迁移的服务, 居心叵测.


Gibhub 现在有 2800万的注册用户, 拥有 8500万的代码库。 就算只有很小一部分转投Gitlab, giblab 无疑还是这场收购的大赢家。

为什么那么多人转投gitlab 的怀抱?  
而且网上对微软的这次收购也是骂声一片。

这个得先说说微软的收购黑历史了, 从 1987年到现在, 微软总共收购了200多家公司. 耳熟能详的有

1997年12月以 5亿美元收购 Hotmail 电子邮件网站
2000年1月以 13.75 亿美元收购 Visio 画图软件
2011年5月以 85 亿美元收购 skype 即时通讯软件
2013年9月以 72亿美元收购 诺基亚手机
2016年8月以262亿美元收购 LinkedIn 求职社交网站
2018年6月以75亿美元收购Github





我们今天抓两个典型的黑历史来说一说


Nokia

微软在2013年以 72亿美元的价格收购诺基亚, 然后在2015年承认这是一次失败的收购。 这里面有没有猫腻, 比如说这些公司的钱有没有以另一种方式转一圈回到少数微软高层手中就不得而知了。总的来说就是买完就死了。



Skype

很多人说自从微软收购skype 后他们就再也不用了。 微软收购skype 后, 慢慢的,就把原来的skype 搞没了。 微软把他们自己的产品 lync 和 commucator 发展成新的skype for business. 原来的skype code 根本就被弃用了。 所以说现在的skype 已经不是原来的skype, 微软买skype 只是为了买用户而已。这种事会不会发现在github 上面呢? 是很有可能的。 微软本身就有自己的git repo. 开发者可以用MSTS, Microsoft Team foundation service 来创建git repo. 技术上, 微软并不需要从github得到什么。 他们要的只是github 2800万的用户和8900万的代码库。他们可能在他们原来的 MSTS的基础上, 导入github 的 数据, 然后用github 的名义推出一款新的产品。


网上很多人仇视微软, 不只是不喜欢. Github是个开源社区, Github上面的作者有很多是开源的支持者. 而微软的前CEO Steve Ballmer 曾经说过开源是癌症. 估计他这句话不知道拉了多少仇恨. 所以现在还有很多人恨着微软.

微软的霸道独裁还体现在在windows 捆绑IE. 和联想电脑签定协议, 让联想电脑只能装Windows系统. 在WINDOWS里值入很多疑似间谍软件的东西. 导至很多人不信任微软. 

由于对微软收购后的运营和行业操守的不信任, 很多人便开始转移他们在Github上的代码.

这次收购对HitHub 有什么好处?

钱钱钱, 据说HitHub这些年一直在亏钱

这次收购对微软有什么好处?

代码, 代码, 代码, 微软当然不是要Github 的技术, 也没有什么技术可言. 要的就是用户和代码. 我的同事说微软可能会有AI来分析Github 上的数据, 然后分析出好的代码, 发掘人才. 如果你觉得自己的代码很牛, 而且有放在Github上, 可以坐等微软电话了, 微软猎头会请你喝茶的. 还有人担心以微软的职业操守, 它很可能盗用Github 上的优秀代码... 你说Github 本来就是开源的? 可是Hithub上也有很多private repo呀.  据小道消息说github 上的代码是完全没有加密的, 微软买过去后可以随便看, 不管是私有的还是公开的.


对普通人来说,有没有影响?

我要说的是, 该吃吃该睡睡, 微软以前两百多次收购, 哪次碍着你了?


--
Feng

星期五, 五月 25, 2018

(翻墙VPS)谷歌云一年免费帐户申请+架设ShadowSocksR服务器+客户端设置


利用谷歌云提供的300美元一年的免费试用, 可以架设个SSR的翻墙服务器用很久, 看YOUTUBE高清无压力.



用到的命令:

//先跟着这个页面的1,2,3,4步添加docker repository
//安装docker
sudo apt-get update && sudo apt-get install docker-ce
//单命令架设SSR
sudo docker run -d --rm --name ssr -p 81:81 malaohu/ssr-with-net-speeder -s 0.0.0.0 -p 81 -k P@ssw0rd -m rc4-md5 -o http_simple


推荐的协议和混淆参数看这里

不是所有的参数都能在这个教程里用, 比如chacha20的加密算法就用不了, 因为这个docker image 的作者没有加libsodium 的包. 我有空会定制一个新的docker image, 把这些加进去.

对原理有兴趣的请看这里:

这里分享一个ShadowSocksR 服务器
ShadowSocks R


server: 35.229.147.33
port: 81
protocol: origin
password: 看视频最后几分钟
method: rc4-md5
obfs: http_simple



--
Feng

星期四, 五月 24, 2018

Git - Reapply changes that were accidentally rollback

Here is the scenario

I made some changes and commit the file
I accidentally undo the change in my editor then made some more changes and commit
Now I realized the first change has been rollback.


Here is what I did

Find the finger print of my first change  a6dfb30, and find the original finger print  7c54b25, use the following command to generate the patch file


git diff  7c54b25 a6dfb30 -- src/app/dashboard/dashboard.component.html > 1.patch

Then apply the patch

git apply 1.patch

Done

--
Feng

星期二, 五月 22, 2018

Docker nginx doesn't work with angular route

If you are serving angular app with nginx docker image, you will notice that your cannot directly access your app route Url directly from browser's address bar.  You will get 404 file not found error. 

To resolve this, you need to edit the default.conf file to tell nginx how to find files.

// Copy your conf.d directory out to your current dir 
docker cp columnConcator:/etc/nginx/conf.d .
// Stop the container
docker stop columnConcator
// Edit the default.conf file in conf.d dir
// Update your location block as following:

location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
try_files $uri $uri/ /index.html;

    }

// copy modified directory back
sudo docker cp conf.d/ columnConcator:/etc/nginx
// restart the docker
docker start columnConcator

Done!


--
Feng

星期一, 五月 21, 2018

Dropbox selective sync on Ubuntu using Dropbox CLI

To install dropbox cli, run

sudo apt-get install nautilus-dropbox

To login to your dropbox

dropbox start -i

Now a url will be provided, paste this url to your favorite browser and allow the sync.

Now start the dropbox deamon by
dropbox start

Your dropbox account are now linked to your ubuntu.

Now enter your dropbox folder
cd Dropbox
Then run this command to exclude all the folders
dropbox exclude add *

This will exclude all the folders to be sync, except files under Dropbox root folder.

Now start including your selective sync folders.

dropbox exclude remove fengubuntu

Hint: You can use --help to get help of a sub command, for example, dropbox exclude --help will show your how to use dropbox exclude command.


--
Feng

星期五, 五月 18, 2018

Use Kdiff3 for git diff

​​
Firstly, put kdiff3 into the path

 set path=%path%;C:\Program Files\KDiff3

Then run 

git difftool --tool=kdiff3

You can calso config kdiff3 as the default diff tool

git config --global diff.tool kdiff3

Then you can just run 

git difftool

use -y if you don't have to see prompts

git difftool  -y

In Kdiff3's Config, you may would like to enable "Quit also via Esacpe key" to be able to quick exit kdiff3 for next file.

--
Feng

星期二, 五月 15, 2018

Use SASS .scss style sheet with Angular 2+

SCSS is build in with angular 2+.

To use SCSS in your project, 

change the style.css file to style.scss

then change style.css to style.scss in your .angular-cli.json file.

All done.

--
Feng

星期一, 五月 14, 2018

Use font awesome with angular2+ material

npm install font-awesome --save

Then 

Import css from .angular-cli.json

"styles": [
        "styles.css",
        "../node_modules/font-awesome/css/font-awesome.css"
      ],



Add the following style to style.css

.fontawesome {
    display: inline-block;
    font: normal normal normal 14px/1 FontAwesome;
    font-size: 24px;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    text-align: center;
}

​use 

<mat-icon color="primary" fontSet="fontawesome" fontIcon="fa-thumb-tack"></mat-icon>​




--
Feng

星期五, 五月 11, 2018

TextArea in Draggable container doesn't work well with firefox 60.0

I used the following module in my angular project.


It works fine on google chrome.

Whereas on Firefox, the textarea inside a draggble container cannot get focus from mouse click. And it always scroll to top when typing.

--
Feng

星期四, 五月 10, 2018

Use docker ps --format to get pretty output


fengnz@mac:~ > docker ps --format '{{.Names}} {{.Image}}'
jh-mysql mysql
test_sshd rastasheep/ubuntu-sshd
ubuntu ubuntu
wp wordpress
wp-mysql mysql

--
Feng

MYBB enable HTTPS

I built a forum and enabled HTTPS for it though nginx_proxy and it's companion.

But certificate was not working. 

I stop and rm the companion docker container and recreate it again.

sudo docker run \
--name companion \
-v /home/fennng/certs:/etc/nginx/certs:rw \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
--volumes-from nginx-proxy \
jrcs/letsencrypt-nginx-proxy-companion

Problem resolved. 

But with HTTPS, I got following error:





​To fix this 

remove http: from Board URL


​Problem solved 


​ Mixed content issue will come back if someone post images or medias​ with HTTP. I will leave it for now.


--
Feng

星期三, 五月 09, 2018

Shadowsocks 服务器的架设与使用

需要一台安装有docker 的 虚拟机

运行如下命令架设好服务器, 只需一条命令, 确保端口公共

​docker run -d --rm --name ssr -p 81:81 malaohu/ssr-with-net-speeder -s 0.0.0.0 -p 81 -k your-password rc4-md5 -o http_simple
查看参数

root@fengUbuntu:~# docker logs ssr
 * Restarting OpenBSD Secure Shell server sshd
   ...done.
2018-05-09 01:42:45 INFO     util.py:85 loading libcrypto from libcrypto.so.1.0.0
2018-05-09 01:42:45 INFO     shell.py:72 ShadowsocksR 3.4.0 2017-07-27
2018-05-09 01:42:45 INFO     server.py:46 current process RLIMIT_NOFILE resource: soft 1048576 hard 1048576
2018-05-09 01:42:45 INFO     asyncdns.py:324 dns server: [('168.63.129.16', 53)]
2018-05-09 01:42:45 INFO     server.py:106 server start with protocol[origin] password [your-password] method [rc4-md5] obfs [http_simple] obfs_param []
2018-05-09 01:42:45 INFO     server.py:142 starting server at 0.0.0.0:81

安装客户端


按参数填就是了

​不想要了就 docker stop ssr 删掉​

用 Azure container instance 的话, 连虚拟机都不要, 一条命令架设

az container create --name ssr --image  malaohu/ssr-with-net-speeder --resource-group testACI --ip-address public --port 81 --command-line "/usr/local/bin/entrypoint.sh -s 0.0.0.0 -p 81 -k your-password -m rc4-md5 -o http_simple



查看状态
az container show --resource-group testACI --name ssr

查看参数
az container logs --resource-group testACI --name ssr
 * Restarting OpenBSD Secure Shell server sshd
   ...done.
2018-05-09 03:57:11 INFO     util.py:85 loading libcrypto from libcrypto.so.1.0.0
2018-05-09 03:57:11 INFO     shell.py:72 ShadowsocksR 3.4.0 2017-07-27
2018-05-09 03:57:11 INFO     server.py:46 current process RLIMIT_NOFILE resource: soft 1048576 hard 1048576
2018-05-09 03:57:11 INFO     asyncdns.py:324 dns server: [('168.63.129.16', 53)]
2018-05-09 03:57:11 INFO     server.py:106 server start with protocol[origin] password [your-password] method [rc4-md5] obfs [http_simple] obfs_param []
2018-05-09 03:57:11 INFO     server.py:142 starting server at 0.0.0.0:81


删了
az container delete --resource-group testACI --name ssr





--
Feng

其它博客地址

此博客的同步博客地址: http://fengnz.wordpress.com
这里进入我的MSN SPACE.