start new:
tmux
start new with session name:
tmux new -s myname
| #include <stdlib.h> | |
| #include <stdio.h> | |
| int compare(const void *x, const void * y) { | |
| int ix = *(int*)x; | |
| int iy = *(int*)y; | |
| return ix - iy; | |
| } | |
| int main(void) { |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| int foo(int x) { return 1; } | |
| int main(void) { | |
| int *ptr[2]; | |
| int (*ptr2)[2]; | |
| int(*ptr3)(int); | |
| int x = 10; | |
| int arr[] = { 1, 2, 3, 4}; |
| var friends = {}; | |
| friends.bill = { | |
| firstName: "Bill", | |
| lastName: "Gates", | |
| number: "(206) 555-5555", | |
| address: ['One Microsoft Way','Redmond','WA','98052'] | |
| }; | |
| friends.steve = { | |
| firstName: "Steve", | |
| lastName: "Jobs", |
| import java.sql.*; | |
| public class Tran { | |
| public static void main(String[] args) throws Exception { | |
| Class.forName("com.mysql.jdbc.Driver"); | |
| String host = "jdbc:mysql://192.168.56.102/popidb"; | |
| String user = "popi"; | |
| String pw = "db1004"; | |
| Connection conn = DriverManager.getConnection(host, user, pw); | |
| conn.setAutoCommit(false); |
| import math | |
| def fact(x): | |
| if x == 1: | |
| return 1 | |
| else: | |
| return x * fact(x-1); | |
| def mysin(x): | |
| return x - math.pow(x,3)/fact(3) + pow(x,5)/fact(5) - pow(x,7)/fact(7) \ | |
| + math.pow(x,9)/fact(9) |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int main(void) { | |
| int *p = malloc(sizeof(int)); | |
| int *q = realloc(p, sizeof(int)); | |
| int *z = realloc(q, sizeof(int)); | |
| *p = 1; | |
| *q = 2; | |
| *z = 3; |
| # Read from the file file.txt and output the tenth line to stdout. | |
| for i in $(seq 1 10) | |
| do | |
| read line | |
| done < "file.txt" | |
| echo $line |
| sed -n '10p' file.txt |
| aws s3api list-objects --bucket %bucketname% --query 'sum(Contents[].Size)' --output json | awk 'BEGIN {total=0}{total+=$0}END{print total/1024/1024/1024" GB"}' |