Skip to content

Instantly share code, notes, and snippets.

View litefeel's full-sized avatar
🎯
I may be slow to respond.

litefeel litefeel

🎯
I may be slow to respond.
View GitHub Profile
:: 设置静态ip 192.168.1.246 子网掩码255.255.255.0 网关 192.168.1.1
netsh interface ip set address 本地连接 static 192.168.1.246 255.255.255.0 192.168.1.1 1
:: 设置动态ip
netsh interface ip set address 本地连接 dhcp
@litefeel
litefeel / addcron.sh
Created May 18, 2015 17:16
shell 脚本 添加cron
#!/bin/bash
# put old cron to file
crontab -l > tmpcron.txt
s=`crontab -l | grep '/root/dropbox.py start'`
# echo "$s"x
if [[ -z "$s" ]]; then
echo "00 04 * * * /root/dropbox.py start" >> tmpcron.txt
@litefeel
litefeel / shortcut.vbs
Created May 18, 2015 16:05
设置快捷方式
Option Explicit
Dim wshShell, shortcut
Dim lnkpath, targetpath
' 生成的快捷方式文件路径, 必须是.lnk结尾
lnkpath = WScript.Arguments(0)
' 目标文件路径
targetpath = WScript.Arguments(1)
@litefeel
litefeel / appstore.mm
Last active August 29, 2015 14:21
app store 更新链接
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
// open app store link
NSString * url = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%@", APP_STORE_ID];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
}
// APP INFO URL: http://itunes.apple.com/lookup?id=APP_STORE_ID
@litefeel
litefeel / python.py
Last active October 22, 2015 07:35
python 脚本
#!/usr/bin/python
# coding=utf-8
import os.path
import sys
import shutil
"""
getpath.py [path]
命令行所在目录
@litefeel
litefeel / stringutil.php
Last active August 29, 2015 14:15
php string function
function start_with($main_str, $str) {
return substr_compare($main_str, $str, 0, strlen($str)) === 0;
}
function end_with($main_str, $str) {
return substr_compare($main_str, $str, -1, strlen($str)) === 0;
}
@litefeel
litefeel / modify-extension.md
Last active August 29, 2015 14:15
批量修改后缀名

change jpg to png

bat

ren *.jpg *png