Skip to content

Instantly share code, notes, and snippets.

@cnsoft
cnsoft / VpsMate_intall.py
Created May 31, 2013 08:10
VPSMate - A Host Panel Written by python
#!/usr/bin/env python
#-*- coding: utf-8 -*-
#
# Copyright (c) 2012, VPSMate development team
# All rights reserved.
#
# VPSMate is distributed under the terms of the (new) BSD License.
# The full license can be found in 'LICENSE.txt'.
""" Install script for VPSMate """
@cnsoft
cnsoft / yum_163.sh
Created June 5, 2013 03:08
yum update with 163 mirror site.
#!/bin/sh
#****************************************************************#
# ScriptName: yum_update.sh
# Author: baoqing.guobq
# Create Date: 2011-07-21
# Modify Author:
# Modify Date: 2011-07-21
# Function:
#***************************************************************#
mv /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/rhel-debuginfo.repo.bak
@cnsoft
cnsoft / monitor_process.py
Created June 7, 2013 03:52
Check whether a process is running or not.
import os
import subprocess
import re
def findThisProcess( process_name ):
ps = subprocess.Popen("ps -eaf | grep "+process_name, shell=True, stdout=subprocess.PIPE)
output = ps.stdout.read()
ps.stdout.close()
ps.wait()
@cnsoft
cnsoft / gist:5754608
Last active December 18, 2015 08:29
Facebook Concept.
http://www.simplewebtoolbox.com/whats-the-difference-between-facebook-account-and-pages/
Personal Profile: When you create a Facebook personal account, this is your individual account. You put your photo, your life history, all the things that are about you. It is against the Facebook terms of service to create a personal account with a business name. If you have done this, change the name on your account to a name. If they catch you with a business name instead of a personal name, they will shut the account down.
Friend Requests: With a Facebook Account, you can connect to people by becoming friends. They send a friend request, you accept, or vice versa.
Privacy Settings: With a Facebook account you can set privacy settings so only your friends on Facebook can see your information. You can also set it so some or all of your information is seen by non-friends. It’s your choice. The one thing that you cannot set to private is your profile photo. Also, the fact that you have a Facebook account will be availabl
@cnsoft
cnsoft / gist:5874734
Last active January 26, 2022 08:14
fix vpn 619 issue
1. after install pptpd service comment logtmp.
2. make client access internet. add the bellow rule.
e.g:
sudo iptables -t nat -A POSTROUTING -s 172.16.36.2/24 -o venet0 -j SNAT --to-source 198.55.1.242
@cnsoft
cnsoft / gist:5874985
Last active December 19, 2015 01:19
解决 duplicate symboal appdelegate.o 的问题.
http://stackoverflow.com/questions/2910205/how-to-handle-duplicate-symbol-error-from-3rd-party-libraries
这个办法是解开.a文件删除 .o $OBJ—CLASS
down vote
I'm going to assume that these are two third party libraries that have only provided you with the .a files and not the source code. You can use libtool, lipo and ar on the terminal to extract and recombine the files.
To see what architectures are in the file:
@cnsoft
cnsoft / gist:5875392
Created June 27, 2013 10:11
SampleCode. Integrated Baidu Share!
<!-- Baidu Button BEGIN -->
<div id="bdshare" class="bdshare_t bds_tools get-codes-bdshare">
<span class="bds_more">分享到:</span>
<a class="bds_qzone"></a>
<a class="bds_tsina"></a>
<a class="bds_tqq"></a>
<a class="bds_renren"></a>
<a class="bds_t163"></a>
<a class="shareCount"></a>
</div>
@cnsoft
cnsoft / gist:5881812
Last active December 19, 2015 02:18
Last step of admob integrated with delphi xe4.
setense:
Undefined symbols for architecture armv7s:
"_OBJC_CLASS_$_ASIdentifierManager", referenced from:
Undefined symbols for architecture armv7
http://www.cocoachina.com/bbs/simple/?t117929.html
xiasix 2012-11-20 12:31
If you're using the Admob v6.2 library make sure you're NOT using the -all_load linker flag, use the -ObjC linker flag instead. 这个原因 找到了
@cnsoft
cnsoft / gist:5911269
Created July 2, 2013 17:26
UIWebView NSURLConnection NSURLResponse 用法.
//
http://ioscreator.com/loading-a-website-with-uiwebview/
Now modify the ViewDidLoad method in ViewController.m
- (void)viewDidLoad
{
[super viewDidLoad];
//1
unit BeRoDDS;
(*************************************
** 2-clause simplified BSD license ***
**************************************
**
** Copyright 2010-2011 Benjamin Rosseaux. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification, are
** permitted provided that the following conditions are met:
**