วันศุกร์ที่ 25 เมษายน พ.ศ. 2557

Bypass ios 7

http://maypalo.com/2013/02/17/download-tinyumbrella-shsh-blobs-ios-6-1-1/
https://sites.google.com/site/msftguy/file/ssh_rd_rev04b.jar
PuTTy

Step 1: Back up your iPhone before attempting this guide and make sure to put it in airplane mode.
Step 2: Connect the iPhone to the computer and hit restore (if you have already done this and are on the “Welcome to iOS 7″ screen, you don’t need to do it again).
Step 3: Put your iPhone in to DFU mode.
  1. Hold the Power button for 3 seconds
  2. Hold the Home button without releasing the Power button for 10 seconds
  3. Release the Power Button but keep holding the Home button
Step 4: Download the Java utility and run it.
Step 5: Once it is completed you should see the following on your computer.
Java utility iPhone
Step 6: Download PuTTy and run it.
Step 7: Put in local host as hostname and port the java utility specified.
PuTTy iPhone
Step 8: A window will pop up asking you for username and password:
  1. Username: root.
  2. Password: alpine.
Step 9: Right after that run mount.sh in the terminal, then type in the following commands
cd mnt1/Applications.
rm -R Setup.app
If that does not work, type set and hit the tab button, it should auto complete.
Step 10: Now delete setup.app.
Step 11: Hold the power and home button to reset the phone.
Step 12: When the iPhone is turned on, it will show it in recovery mode. It is fine, don’t need to panick.
Step 13: Download TinyUmbrella and run it.
Step 14: Exit from the recovery mode using TinyUmbrella.
TinyUmbrella
Step 15: Your iPhone should boot up properly now.
If you have followed the steps correctly your iPhone should be hacktivated (activated) and up & running. The hacktivation method is not the proper way to activate an iPhone so you might find some problems later on while using it.

วันศุกร์ที่ 7 มีนาคม พ.ศ. 2557

XCode Set Font Size


XCode Set Font Size


[myView setFont:[UIFont systemFontOfSize:12]];

[myView setFont:[UIFont boldSystemFontOfSize:12]];

[myView setFont:[UIFont fontWithName:@"Helvetica" size:12]];

วันศุกร์ที่ 24 มกราคม พ.ศ. 2557

fix vsftp & iptables fix

setenforce 0

/etc/vsftpd/ftpusers
/etc/vsftpd/user_list

vi /etc/sysconfig/iptables-config

IPTABLES_MODULES="ip_conntrack_ftp"

ขั้นตอนการติดตั้ง FTP Server บน CentOS 6 ด้วยโปรแกรม vsftpd
1. ดาวน์โหลดโปรแกรม vsftpd
1
# yum install vsftpd

2. Start Service vsftpd 
1
# service vsftpd start

3. เปิดการใช้งาน vsftpd ใน Multi-user levels
1
# chkconfig vsftpd on
 ขั้นตอนการสร้าง Account FTP ให้กับแต่ละคน (FTP แบบ Authentication Required)
1. แก้ไขไฟล์ vsftpd.conf โดยพิมพ์คำสั่ง แก้ไขค่าตามคำอธิบายด้านล่าง และทำการบันทึก
1
# nano /etc/vsftpd/vsftpd.conf

1.1 ascii_upload_enable=YES ลบเครื่องหมาย # ออก
1.2 ascii_download_enable=YES ลบเครื่องหมาย # ออก
1.3 ftpd_banner=Welcome to blah FTP service. ลบเครื่องหมาย # ออก
1.4 use_localtime=YES เพิ่มไว้ที่บรรทัดสุดท้าย

2. สร้าง Account ใหม่ขึ้นมาสำหรับการทดสอบ
1
2
3
4
5
6
7
# useradd ftp1
# passwd ftp1
Changing password for user ostechnix.
New password:
BAD PASSWORD: it is based on a dictionary word
Retype new password:
passwd: all authentication tokens updated successfully.

3. Restart Service vsftpd
1
# service vsftpd restart

4. Update SELinux configuration เพื่อเปลี่ยน User ไปที่ $HOME directories
1
# setsebool -P ftp_home_dir on

วันอาทิตย์ที่ 19 มกราคม พ.ศ. 2557

Fix Mysql start & memcached


setenforce 0
killall memcached
service memcached start
service mysqld stop
mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak
service mysqld start

วันจันทร์ที่ 9 ธันวาคม พ.ศ. 2556

How can I fix a locale warning from perl?

# Setting for the new UTF-8 terminal support in Lion
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# Setting for the new UTF-8 terminal support in Lion
LC_CTYPE=en_US.UTF-8
LC_ALL=en_US.UTF-8

วันอาทิตย์ที่ 1 กันยายน พ.ศ. 2556

how to set cornerRadius for only top-left and top-right corner of a UIView

Here's a method - I'm sure it could be shortened.... :D
-(UIView *)roundCornersOnView:(UIView *)view onTopLeft:(BOOL)tl topRight:(BOOL)tr bottomLeft:(BOOL)bl bottomRight:(BOOL)br radius:(float)radius {

UIRectCorner corner; //holds the corner


//Determine which corner(s) should be changed
if (tl) {
    corner = UIRectCornerTopLeft;
}
if (tr) {
    corner = UIRectCornerTopRight;
}
if (bl) {
    corner = UIRectCornerBottomLeft;
}
if (br) {
    corner = UIRectCornerBottomRight;
}
if (tl && tr) { //top
    corner = UIRectCornerTopRight | UIRectCornerTopLeft;
}
if (bl && br) { //bottom
    corner = UIRectCornerBottomLeft | UIRectCornerBottomRight;
}
if (tl && bl) { //left
    corner = UIRectCornerTopLeft | UIRectCornerBottomLeft;
}
if (tr && br) { //right
    corner = UIRectCornerTopRight | UIRectCornerBottomRight;
}

if (tl & tr & bl & br) {
    corner = UIRectCornerAllCorners; 
}

UIView *roundedView = view;
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:roundedView.bounds byRoundingCorners:corner cornerRadii:CGSizeMake(radius, radius)];
CAShapeLayer *maskLayer = [CAShapeLayer layer];
maskLayer.frame = roundedView.bounds;
maskLayer.path = maskPath.CGPath;
roundedView.layer.mask = maskLayer;

return roundedView;
}
    UIButton *openInMaps = [UIButton new];
    [openInMaps setFrame:CGRectMake(15, 135, 114, 70)];
    openInMaps = (UIButton *)[self roundCornersOnView:openInMaps onTopLeft:NO topRight:NO bottomLeft:YES bottomRight:NO radius:5.0];