Archive for April 2012

How to Get Your Facebook Application Access Token 27.04.12

  • Facebook
  • Comments Off on How to Get Your Facebook Application Access Token
  • 0
  • I recently needed to create some test Facebook users, but ran into a problem when I needed to get my application’s access token. So I ended up searching a bit and experimenting, and it’s simple. Turns out all you need is your application id and secret, which is right there on your application profile page (if your the developer for it). Then you just hit the oauth/authorize endpoint of the graph API, and you get back the access token:


    curl "https://graph.facebook.com/oauth/access_token
    ?grant_type=client_credentials
    &client_id=11111111
    &client_secret=9999999999"

    When You Need An Application Access Token
    You need to use a Facebook application access token when you have a process that acts on behalf of the application, rather than on behalf of a particular user. This happens when you access your Facebook Insights data for your app via the graph, and also when you want to create test Facebook users for your app.

    Restore Iptables Rules in Ubuntu 22.04.12

  • Ubuntu Server
  • Comments Off on Restore Iptables Rules in Ubuntu
  • 0

  • $ iptables-restore < /home/user/working.iptables.rules

    Save Iptables Rules in Ubuntu 22.04.12

  • Ubuntu Server
  • Comments Off on Save Iptables Rules in Ubuntu
  • 0

  • $ iptables-save > /home/user/working.iptables.rules

    throw e; // process.nextTick error, or ‘error’ event on first tick 21.04.12

  • Mac OS X
  • Comments Off on throw e; // process.nextTick error, or ‘error’ event on first tick
  • 0

  • node.js:201
    throw e; // process.nextTick error, or 'error' event on first tick

    Error: No such module
    at Object. (/usr/lib/node_modules/npm/lib/utils/config-defs.js:5:21)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:31)
    at Function._load (module.js:308:12)
    at Module.require (module.js:354:17)
    at require (module.js:370:17)
    at Object.
    (/usr/lib/node_modules/npm/lib/utils/ini.js:43:18)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)

    Solution :

    Remove the thing in /usr, so that your computer will see the one in /usr/local.

    sudo rm -rf /usr/{bin,lib/node_modules,share/man/*}/npm*
    hash -r

    Backup crontab 15.04.12

  • Ubuntu Server
  • Comments Off on Backup crontab
  • 0
  • How to copy or backup the crontab file?

    crontab -l > $(date +%Y%m%d).crontab