Skip to content

Instantly share code, notes, and snippets.

@auycro
Last active June 29, 2016 03:17
Show Gist options
  • Save auycro/72560cc7dda4f8dcd550 to your computer and use it in GitHub Desktop.
Save auycro/72560cc7dda4f8dcd550 to your computer and use it in GitHub Desktop.
log about ZOREHSSEHC
======IOS======
Disable Automatic Reference Counting for Some Files
http://stackoverflow.com/questions/6448874/disable-automatic-reference-counting-for-some-files
-fno-objc-arc
StoreKit delegate manage incorrectly
https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/issues/537
http://stackoverflow.com/questions/24675528/ios-crash-report-skproductsrequest
http://stackoverflow.com/questions/3324596/storekit-skproductsrequest-crash
http://stackoverflow.com/questions/4782214/iphone-skproductsrequest-and-message-sent-to-deallocated-instance
http://stackoverflow.com/questions/4150926/in-app-purchase-crashes-on-skpaymentqueue-defaultqueue-addpaymentpayment
http://stackoverflow.com/questions/25702764/strange-crash-on-in-app-purchase-on-ios
Unity 5.3 build ios size increase:
http://forum.unity3d.com/threads/unity-5-3-x-build-size-increase-faq.383533/
//unable to sign when validate
Delete unsigned bundle (WebView)
//Ipad Pro Icon need to add manually
167x167pixel
QuickAction Icon Available by IOS version
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplicationShortcutIcon_Class/index.html#//apple_ref/c/tdef/UIApplicationShortcutIconType
UNITY5 build error
------------Error on Building
WebPlugin Error
:Fixed by Objective-C Automatic Reference Counting to No
StorePlugins NSString cannot defined:
FelloPushBridge.mm NSString cannot defined:
:Fixed by changed options:nil to options:0
UniWebView.mm iPhone_common.h not found
: Comment out //#import "iPhone_Common.h"
UniWebView.mm textAlignment = assign incompatble
: textAlignMent = NSTextAlignmentCenter
UniWebView.mm ....willRotate not found
: [[NSNotificationCenter defaultCenter] ... name:@"default" ....]
TwitterPlugin.o Problem
:Fixed by add Accounts.framework
GoogleAnalyticProblem about sqlite
:Fix by add libsqlite3.0tbd
Error on Unity5.3.1f1
Add Lib
CoreData.framework
EventKit.framework
MessageUI.framework
Social.framework
Telephony.framework
StoreKit.framework
--------Error on Running
DisplayManager.mm
at line276: Fixed add retain to _displayConnection = [[NSMapTable ....] retain];
http://answers.unity3d.com/questions/917164/unity-5-iphone-builds-bad-access.html
WWWConnection.mm
:Fixed by add -fobjc-arc in build phase
http://forum.unity3d.com/threads/ios-unityreportwwwreceiveddata-crash.339058/
========ANDROID========
Get Google Account
http://stackoverflow.com/questions/2245545/accessing-google-account-id-username-via-android
Google Developer API
-subscription
https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/get
AndroidPluginBuild
1. INSTALL and SetUp AndroidSDK+JAVA+ANT
2. android create project (http://developer.android.com/intl/ja/tools/projects/projects-cmdline.html)
3. ant jar (with below detail in build.xml)
<!-- build jar file-->
<target name="jar" depends="debug">
<jar
destfile="bin/UniWebView.jar"
basedir="bin/classes" />
</target>
=======FACEBOOK(UNITY-WEBGL)=======
Facebook OpenGraph Details
http://ogp.me/
Implement new payer promotion
https://developers.facebook.com/docs/payments/npp
Subscription
https://developers.facebook.com/docs/payments/subscriptions/tutorial
check subscription
GET GRAPH-API//{subscription-id}?fields=amount,application,status&accesstoken={APP_ACCESSTOKEN}
cancel subscription
POST GRAPH-API//{subscription-id}?status=canceled&accesstoken={APP_ACCESSTOKEN}
OpenGraphProduct
https://developers.facebook.com/docs/reference/opengraph/object-type/product/
Facebook Object Debugger
https://developers.facebook.com/tools/debug/og/object/
Unity Facebook App Request
https://developers.facebook.com/docs/unity/reference/current/FB.AppRequest
Facebook Game Request
https://developers.facebook.com/docs/games/services/gamerequests
Unity Facebook FeedShare
https://developers.facebook.com/docs/unity/reference/current/FB.FeedShare
Show app-request
http://stackoverflow.com/questions/29172592/facebook-app-request-notification-not-showing-up-in-facebook-ios-app-for-mobile
Search Subscription
https://graph.facebook.com/USER_ID/payment.subscriptions?accesstoken={{apptoken}}
=======SERVERSIDE=======
Check sslcertificate config
grep -i -r "SSLCertificateFile" /etc/httpd/
Ref:
https://www.digicert.com/ssl-certificate-installation-apache.htm
https://httpd.apache.org/docs/current/mod/mod_ssl.html
Create CSR for request ssl
Create Key{leave [-des3] blank for nopass}
$ openssl genrsa [-des3] -out ssl/key/exampledomainname.key 2048
Create CSR from key
$ openssl req -new -key ssl/key/exampledomainname.key -out ssl/csr/exampledomainname.csr
Check key
$ openssl req -noout -text -in ssl/csr/exampledomainname.csr
Check process and memory use
$ watch -n 5 free -m
$ top
$ ps aux | less
Check config
apachectl configtest
Test post method(send post request with json to server)
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d ' {"user":{"first_name":"firstname","last_name":"lastname","email":"[email protected]","password":"app123","password_confirmation":"app123"}}' http://localhost:3000/api/1/users
linux shell script
http://stackoverflow.com/questions/5163144/what-are-the-special-dollar-sign-shell-variables
vagrant commnad
https://docs.vagrantup.com/v2/cli/
rails simple command
http://guides.rubyonrails.org/command_line.html
rails generate model tutorial
http://railsguides.net/advanced-rails-model-generators/
http://edgeguides.rubyonrails.org/active_record_migrations.html
http://maeharin.hatenablog.com/entry/20130212/rails_generate
rails generate chat table
rails generate model chat_chats message:string
rake db:migrate
rails rollback migrate
rake db:migrate:down VERSION=20100905201547
rake db:rollback
rails check migration
rake db:version
rake db:migrate:status
add new command(chat) to server
server <-this one is router for command
game_manager <-command summary
game_player <-player
Simple Update Command
open ssh-agent
eval `ssh-agent`
add ssh key:
~$ ssh-add ~/.ssh/******.pem
<add passphrase>
check ssh key:
~$ ssh-add -l
establish connection
~$ ssh -vT [email protected]
Vargrant ssh connection
set vargrant ssh-config
vagrant ssh-config >> ~/.ssh/config
then, Login to vargrant and (-A = forward authen)
ssh default -A
ref:
http://dqn.sakusakutto.jp/2013/08/windows_vagrant_ssh.html
https://help.github.com/articles/generating-ssh-keys/
Ruby deploy
$ BRANCH={{git_branch_name}} bundle exec cap {APP_NAME} deploy
Ruby Console
rails c
ref:
http://bundler.io/v1.1/bundle_exec.html
https://github.com/capistrano/capistrano
Solve Rails Permission Denied ****{filename}***
1. Go to File
2. check permission: ls -alh
3. change permission: sudo chown {user}:{domain} {filename}
WebSocket Cannot use ASCII
*Need to force to UTF-8
def process line
line = line.force_encoding('UTF-8')
@ws.send line
end
ref: https://github.com/igrigorik/em-websocket/issues/8
Check Log
grep -o 'name="[^"]*"' file.html > results.txt
grep "2014-01-01 21:" log.txt; tail -f log.txt
Rails Console:
Call app.get
(http://stackoverflow.com/questions/151030/how-do-i-call-controller-view-methods-from-the-console-in-rails)
(http://stackoverflow.com/questions/8474689/provide-params-hash-for-put-post-requests-in-rails-console)
app.get '/posts/1'
app.post('/foo', {"this" => "that", "items" => ["bar", "baz"]})
make your file executable by running:
http://stackoverflow.com/questions/8721369/how-to-execute-a-ruby-script-in-terminal
chmod +x your_program.rb
=======DATABASE=======
average time
select games.game_mode_id,sec_to_time(AVG(timediff(games.end_time,games.start_time)))as 'average_game_time' from games group by games.game_mode_id;
=======ETC=======
set gitbash color
http://linux-sxs.org/housekeeping/lscolors.html
check ubuntu file size
ls -lah
tar gzip file
{sudo} tar cvzf {ZipFileName} {TargetFileList}
untar gzip
tar -xvf thumbnails-14-09-12.tar.gz
list file by modified date
ls -ltr
check file in tar
tar -tf
system disk size
df -h
delete file by modification date
find /path/to/files* -maxdepth 1 -mtime +5 -exec rm {} \;
get command in ubuntu
ls ${PATH//:/ } > mycommands.txt
ECANOMMAGKCAB
=========================================================================================
Set Up Environment
1. Create package.box for vagrant $ vagrant package --output [name]
2. Copy to vagrant folder
3. Run Vagrant $ vagrant up
Deploy To Staging
1. Create Branch For Staging Up bg_staging
2. Merge Event Update to New Branch
3. Add key bg-develop
$ eval `ssh-agent`
$ ssh-add {key}
4. Login to vagrant via ssh $ vagrant ssh
5. Deploy
$ cd /strategy_game/common_db/
$ BRANCH={git branch} RAILS_ENV={production/staging} bundle exec cap bg_staging deploy
6. If rails have no BUNDLE, please run install bundle
$ bundle install
Update Event Data in DB
*Before Event Start
1. Change event category in db and updates
2. Change publication_start/end {event_date+1/-1/}
3. Change reward_start/end {event_end_datetime+1hr~event_end_datetime+1month+1hr}
*Event Start (Event Start Time is 8:00UCT = 17:00JST)
1. Regist frame data to DB
$ RAILS_ENV={staging/production} bundle exec rails runner bin/init_data/backgammon/create_event_icon_frame_data.rb -i
2. priority in icon_frames table will register as 1, means event frame in use
*Event End
1. Set priority in icon_frames table to 0
2. Insert data to event_event_rewards
*After Event End
1. Reward BAC point
$ cd /data/new_strategy_game/current/
$ RAILS_ENV={production/staging} bundle exec rails runner 'UpdateBacPoint.event_update({event_id}, true)'
2. SumUp Data by Run SQL
***Only Register Email Event
1. receiption_start_time/receiption_end_time will be used for setting register time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment