小鬼之家

流浪,游走于文明与原始之间. 关注底层技术,实现美好生活。

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2018年2月11日

摘要: 今天向差不多工作了十年的公司辞职了,离过年还有5天,年后得好好找工作了,希望一切顺利。 阅读全文
posted @ 2018-02-11 12:24 黄尚 阅读(293) 评论(0) 推荐(0) 编辑

2017年9月8日

摘要: 链接airport命令: 列出无线网列表: 抓包: 阅读全文
posted @ 2017-09-08 00:27 黄尚 阅读(976) 评论(0) 推荐(0) 编辑

2017年8月13日

摘要: ssh -o ProxyCommand='nc -x 127.0.0.1:1080 %h %p' username@server 阅读全文
posted @ 2017-08-13 11:55 黄尚 阅读(4345) 评论(0) 推荐(0) 编辑

2017年4月21日

摘要: git config --global http.proxy 'socks5://127.0.0.1:1080' git config --global https.proxy 'socks5://127.0.0.1:1080' 阅读全文
posted @ 2017-04-21 21:54 黄尚 阅读(2591) 评论(0) 推荐(0) 编辑

2016年12月29日

摘要: 批量修改文件名: 批量替换文件内容: 按行读数据,拆分,输出: 阅读全文
posted @ 2016-12-29 21:28 黄尚 阅读(193) 评论(0) 推荐(0) 编辑

2016年10月21日

摘要: 禁止 System Integrity Protection 按住 command + R 重启系统 进入单用户模式 启动bash工具: 输入: csrutil disable 输入:reboot 启动完成后可以在bash工具中输入:csrutil status真看状态。 启用 System Int 阅读全文
posted @ 2016-10-21 22:51 黄尚 阅读(575) 评论(0) 推荐(0) 编辑

2016年5月24日

摘要: project(nginx) cmake_minimum_required(VERSION 2.8) aux_source_directory(. SRC_LIST) aux_source_directory(./src/core SRC_LIST) aux_source_directory(./src/event SRC_LIST) aux_source_directory(./src/ev... 阅读全文
posted @ 2016-05-24 22:15 黄尚 阅读(1583) 评论(0) 推荐(0) 编辑

2016年3月25日

摘要: 创建一个最小的基本镜像: 建一个hello.go: 编译hello.go 建一个Dockerfile 编译Dockerfile 运行hello-go 发布docker image 阅读全文
posted @ 2016-03-25 01:18 黄尚 阅读(1266) 评论(0) 推荐(0) 编辑

2016年3月17日

摘要: 对硬盘sdb进行分区 使用GPT格式 建立一个主分区 显示分区信息 退出 格式化为xfs格式 加入自动挂载 挂载分区 查看磁盘信息 阅读全文
posted @ 2016-03-17 22:54 黄尚 阅读(6431) 评论(0) 推荐(0) 编辑

2016年1月16日

摘要: rsync -avzP /www/ -e ssh root@192.168.1.200:/www/批处理上传:#!/bin/bashfor (( ; ; ))do rsync -avzP /www/www.site.com/public_html/ -e ssh root@ip:/www/www.... 阅读全文
posted @ 2016-01-16 17:06 黄尚 阅读(1077) 评论(0) 推荐(0) 编辑

2015年9月5日

摘要: 安装php:sudo yum install php php-fpm php-mysql php-mbstring php-mcrypt php-sockets php-curl php-common php-xml php-soap启动php-fpm:sudo systemctl start ph... 阅读全文
posted @ 2015-09-05 17:19 黄尚 阅读(921) 评论(0) 推荐(0) 编辑

2015年8月31日

摘要: 启动虚拟机:/Applications/VMware\ Fusion.app/Contents/Library/vmrun -T fusion start "CentOS 64-bit.vmwarevm" nogui停止虚拟机:/Applications/VMware\ Fusion.app/Con... 阅读全文
posted @ 2015-08-31 20:04 黄尚 阅读(379) 评论(0) 推荐(0) 编辑

2015年8月26日

摘要: 因为想安装最新版本,所以通过编译安装。安装前准备工具和库文件:sudo yum install gcc gcc-c++ openssl-devel readline-devel gdbm-devel patch下载文件:curl -O https://cache.ruby-lang.org/pub/... 阅读全文
posted @ 2015-08-26 22:09 黄尚 阅读(549) 评论(0) 推荐(0) 编辑

摘要: 安装Mariadb数据库:sudo yum install mariadb-server启动数据库:sudo systemctl start mariadb设置自动启动:sudo systemctl enable mariadb安全配置:mysql_secure_installation登陆测试:m... 阅读全文
posted @ 2015-08-26 21:33 黄尚 阅读(272) 评论(0) 推荐(0) 编辑

2015年8月24日

摘要: 安装postgresql:sudo yum install postgresql-server初始化数据库:sudo postgresql-setup initdb启动数据库:sudo systemctl start postgresql设置为自动启动:sudo systemctl enable p... 阅读全文
posted @ 2015-08-24 15:24 黄尚 阅读(326) 评论(0) 推荐(0) 编辑

2015年6月23日

摘要: 下载源代码:curl -O http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.2.tar.gz解压:tar xf ruby-2.2.2.tar.gz编译:cd ruby-2.2.2./configure --prefix=/opt/local/ --p... 阅读全文
posted @ 2015-06-23 22:48 黄尚 阅读(300) 评论(0) 推荐(0) 编辑

2015年5月1日

摘要: 生成密钥:openssl genrsa -out privkey.pem 2048 生成csr申请文件:openssl req -sha256 -new -key privkey.pem -out pubkey.pem 生成自签名证书:openssl x509 -req -days 365 -in 阅读全文
posted @ 2015-05-01 17:39 黄尚 阅读(2442) 评论(0) 推荐(0) 编辑

2014年10月22日

摘要: http redirect to https: if ($http_cf_visitor ~ '"scheme":"http"'){ rewrite ^/(.*)$ https://$http_host$1 last; } proxy_... 阅读全文
posted @ 2014-10-22 15:20 黄尚 阅读(402) 评论(0) 推荐(0) 编辑

2014年10月9日

摘要: vi /usr/lib/systemd/system/pano.service[Unit]Description=pano - main site of site_name.comDocumentation=http://www.site_name.com/docs/[Service]ExecSta... 阅读全文
posted @ 2014-10-09 16:38 黄尚 阅读(1493) 评论(0) 推荐(0) 编辑

2014年9月29日

摘要: 把本地端口 local_port 转发到服务器 server2 的 remote_port 端口上, server1 和 server2可以是同一ip或者不同ip.ssh user@server1 -L local_port:server2:remote_port -N 阅读全文
posted @ 2014-09-29 13:43 黄尚 阅读(552) 评论(0) 推荐(0) 编辑

2014年9月28日

摘要: #include #include #include int main(void){ DIR *dir; struct dirent *o; dir = opendir ("./"); if (dir != NULL) { while ((o = read... 阅读全文
posted @ 2014-09-28 21:55 黄尚 阅读(357) 评论(0) 推荐(0) 编辑

摘要: #include #include #include #include using namespace std;int main(int argc, char *const *argv){ try { leveldb::DB* db; leveldb::Opt... 阅读全文
posted @ 2014-09-28 15:37 黄尚 阅读(1018) 评论(0) 推荐(0) 编辑

2014年8月17日

摘要: 开80端口:sudo firewall-cmd --zone=public --add-port=80/tcp --permanent重新加载防火墙:sudo firewall-cmd --reload安装nginx:sudo rpm -Uvh http://nginx.org/packages/c... 阅读全文
posted @ 2014-08-17 17:27 黄尚 阅读(2299) 评论(0) 推荐(0) 编辑

2014年6月27日

摘要: 引用自: http://ejohn.org/blog/javascript-micro-templating/// Simple JavaScript Templating// John Resig - http://ejohn.org/ - MIT Licensed(function(){ va... 阅读全文
posted @ 2014-06-27 17:34 黄尚 阅读(375) 评论(0) 推荐(0) 编辑

2014年2月11日

摘要: MD5:#include #include #include #include #pragma comment(lib,"libeay32.lib")#define BLKSIZE 4096#define OUTSIZE 16int main(int argc, char *argv[]){ int bytes; int i; unsigned char output[OUTSIZE]; MD5_CTX s; unsigned char data[BLKSIZE]; FILE *fn; if(argc #include #include #includ... 阅读全文
posted @ 2014-02-11 16:31 黄尚 阅读(3305) 评论(0) 推荐(0) 编辑

2013年11月30日

摘要: 1. 安装centos 6.4, 具体的步骤有很多的教程,根据菜单提示一步步装也没难点,不细说。2. 修改网卡的配置: vi /etc/sysconfig/network-scripts/ifcfg-eth0 主要内容如下(粗体是需要我们改或添加的内容):ONBOOT=yesNM_CONTROLLED=yesBOOTPROTO=staticIPADDR=1.1.1.2NETMASK=255.255.255.252 vi /etc/sysconfig/network 主要内容如下(粗体是需要我们改或添加的内容):NETWORKING=yesHOSTNAME=centosGATEWAY=... 阅读全文
posted @ 2013-11-30 23:31 黄尚 阅读(1067) 评论(0) 推荐(0) 编辑

2013年6月2日

摘要: 在MAC系统下进行PHP开发,最简单的方法是到http://www.apachefriends.org/en/xampp-macosx.html下载个文件,装上就可直接进行开发了,好处很明显,简单易用。 使用MacPorts配置PHP开发环境(PHP54+PHP FPM+NGINX+MYSQL55),首先需要安装port,访问:http://www.macports.org/install.php,直接下载源代码:https://distfiles.macports.org/MacPorts/MacPorts-2.1.3.tar.gz。 安装port: 1.tar xzvfMacPor... 阅读全文
posted @ 2013-06-02 15:18 黄尚 阅读(3904) 评论(0) 推荐(0) 编辑

2013年5月17日

摘要: y.tab.h/* A Bison parser, made by GNU Bison 2.3. *//* Skeleton interface for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under t... 阅读全文
posted @ 2013-05-17 18:20 黄尚 阅读(1352) 评论(0) 推荐(0) 编辑

2012年11月16日

摘要: nmake1MAKEFILE=Makefile.vc23CFLAGS=/nologo/W3/O1-I./-Icharset/-Iwindows/-Iunix/-Imacosx//D_WINDOWS/D_WIN32_WINDOWS=0x500/DWINVER=0x5004LFLAGS=/increme... 阅读全文
posted @ 2012-11-16 16:55 黄尚 阅读(1153) 评论(0) 推荐(0) 编辑

2012年3月19日

摘要: $ cd /usr/local/nginx/conf$ openssl genrsa -des3 -out server.key 1024$ openssl req -new -key server.key -out server.csr$ cp server.key server.key.org$ openssl rsa -in server.key.org -out server.key$ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt 阅读全文
posted @ 2012-03-19 22:37 黄尚 阅读(409) 评论(0) 推荐(0) 编辑

2012年3月5日

摘要: http://www.cjboco.com/projects.cfm/project/cj-object-scaler/ 图片放大与缩小的东东 阅读全文
posted @ 2012-03-05 15:03 黄尚 阅读(189) 评论(0) 推荐(0) 编辑

2011年7月27日

摘要: 模板:$for(varvinls){$if(v>10){$v}else{$v}}控制类:usingSystem.Collections.Generic;namespaceCvv.WestcoMarketing.WebApp.PageControllers{classIndex:BaseControl... 阅读全文
posted @ 2011-07-27 22:12 黄尚 阅读(331) 评论(0) 推荐(0) 编辑

2011年6月6日

摘要: 硬件版本为2.2.04(单usb);直接升级,升级过程中不可以断电,升级后管理员用户名密码变为:admin admin/Files/afxcn/EBG2100_V2.2.3.9_PATCH1_1.zip这款路由器用的是busybox系统,有兴趣的人也可以玩玩它,给加点服务,多爽。 阅读全文
posted @ 2011-06-06 19:06 黄尚 阅读(1339) 评论(2) 推荐(0) 编辑

2011年6月1日

摘要: 因项目需要,花了点时间做了个小程序来演示京东商城的图片价格识别,初步试用效果还不错。 先上个图:用了个最简单的算法:///<summary>///图片解码///</summary>///<paramname="srcBitmap">0-9和.的源图像</param>///<paramname="distBitmap">目标图像</param>///<returns></returns>publicstaticstringDecodeGrayBitmap(ILi 阅读全文
posted @ 2011-06-01 23:48 黄尚 阅读(842) 评论(4) 推荐(1) 编辑

2011年5月26日

摘要: 1、如何只抓取 tarball?如果只希望抓取 tarball 下来的话,仅需下 make fetch 即可。如果是要抓取单一的 port,以 editors/joe 为例的话,则:代码:cd /usr/ports/editors/joe/make fetch预设会将 joe 的 tarball 下载至 /usr/ports/distfiles/ 目录下。如果是希望抓取安装此 ports 所有须要的其他 ports 的 tarball,以systuils/portupgrade 为例的话,则:代码:cd /usr/ports/systuils/portupgrade/make fetch-re 阅读全文
posted @ 2011-05-26 13:34 黄尚 阅读(598) 评论(0) 推荐(0) 编辑

2011年4月1日

摘要: 安装mysql55, 依赖的包为:mysql-5.5.10.tar.gz 和 cmake-2.8.4.tar.gz, 会自动下载,如果手上有的话也可以自己放在/usr/ports/distfiles/目录下,省得它需要下载。cd /usr/ports/databases/mysql55-server/make install cleanee/etc/rc.conf, 在最后加入一行 mysql_enable="YES"/usr/local/bin/mysql_install_db --user=mysql/usr/local/etc/rc.d/mysql-server st 阅读全文
posted @ 2011-04-01 00:41 黄尚 阅读(438) 评论(0) 推荐(0) 编辑

2011年3月4日

摘要: 先上代码using System;using System.Collections.Generic;using System.Text;using System.Net;using System.IO;using System.Collections;using System.Text.RegularExpressions;namespace Cvv.Base.Net{ public class MClient { private const string _userAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; 阅读全文
posted @ 2011-03-04 22:48 黄尚 阅读(1259) 评论(3) 推荐(0) 编辑

2009年8月4日

摘要: Javascript是一种动态语言,它的语法相当的灵活自由,再加上DOM对象是相当的丰富,以至于它成为了WEB开发中比较麻烦的一块。为了便于查找,我记录下自己的一些零碎的记忆。学习Javascript和学习其它的语言没有太多的区别,都是要看得懂几个语句的用法,例如if、for、while等,但javascript有它的一些特点,需要懂得更多一些才能比较顺利地阅读一些所谓高手写的代码;例如:var ... 阅读全文
posted @ 2009-08-04 14:32 黄尚 阅读(2347) 评论(11) 推荐(6) 编辑

2009年2月8日

摘要: 上一篇幅文章《谈谈编程》由于写得比较乱,可能没能表达清楚自己想要的东西,今天我再在这里吹吹水,看看能不能把自己想要表达的东西表达清楚一些。  科班的软件人才培养一般是先教给大家充足的理论知识,再由各位人才根据自己所要解决的问题运用自己的理论知识去做出解决方案。我不是说这些的方式不好,但事实上很多的人在学习理论知识的时候根本不知道这东西在什么场景下应用,所以学习的时候不上心,理论知识学得不扎实,所以... 阅读全文
posted @ 2009-02-08 19:27 黄尚 阅读(2282) 评论(7) 推荐(0) 编辑

2009年2月4日

摘要: 今天无聊再到首页上吹吹水,相信来博客园转的人就算不是从事编程的也是与之相关的吧,所以如果聊得不对的地方请多多指正。编程的通俗说法就是写代码,现在的流行的语言很多,但大都离不开类似if这样的判断语名、类似for这样的循环语句、再有就是一些变量声明、赋值等的一些语句;所以说学习一门语言所需要花费的工夫并不是很多,就像C#这样的语言,我们只需要知道一些最基本的知识就可以开始干活了。首先我们要安装好.ne... 阅读全文
posted @ 2009-02-04 23:40 黄尚 阅读(2554) 评论(15) 推荐(0) 编辑