set the following in order to get most of your textmate bundle work:
PATH -> paths with your git & mysql & ruby
DYLD_LIBRARY_PATH -> path of your mysql lib
ARCHFLAGS -> -arch x86_64
RUBYOPT -> rubygems
Regardless of what we discover, we must understand and truly believe that everyone did the best job he or she could, given what was known at the time, his or her skills and abilities, the resources available, and the situation at hand.
PATH -> paths with your git & mysql & ruby
DYLD_LIBRARY_PATH -> path of your mysql lib
ARCHFLAGS -> -arch x86_64
RUBYOPT -> rubygems
first select your timezone interactively by using 'tzselect', you may
need 'sudo'
after that, we wanna make the change permanently
sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
finally we change 'UTC=yes' into 'UTC=no' in the file located at
'/etc/default/rcS'
now you have it done! do a 'date' for sure
class AnyController < ApplicationController
def any_action
send_data [SOME-BINARY-DATA]
end
end
when browser make any request to this controller, Rails 3 app will
REMOVE your 'Content-Length' field of the HTTP response header, even
you add content-length in the logic code explicitly
To fix this, we could add a Rack middleware and plug it in to the app,
in your #{Rails.root}/config/application.rb file, find code like below:
module XX
class Application < Rails::Application
config.middleware.use "HttpHeaderFix" # add this line
then create a file named 'http_header_fix.rb' at #{Rails.root}/middleware
class HttpHeaderFix
def initialize(app)
@app = app
end
def call(env)
status, headers, response = @app.call(env)
if headers["Content-Type"] == "application/octet-stream"
if headers["Content-Length"].blank?
if response.respond_to? :length
length = response.length
elsif response.respond_to? :count
length = response.count
elsif response.respond_to? :size
length = response.size
elsif response.respond_to? :body
length = response.body.length
else
raise "unknown response: #{response.class}"
end
headers["Content-Length"] = length.to_s
end
end
[status, headers, response]
end
end
OK, there you go!!
Then you want just add your SSH account like this:
useradd -M -s /sbin/nologin -n usernamesome version of Linux may like this:
useradd -s /sbin/nologin usernameand even the 'nologin' shell is located at '/usr/sbin/nologin' in some
Now, you have a SSH server & account setup
Recommended web browser plugins for SSH proxy:
Firefox users checkout autoproxy:
https://addons.mozilla.org/en-US/firefox/addon/autoproxy/
Chrome users checkout Switchy!:
https://chrome.google.com/webstore/detail/caehdcpeofiiigpdhbabniblemipncjj
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)and then add this to your shell profile:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" CC=/usr/bin/gcc-4.2For ruby 1.9.3, we need libksba installed, using Homebrew, just run
'brew install libksba'installing Homebrew is quite easy too:
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"now try install ruby 1.9.3:
rvm install 1.9.3 --reconfigure --debug -C --enable-pthread --with-gcc=clangNOTE: in case of any compilation issues
Re-open your terminal (reset your session) and you'll be good to go. Up and running with Git in no time!
git svn clone [YOUR-SVN-REPOSITORY-URL]if you've got a git repository in hand, just try
git svn init [YOUR-SVN-REPOSITORY-URL]this may help you set the 'svn-remote' of your git repository
git svn fetch git svn rebase git svn dcommit
ssh-keygen -t rsa -P "" -C <your email address>
defaults write com.apple.NetworkBrowser BrowseAllInterfaces 1restart your Finder, or your mac, there you have it!
ActionController::Base.session = {
:key => 'YOUR_KEY',
:secret => 'YOUR_SECRET',
:expire_after => 180.minutes,
:domain => '.DOMAIN_NAME.com'
}
busybox mke2fs /dev/block/vold/179:2This will output some data. Once done on the second partition we now have an ext2 file system.
mount -o rw,remount -t yaffs2 /dev/block/mtdblock1 /system mkdir /system/sdThen we need to mount the ext2 partition and we can do this via this command:
mount -t ext2 /dev/block/vold/179:2 /system/sdWe need to now copy the data from the data directory to the ext2 partition, as we want to preserve
cd /data/ tar -cvf /system/sd/app.tar app tar -cvf /system/sd/data.tar data tar -cvf /system/sd/dalvik-cache.tar dalvik-cache cd /system/sd tar -xvf app.tar tar -xvf data.tar tar -xvf dalvik-cache.tar rm *.tar
#!/system/bin/sh # /system/etc/init-sd.sh& The next is called init-sd.sh and contains the following: #!/system/bin/sh # MYLOG=/data/install-recovery.log echo "$(date) Starting install-recovery.sh" > $MYLOG echo "$(date) Waiting SD to become ready..." >> $MYLOG sleep 10 mount -t ext2 /dev/block/vold/179:2 /system/sd 1>>$MYLOG 2>>$MYLOG mount -o bind /system/sd/app /data/app 1>>$MYLOG 2>>$MYLOG mount -o bind /system/sd/data /data/data 1>>$MYLOG 2>>$MYLOG mount -o bind /system/sd/dalvik-cache /data/dalvik-cache 1>>$MYLOG 2>>$MYLOG mount >> $MYLOG echo "$(date) Finishing install-recovery.sh" >> $MYLOGnow you need to use a decent text editor (I like vi) on windows I reccomend notepad++
chmod 755 /system/etc/install-recovery.sh chmod 755 /system/etc/init-sd.shFinally, we need to remove everything in the existing /data/app /data/data/ and /data/dalvik-cache
cd /data/app busybox rm -rf * cd /data/data/ busybox rm -rf * cd /data/dalvik-cache busybox rm -rf *now you will notice some odd things happening on the screen of your tablet but that will be fixed
rebootand if all went well you now have all your applications on the sdcard.
Ubuntu 10.04 server IPSEC supported by openswan: Linux Openswan U2.6.23/K2.6.32-317-ec2 (net key) L2TP supported by xl2tpd v1.3.0after the connection get failed, I found there's something like this
......
Sep 22 16:07:36 ip-xx pluto[14024]: "L2TP-PSK-NAT"[16] 114.xx.193.xx
#57: transition from state STATE_QUICK_R0 to state STATE_QUICK_R1
Sep 22 16:07:36 ip-xx pluto[14024]: "L2TP-PSK-NAT"[16] 114.xx.193.xx
#57: STATE_QUICK_R1: sent QR1, inbound IPsec SA installed, expecting
QI2
Sep 22 16:07:36 ip-xx pluto[14024]: "L2TP-PSK-NAT"[16] 114.xx.193.xx
#57: transition from state STATE_QUICK_R1 to state STATE_QUICK_R2
Sep 22 16:07:36 ip-xx pluto[14024]: "L2TP-PSK-NAT"[16] 114.xx.193.xx
#57: STATE_QUICK_R2: IPsec SA established transport mode
{ESP=>0x0687f589 <0x85b637f3 ......="......" dpd="none}" natd="114.xx.193.xx:4500" natoa="none" pre="pre" xfrm="AES_256-HMAC_SHA1">
it seems like the client made the ipsec connection successfully, so I
tried to restart the xl2tpd server with the "-D" parameter, then I got
the error like this:
.....
xl2tpd[17006]: Listening on IP address 0.0.0.0, port 1701
xl2tpd[17006]: control_finish: Peer requested tunnel 16 twice,
ignoring second one.
xl2tpd[17006]: control_finish: Peer requested tunnel 16 twice,
ignoring second one.
xl2tpd[17006]: Maximum retries exceeded for tunnel 28197. Closing.
xl2tpd[17006]: Connection 16 closed to 114.xx.193.xx, port 53911 (Timeout)
xl2tpd[17006]: control_finish: Peer requested tunnel 16 twice,
ignoring second one.
xl2tpd[17006]: Unable to deliver closing message for tunnel 28197.
Destroying anyway.
xl2tpd[17006]: control_finish: Peer requested tunnel 16 twice,
ignoring second one.
xl2tpd[17006]: Maximum retries exceeded for tunnel 4768. Closing.
xl2tpd[17006]: Connection 16 closed to 114.xx.193.xx, port 53911 (Timeout)
xl2tpd[17006]: Unable to deliver closing message for tunnel 4768.
Destroying anyway.
.....
I tried google the error message then got this article:
http://serverfault.com/questions/178309/ipsec-l2tp-vpn-with-osx-client-xl2tpd-reports-maximum-retries-exceeded
saying that just need to add the following lines to the conn
L2TP-PSK-noNAT section of ipsec.conf:leftnexthop=%defaultroute
rightnexthop=%defaultroute
now my vpn works great!0x85b637f3>
when I was doing all this, I forgot to export the DYLD_LIBRARY_PATH,
and either for the fourth step, I got the following error when running
'rake db:create':
Couldn't create database for {"reconnect"=>false, "encoding"=>"utf8",
"username"=>"root", "adapter"=>"mysql", "database"=>"xxx",
"host"=>"127.0.0.1", "pool"=>5, "password"=>"xxx",
"socket"=>"/tmp/mysql.sock"}, charset: utf8, collation:
utf8_unicode_ci (if you set the charset manually, make sure you have a
matching collation)
hope this may help you :)
1, sudo gem install rubygems-update -v THE_VERSION_YOU_WANT
this will download and install a specified version of ruby gems
2, sudo update_rubygems
this will execute the ruby gems update script to actually update
your ruby-gems
lsof will give you a list of the running processes maps to their ports
which are using
kill is for killing a process, with paramater "-9 [PROCESS_NAME]"
ps will handle the process listing job, often be used with "aux" parameters