随笔分类 - Linux
摘要:#define BUFFER_SIZE 1024//合并文件mergeFile (infile1, infile2, filenmae)void mergeFile(FILE *fp1,FILE *fp2,char *name){ FILE *fd1,*fd2,*fp3; unsigned char buf[BUFFER_SIZE]; char filename[100]; strncpy(filename,name,sizeof(filename)); int rc1,rc2; fd1 = fopen(fp1,"rb"); fd2 = fopen(f...
阅读全文
摘要:珍藏...#define BUFFER_SIZE 1024//在尾部补零void appendZeros(FILE *fp, int size){ FILE *fd; unsigned int buffer[size]; strncpy(buffer,"",sizeof(buffer)); if ( ( fd=fopen(fp,"a+") ) == NULL ){ printf ( "在补零时,打开目标文件失败!\n" ); exit(1); } if ( size != 0 ){ fwrite(buffer, 1 ...
阅读全文
摘要:#!/bin/bash - #===============================================================================## FILE: ~/bin/apkdump# # USAGE: apkdump# # DESCRIPTION: # # OPTIONS: ---# REQUIREMENTS: ---# BUGS: ---# NOTES: ---# AUTHOR: linkscue (scue), linkscue@gmail...
阅读全文
摘要:1 #!/bin/bash - 2 #=============================================================================== 3 # 4 # FILE: conv.sh 5 # 6 # ...
阅读全文
摘要:GCC(1) GNU GCC(1)NAME gcc - GNU project C and C++ compilerSYNOPSIS gcc [-c|-S|-E] [-std=standard] [-g] [-pg] [-Olevel] [-Wwarn...] [-pedantic] ...
阅读全文
摘要:$ sudo apt-get install cscope$ cscope --help$ Usage: cscope [-bcCdehklLqRTuUvV] [-f file] [-F file] [-i file] [-I dir] [-s dir] [-p number] [-P path] [-[0-8] pattern] [source files]-b Build the cross-reference only.-C Ignore letter case when searching.-c ...
阅读全文
摘要:style "gtkcompact" {font_name="Ubuntu 9"GtkButton::default_border={0,0,0,0}GtkButton::default_outside_border={0,0,0,0}GtkButtonBox::child_min_width=0GtkButtonBox::child_min_heigth=0GtkButtonBox::child_internal_pad_x=0GtkButtonBox::child_internal_pad_y=0GtkMenu::vertical-padding=1
阅读全文
摘要:1. 简单一点,直接输入env LANGUAGE=zh_CN.UTF-8 grep --help2. 写成一个脚本文件,以后方便直接调用;#!/bin/bash#version:0.1#文件名称:~/bin/cnenv.sh#实现功能:英文环境下,临时以简体中文打开应用程序env LANGUAGE=...
阅读全文
摘要:由于自己比较懒,不想去一个个地去PS图片的大小,同时想利用别人已制作出来的资源文件;先做以下假定:1. 假定当前目录下有xhdpi的资源原始文件(用于获取它们的图片大小);2. 假定当前目录下有hdpi这个文件夹,保存着别人已做好的美化资源文件;现在把hdpi/目录下的美化文件批量转换到当前目录下,转换后大小由当前目录的原始文件来决定;for n in $(ls -1 *.png);do a=$(file $n | awk -F',' '{print $2}' | sed '{s/ //g}'); convert -resize $a hdpi/
阅读全文
摘要:convert input.png -alpha set -channel A -evaluate set 50% output.png
阅读全文
摘要:假定命令行:./test.sh filename.apk.bak (或者./test.sh filename_bak.apk,及或者./test.sh filename.bak.apk)方法一:apk=${1%%.*}.apk #得到apk=filename.apk方法二:apk=${1/apk*/apk} #得到apk=filename.apk相比方法一,假如你知道一个apk文件一定是以.apk为结尾的,推荐最好使用方法二;
阅读全文
摘要:mv ~/.config/google-chrome/PepperFlash ~/.config/google-chrome/PepperFlash.bakkillall google-chrome
阅读全文
摘要:#!/bin/bash#~/bin/apkuninstaller# if you have more than one devices, # use adbs="adb -s $devce_numberno" to specify itadbs=adb#1. get the app list form devicei=0;for list in `$adbs shell ls -1 /data/data/`do apklist[$i]=$list; ((i++));done#2. echo the app list to user selectfor (( i = 0; i
阅读全文
摘要:#!/bin/bash# for Ubuntu12.10 64bit## 1.change mount, /etc/fstabcat << EOF > $HOME/fstab_padding.txt# EXT4#Entry "Source" for /dev/sda6 :UUID="0988bb9d-02ad-4290-9f60-7954605a8115" /media/scue/Source ext4 defaults 0 0 # NTFS#Entry "Study" for /dev/sda5 :UUID=&qu
阅读全文
摘要:Kernel driver not installed (rc=-1908)The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing'/etc/init.d/vboxdrv setup'as root. If it is available in your distribution, you should i
阅读全文
摘要:1. 脚本内容:#!/bin/bash# Author: linkscue# Version: 0.2# Usage: ./mp3cutsh $input $output# To use before: sudo apt-get install poc-streamerif [[ $# != 2 ]]; then #statements echo 'mp3cutsh $input $output' exit 1fi# 相关的变量,截取文件名、输出路径input=${1%.*}output=${2%/}input_mp3=${input}.mp3input_lrc=${inpu.
阅读全文
摘要:#!/bin/bashif [[ $# != 3 ]]; then echo 'usage:prewget $FILE $LINK $TIME ' echo 'e.g. prewget google google.com 02:11' exit 1fi# variablefilename=$1downlink="\"$2\""downtime=$3tmpfile="$HOME/Public/prewget_$filename"# write the code to a scriptcat <<
阅读全文
摘要:虚拟机我喜欢开全屏来操作里边的内容,这样子看起来比较爽快一点。但全屏之后,就不能手动来挂载USB设备了,这一点有点不太好……好比,最近喜欢上了使用Lenovo K860手机,现在我要通过Linux下的命令来挂载它……0. 基础条件: -- 虚拟机名称是WinXP31. 查看手机设置的UUID相关信息scue@Link:~$ vboxmanage list usbhostUUID: 3bd984a4-3cf3-4a58-94fa-171cb0a1c3beVendorId: 0x17ef (17EF)ProductId: 0x753...
阅读全文
摘要:创建并编辑个文件:sudo vim /etc/udev/rules.d/51-android.rules,输入以下内容SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666" OWNER="scue"SUBSYSTEM=="usb", ATTRS{idVendor}=="0e79", MODE="0666" OWNER="scue"SUBSYSTEM=="usb",
阅读全文
摘要:[CodeTable]UniqueName=wubiName=WubiName[zh_CN]=五笔字型Name[zh_TW]=五筆字型IconName=wubiFile=wbx.mbAdjustOrder=AdjustNoPriority=10UsePY=TruePYKey=zAutoSend=-1NoneMatchAutoSend=0UseMatchingKey=TrueMatchingKey=zAutoPhrase=TrueAutoPhraseLength=4AutoPhrasePhrase=TrueSaveAutoPhrase=3ExactMatch=FalsePromptTableCo
阅读全文
浙公网安备 33010602011771号