#Linux Cheat Sheet
##File Commands:
- ls – directory listing
- ls -al – formatted listing with hidden files
- cd dir - change directory to dir
- cd – change to home
- pwd – show current directory
- mkdir dir – create a directory dir
- rm file – delete file
// gcc -o try-catch-ex try-catch.c try-catch-ex.c | |
#include <stdio.h> | |
#include "try-catch.h" | |
// Example of use for try-catch.h | |
int main(int argc, char *argv[]) | |
{ | |
int i = 101; | |
printf("before try block...\n"); |
// compare relative performance of tolower_ctype, tolower_openbsd, tolower_oraz functions | |
// result: 30.80, 30.51, 38.09 | |
// $ gcc -std=c99 -O3 -g -Wall -pedantic test_tolower.c -o test_tolower; | |
// $ valgrind --tool=callgrind ./test_tolower 1000000 | |
#include <assert.h> | |
#include <ctype.h> | |
#include <inttypes.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> |
#Linux Cheat Sheet
##File Commands:
# Set up a new VPS for Framework (Ubuntu 12.04) | |
1. Add personal user | |
* Add user to 'admin/sudo' and 'www-data' groups | |
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install python-software-properties -y && sudo add-apt-repository ppa:keithw/mosh -y && sudo apt-get update && sudo apt-get install mosh -y && sudo tasksel && sudo apt-get install php5 php5-gd php5-mysql php5-curl php5-cli php5-cgi php5-dev -y && sudo a2enmod rewrite expires headers mime deflate filter && sudo service apache2 restart && sudo apt-get install phpmyadmin -y && sudo apt-get install vim -y && sudo apt-get install git-core git-gui git-doc -y && cd ~ && mkdir ~/.ssh | |
cd ~/.ssh && ssh-keygen -t rsa -C "ryan@digitalbrands.com" && git config --global user.name "Ryan Frankel" && git config --global user.email "ryan@digitalbrands.com" | |
sudo apt-add-repository ppa:chris-lea/node.js -y && sudo apt-get update && sudo apt-get install nodejs -y && sudo aptitude install npm -y && sudo npm install -g less && git clone https://gi |
People
![]() :bowtie: |
😄 :smile: |
😆 :laughing: |
---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |
/* | |
* A simple example of json string parsing with json-c. | |
* | |
* clang -Wall -g -I/usr/include/json-c/ -o json_parser json_parser.c -ljson-c | |
*/ | |
#include <json.h> | |
#include <stdio.h> | |
int main() { | |
struct json_object *jobj; |
#!/bin/bash | |
set -e | |
if [ ! -d "$STAGING_DIR" ]; then | |
echo "STAGING_DIR needs to be set to your cross toolchain path"; | |
exit 1 | |
fi | |
ARCH=${ARCH:-mipsel} | |
NODE=${NODE:-0.10.33} |
/** | |
* This are a collection of examples for C 201. | |
* These combine concepts you may or may not be | |
* familiar with and are especially useful for | |
* students new to C. There is a lot of really | |
* cool stuff you can do in C without any cool | |
* languages. | |
* | |
* This is file in particular is an introduction | |
* to fun function usage in C. |
You might want to read this to get an introduction to armel vs armhf.
If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.
First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static
so that you can run ARM executables directly on linux
If there's no qemu-arm-static
in the package list, install qemu-user-static
instead