这是我在shlug组上的一个提问,看看大家伙的热情
大家好, 本人使用github.io做文字记录,在插入图片时有一些烦恼: 由于担心图片太多,会撑爆github的个人空间,所以使用外链的形式插在文章中, 用过七牛的空间、微博相册。现在有一个想法,就是感觉手动插入图片取得图片URL 这一步是太浪费时间,我就在想,可不可以写一个自动上传图片到七牛或者微博相册 而且立即返回图片URL的自动脚本,感觉能胜任的是 python,由于没有接触过python, 不知道这样的思路对不对,或者有其他可以参考的例子吗? 谢谢!
其中,一个哥们 Zhang Cheng([email protected])的回复实在给力。
在 python-cn 里面搜“七牛 图床”,有若干thread。
其中一个直达链接:https://groups.google.com/forum/#!searchin/python-cn/%E4%B8%83%E7%89%9B$20%E5%9B%BE%E5%BA%8A%7Csort:relevance/python-cn/kWWqC795pV0/IpbspJv5CwAJ
该thread中提到的工具:
后两个我没找到源码(其实是没找)。
我现在看着第一个和最后一个,都是比较好的项目。
这是我的测试;
这张图片就是上面链接的第一个的工具,自己用的时候在配置文件中需要注意一下。
前言。
最近老是在编译新的内核,但是总 boot不起来,问了很多人,还是老样子。尤其是国内的专家,我真不知道是不是应该称他为大神,但是她说了一通,建议我转向其他的发行版。
幸好没有听从他的建议。
debian已经做的非常好了。
update: 2022/02/20 添加windos clients update: 2022/06/18 添加更多说明
我是在oftc的server里注册的,具体指令如下 :
/NickServ REGISTER passwd your-email
然后你会收到:
Nickname vimer has been registered successfully and is now yours to use.
-NickServ- See HELP SET for information on settings that you can set on your new
-NickServ- nickname. If you change nickname or reconnect to the IRC network you will be
-NickServ- required to identify using the password you chose when you registered. See
-NickServ- HELP IDENTIFY for more information on identifying your nickname.
-NickServ-
-NickServ- To complete the registration, the nickname must be VERIFIED. Note that we
-NickServ- do not validate the e-mail address.
-NickServ- To verify your nick, please visit the following link in your browser:
-NickServ-
-NickServ- url
-NickServ-
-NickServ- This link expires in 1 hour. If the link expires, see REVERIFY.
然后根据url去验证即可。
/msg NickServ identify curpasswd
/msg NickServ INFO vimer
前提是先注册
/msg NickServ SET CLOAK ON
最近由于项目需要需要在IRC上及时沟通,但是目前的办公环境是在windows上,所以,需要在window上找一款IRC tool。 我一开始使用的是xchat-2,很小灵巧,非常喜欢,但是不知道因为什么原因,导致闪退。 花了点钱,买了人生中第一份license。继续使用 xchat。
linux推荐使用 irssi
.
/NETWORK LIST
/HELP NETWORK
/HELP SERVER
/HELP CHANNEL
/HELP
选择一个并且加入进去. 更多的用法需要参考
/CONNECT Freenode or oftc
/JOIN #irssi
#debian-bugs
#debian-buildd: Teams/DebianBuildd
#debian-mentors: Support for new contributors with questions on packaging and Debian infrastructure projects/services. See also the debian-mentors mailing list.
#debian-ports: https://www.ports.debian.org/
#debian-riscv: Debian RISC-V port
#devscripts: devscripts
一般的开源组织使用的oftc比较多一些, 尤其是debian一类的比较多。 比如,加入linux kernelnewbies channel
/server irc.oftc.net
/JOIN #debian
/join #kernelnewbies
### hits:
/arch/x86/include/asm/pgtable-3level.h:128:20: error: redefinition of ‘native_pud_clear’ ./arch/x86/include/asm/pgtable-3level.h:124:20: note: previous definition of ‘native_pud_clear’ was here
这里:
http://lkml.iu.edu/hypermail/linux/kernel/1602.0/03087.html
on x86_64:
when CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD is enabled and CONFIG_TRANSPARENT_HUGEPAGE is not enabled:
../fs/proc/task_mmu.c: In function ‘smaps_pud_range’: ../fs/proc/task_mmu.c:596:2: error: implicit declaration of function ‘is_huge_zero_pud’ [-Werror=implicit-function-declaration] if (is_huge_zero_pud(*pud))
自己在本机的 ~/maintree/linux目录下,已经git remote add linux-next树,只需获得linux-next最新的tags。在创建kernel代码数据库后,使用命令smatch_scripts/test_kernel.sh 就可以产生一个内核的warn.txt文件,这里就是他的分析工具。
这一个工具就目前而言,比smatch要好用一些,下面简要的基于一下规则;
static ssize_t bus_kobj_attr_store(struct kobject *kobj, struct attribute *attr,
const char *buf, size_t count)
{
ssize_t ret;
struct medialb_bus *bus =
container_of(kobj, struct medialb_bus, kobj_group);
struct bus_attr *xattr = container_of(attr, struct bus_attr, attr);
if (!xattr->store)
return -EIO;
ret = xattr->store(bus, buf, count);
return ret;
}
在这行代码中,最后两行可以合并为一个语句;
static ssize_t bus_kobj_attr_store(struct kobject *kobj, struct attribute *attr,
const char *buf, size_t count)
{
ssize_t ret;
struct medialb_bus *bus =
container_of(kobj, struct medialb_bus, kobj_group);
struct bus_attr *xattr = container_of(attr, struct bus_attr, attr);
if (!xattr->store)
return -EIO;
return xattr->store(bus, buf, count);
}
那么,怎么发现这个问题呢,你需要自己先写一个coccinelle的系统文件,
@@
local idexpression ret;
expression e;
@@
-ret =
+return
e;
-return ret;
保存为 ret.cocci
下载staging-testing
在对行的目录下运行这个脚本
最后一步就是
spatch --sp-file ret.cocci --no-includes --dir /home/yubo/maintree/staging/drivers/staging > ret.out
当然,前提是要安装coccinelle这个软件,可以通过发行版的包安装命令。也就是说,当执行完上面的命令,所有的毛病就会输出到ret.out这个文件。
perfect!!!
说的简单些,这个工具的最难之处就是.cocci的编写,当你有自己的想法并实现时,别忘了给coccinelle提交你的系统文件。
uanme -a
简单粗暴明了
下面这些命令,没有的话,需要自己重新安装,不大,占不了多少内存。
lspci
lsusb
lshw
lscpu
lshw
/proc
简单介绍工具lshw:
sudo lshw -html > lshw.html
这样就生成了.html,用浏览器打开就行了。