42 Notes
default
Some random notes I took while roaming around at 42 Silicon Valley.
Unorganized and in no particular order.
This repo has quite a bit of info on 42:
https://github.com/leeoocca/awesome-42
First off, all 42 project pdfs can be found online.
So if you are not able to go to the school, you could
still work through the projects yourself. You will not
have access to the 42 programs that check your work or
fail you, but many people have written programs like
42 Stupidity which have checks:
https://github.com/mirror12k/42us-stupidity
You could google something like:
42 all projects|subjects pdfs site:github.com
Also make sure to check gitlab as a lot of non US
students use it.
And you may find repos like these that have pdfs of
the projects from 42:
https://github.com/fpetras/42-subjects
https://github.com/Binary-Hackers/42_Subjects
If you are trying to get into the school then pay special
attention to those labeled piscine. As the Piscine is the
one month test, you have to pass to get into the program.
The day I found out about 42 Silicon Valley I applied.
The next Piscine was starting in a week and I signed up
for it. I had no idea what to expect and wanted to get
a head start. I did not have a clue what to search for
to find some previous 42 students code. So I started
watching every video I could find about 42. Finally in
one of their marketing videos, the cameraman was walking
through the lab and focused on one of the student's monitor.
They were working on a project, I don't recall which one,
but it had a unique string in the text. Let's just say it was:
ft_strlen.c
So now I knew more about 42 projects and searched for:
42 ft_strlen.c
Lo and behold, I found some 42 repos, dug around and was able
to find all the Piscine pdfs. I did not have enough time to
learn all that in a week, but I knew what I was getting into
and had a head start.
read this about parsingls:
http://mywiki.wooledge.org/ParsingLs
42 Scoreboard
-------------
https://public.tableau.com/profile/mikhail.filipchuk#!/
languages
---------
nim
zig
c interpreters
--------------
picoc
eiC-C-interpreter
# rlwrap - use this for better repl/interpreter interaction
Avoid side effects in a loop condition like this:
while (*(s + ++i))
Makes debugging a bitch and is unmaintainable
searchcode.com
rutracker.org (russian tracker is the best)
russian facebook (is best, anything goes) (vk maybe)
irssi
-----
irssi -n SomeCoolNick
# Start irssi with chosen nick
sdf stuff
---------
nsdf.lonestar.org
# ssh locations
hooktube.com
# light weight replacement for youtube
https://mastodon.sdf.org
# sdf gnu social
http://sdfarc.org/
# SDF Amateur radio club
https://sdf.org/motd/
# blog
twitter.com/sdf_pubnix
# sdf twitter
https://anonradio.net/
https://archives.anonradio.net/
anonradio.net:8000/anonradio (to listen with music player)
# sdf djs
-------------
end-sdf-stuff
bocal githubs
-------------
https://github.com/eliotv/ft_ls
https://github.com/SuperSpyTX/42-Ls
https://github.com/Lunairi/42-ft_ls
level 19 githubs
----------------
https://github.com/Denis2222/brainfuck
edgaerrz github
---------------
https://github.com/Ultraman82/42_fillit
others githubs
--------------
https://forosuru.github.io/user/izcet.html
https://forosuru.github.io
# Possible list of a bunch of 42ers
https://github.com/PavelJland
# pavel
https://github.com/MrColour
# kmirarrs
https://github.com/akharrou
# haymen
osx-githubs
-----------
https://github.com/galacticgargleblaster
# Nick has .dotfiles for loading profile
exam githubs
------------
https://github.com/JamieDawson
https://github.com/adpdsr/exam
https://github.com/artgaspard/exams_C
https://github.com/tonmanayo/exam
https://github.com/teddav/42Projects/tree/master/EXAMS
https://github.com/fwuensche/42-exam-miner
https://github.com/miniponps/42-Piscine-C
https://github.com/MagicHatJo
https://github.com/JeremTS77
https://github.com/ruv1nce/42-exam-beginner
https://github.com/evandjohnston/ft_alone_in_the_dark
https://github.com/sayakura/42__Exams--Beginner
# Demon's
https://github.com/Manmeet2018/42-exam-miner----Basic
# Dmon's buddy
piscine githubs
---------------
https://codesmell.elouworld.org/Exagone313?sort=recentupdate&page=1&q=&tab=
https://github.com/jraleman/42_Piscine-C
https://github.com/thierry-silbermann/42_Piscine_July2015
https://github.com/sebastiencs/piscine_42
https://github.com/fotonmoton/42
other githubs
-------------
https://github.com/kab11?tab=repositories
https://github.com/nkone/Fillit/blob/master/README.md
# ereeck's
printf
------
https://github.com/gavinfielder
# Galvinize pft printf tester
peeps github
------------
https://github.com/cbg119
repl.it
-------
https://repl.it/@apenisto
https://repl.it/repls/RoundObeseHardware
https://repl.it/@Nikniven
keyboards
---------
https://kinesis-ergo.com/
# ergo keyboards
conversion (vr game)
https://marvin.riking.org/factoids/_/wifi
# all marvin factoids
42 code
-------
https://repl.it/repls/RoundObeseHardware
# libft on repl.it
libft others
------------
https://github.com/conanwu777/C-library
https://github.com/ldehaudt (not sure but worked with wu)
https://github.com/riking/libft
libft personal functions
------------------------
ft_find_word
ft_count_words
ft_strrev
libft need work
---------------
strnstr_MAIN - not working
ft_itoa (!!find out what this code is doing!!)
fix return; to return ;
libft unit tests
----------------
https://github.com/alelievr/libft-unit-test
https://github.com/Kant1-0/libft-test
https://moulibft.com/
# Straight from github
libft mains
-----------
https://github.com/JulienBalestra/42/tree/master/tests/libft_mains
https://github.com/QuentinPerez/Maintest/blob/master/libft/main.c
pbie42 github (commented libft)
https://github.com/Matt-Hurd/42-libft
#libft (his atoi passed ulong test)
https://github.com/SamLynnEvans/Lem_in/blob/master/libft/SRC/ft_printf/unicode.c
https://github.com/SamLynnEvans/Lem_in/blob/master/libft/SRC/libft/print/ft_unicode_putchar.c
# unicode support with putchar
conanwu
-------
https://www.youtube.com/watch?v=XE8Qi0sdG0A
# conanthebarbarian youtube
unicode stuff
-------------
https://betterexplained.com/articles/unicode/
https://unicodebook.readthedocs.io/
books-to-get
------------
http://web.ipac.caltech.edu/staff/fmasci/home/CprogramsAndExamples.pdf
# Examples coded from 1996
A Discipline of programming
# iskandar recommends
hitchhikers guide to python
effective python
python trikcs the book
links
-----
https://www.includehelp.com/c-programming-examples-solved-c-programs.aspx
https://www.hackerrank.com/domains/c
http://www.learntosolveit.com/
https://www.spoj.com/
https://code.google.com/codejam
https://www.cprogramming.com/challenge.html
https://graphics.stanford.edu/~seander/bithacks.html
free schools
------------
https://modernlabor.com/
# Get paid to learn to code (pay 15% of salary for two years)
freecodecamp
# Good for javascript learning (according to edgar)
sites to learn to code
----------------------
1. codechef.com
2. spoj
3. topcoder
4. Codeforces
5. hackerearth
6. hackerrank
###
api
---
https://api.some42place.url/apidoc
# 42 api docs
curl -X POST --data "grant_type=client_credentials&client_id=$FT42_UID&client_secret=$SECRET" https://api.some42place.url/oauth/token
curl "https://api.some42place.url/oauth/token/info?&access_token=$FT42_TOKEN&token_type=bearer"
https://profile.some42place.url/oauth/applications/2437
curl -X POST --data "grant_type=client_credentials&client_id=ID_HERE&client_secret=SECRET_HERE" https://api.some42place.url/oauth/token
curl -H "Authorization: Bearer HERE_GOES_YOUR_TOKEN" https://api.some42place.url/oauth/token/info
curl https://api.some42place.url/oauth/token/info?&access_token=HERE_GOES_YOUR_TOKEN&token_type=bearer
curl -X POST --data "grant_type=client_credentials&client_id=MY_AWESOME_UID&client_secret=MY_AWESOME_SECRET" https://api.some42place.url/oauth/token
filter:
GET /users?filter[pool_year]=2018&filter[pool_month]=september,october HTTP/1.1
end-api
#######
https://github.com/AlexEzzeddine/campus42
# Repo for campus.42
search gitlab too, a lot of the non US 42ers post their code here!!!
Just search for a project's name.
applescript
-----------
https://acdesigntech.wordpress.com/2012/02/03/using-bash-and-applescript-to-unlock-a-macs-desktop/
# bash and applescript to unlock desktop??
caffeinate -s
# Stop osx from sleeping??
while :; do echo 'Hit CTRL+C'; sleep 1; done
# bash infinite loop
bad ass coder
-------------
Conanthebarbarian
https://repl.it/@ConanWu
research
--------
mercadolibre (julio amazon??)
cstring (pointer shit)
c-exam-alone-in-the-dark
Piscine Reloaded
react native (to get job!)
https://tunnelbroker.net/
# take test for free hosting
minitel pre-internet [french internet] (watch youtube videos)
https://kb.iu.edu/d/aqsy # gdb inside emacs
http://www.unknownroad.com/rtfm/gdbtut/gdbsegfault.html
https://www.strchr.com/expression_evaluator
https://github.com/pbondoer/42-evalexpr
https://www.geeksforgeeks.org/expression-evaluation/
# expr_eval info
line feed is a newline
form feed goes to next page
fp/np = form feed / new sheet of paper = 12 (decimal in ascii)
https://www.jdoodle.com/c-online-compiler
https://tio.run
# online c compiler with cmd arguments
githubs to get??
----------------
https://github.com/st3w4r?tab=repositories
# has ocaml pool
TesteurManiak
# epitech
watch
-----
https://www.youtube.com/user/mycodeschool/playlists
exams
-----
epitech has some same questions on exam (epitech_exam_cpe)
use cpe, cpe-2013, etc for epitech stuff
books
-----
the c answer book
learn c the hard way
head first c
webflow
# Html/Css editor
https://github.com/curquiza/42_logtime
# Example api logtime
https://github.com/qst0/ft_findstudent.git
# Api to find student
https://github.com/LiuVII/42stats
# api for stats
https://github.com/fakenine/omniauth-marvin
# omniauth-marvin
https://github.com/MatiasFMolinari/fortytwo
# fortytwo gem
gem install --user-install fortytwo
http://nuclear.mutantstargoat.com/articles/make/
https://www.gnu.org/software/make/manual/html_node/Wildcard-Function.html
# Makefile tutorial
https://www.cs.dartmouth.edu/~campbell/cs50/buildlib.html
# Library tutorial
https://github.com/lattera/glibc
# glibc commented
https://www.meetup.com/papers-we-love/events/238718664/
# lisp stuff to research
https://github.com/qst0/ft_c_piscine/
# has commented code
The Recurse Center
# Writers work shop for coding
# Constantine recommends
The Matasano Crypto Challenges
https://microcorruption.com/login
Dev Mountain
# Ereeck's bootcamp he took
??????? slack reminder ???????
Manage Slots (profile page)
###########################
Correction calendar
For grading others stuff
Header needs to be in all c files!
42 Info
-------
All tutorials they have suck ass, but if a go getter, projects are cool.
Vidoes start playing anywhere randomly, whether watched or not.
Dorms are dirty as fuck, tubs/showers do not drain... but it's a free dorm.
Cantina food is a rip off half the time.
Keyboard, mice, and monitors are disgusting as fuck
Slobs everywhere, and loud as fuck
Everything is online, all code and projects can be found on internet,
if you search diligently, so don't even need to be here.
git
###
git clone vgs:pisc....
git status
git add test.c
git status
git commit -m "Put commit commit here create test.c" # commit does the versioning part
git add test.c # after editing
git commit -m "blah blah"
git push origin master # first time needs destination
git push # use this after first time
git add -A
# add all new files
git add *
# ??? maybe same as add al files
git ls-tree --full-tree -r HEAD
# See what is in your git repo ??? why head??
vogspheredor
############
Do not put more than 100mb in repository (or get in trouble)
kerberos
########
klist
# lists every ticket you own
kdestroy
# delete all your tickets
# git will say you don't have access with out a ticket
kinit myUsername
# to get a new ticket
emacs
#####
C-c C-h
# 42 header
# Header needs to be in all c files!
vim
###
:Stdheader
# 42 header
# Header needs to be in all c files!
vim macro
---------
qhfn-f1:w:bnq
# Create a macro to add 42header, save file and go to next buffer
@h
# run the above macro
5@h
# Run the above macro five times
-------------
end-vim-macro
vim split windows
-----------------
C-w v - split verically (:vsplit file)
C-w s - split horizontally (:split file)
C-w hjkl - move to chosen window
C-w w - go to next window
C-w <> - grow shrink window left/right
C-w +- - grow/shrink window up/down (can be prefixed with a number)
C-w = - make all windows equal size
C-w _ - maximize current window (horizontally)
:hide - close current window
:sview file - split window with file in read only mode
:b 3 - open buffer three in this window
:ls - list buffers
:only - close all other windows
:e - edit another file
touch -mt 201806012342 what.txt
# Change time with touch
# YYYYMMDDhhmm
# use -h to change only a symlink date and not original
tar
###
tar -tvf someFile.tar
# list tar files
ldap
####
ldapwhoami 2>&1 | grep org | awk -F ":" '{print $2}'
# Get distinguished name by redirecting stderror to stdout
ldapsearch uid=someUserName
# show info about a user
# use * to see all users
ldapsearch -xLLL "(uid=z*)" cn | grep "^cn" | awk -F "cn: " '{print $2}' | sed 's/ / /g' | sort -fr | sed '/^$/d'
# Show all users in reverse order that start with z
dn: uid=someUserName,ou=october,ou=2018,ou=people,dc=42,dc=us,dc=org
changetype: modify
replace: mobile
mobile: 555.555.5555
# example ldif file
# some change types: add replace delete
ldapmodify -f mobile-phone.ldif
ldapsearch -LLL -u -t "(uid=someUserName)" mobile > blah
# Get mobile info (not quite specific)
base64 -d blah
# Decode number
file
####
/usr/share/file
# location of magic.mgc on mac
file -C -m myMagicFile
# -C = compile
# -m = source file
file -i -m myMagicFile *
file -m myMagicFile someOtherFile
# use the myMagicFile
# each line represents a test
# The test is made of 4 items, seperated by tab (space may work too)
# offset type test message
#offset – specifies the offset, in bytes, into the file of the data which is to be tested.
#type – the type of the data to be tested (see here for a list of all possible values) (man magic to see types: ex: string).
#test – the value to be compared with the value from the file.
#message – the message to be printed if the comparison succeeds
http://openpreservation.org/blog/2012/08/09/magic-editing-and-creation-primer/
# more info on file
mac
###
cmd+cntrl+powerbutton = reboot mac now
patch
-----
patch < sw.diff
# Asks for which file to change
patch a sw.diff -o b
# ???? Maybe better than above if typed right??
sh
--
export LINE=3
unset LINE
# Remove a variable
rev, grep, etc
http://wiki.bash-hackers.org/commands/builtin/printf
# bash printf info
https://stackoverflow.com/questions/41965415/using-find-to-return-filenames-without-extension
# info about printing filenames without extensions
/dev/null
# Use > /dev/null to only see error message by sending stdout to null
groups $some42Variable| tr " " "," | tr "\n" "\0"
# print a users groups seperated with comman with no \n at end
touch ./-rat ./-cat ./-mat
# create file name starting with hyphen
for f in * ; do mv -- "$f" "level00-$f" ; done
# rename files/folder in cwd with a prefix.
## -- allows for filenames that start with -
find . -name \*.sh -execdir sh -c 'printf "%s\n" "${0%.*}"' {} ';'
# Find all files ending in sh but do not show .sh
find . -type d -not -empty -exec echo mv \{\}/file.txt \{\}.txt \;
# Rename files to folder names with .txt at end
# remove the echo...
tail -n +1 ./* | less
# Show all files with filename as a header
find -s . -type f -name "*.txt" -print | while read filename; do echo "$filename"; cat "$filename"; echo "========================\n\n"; done
# Show all files with filename at top and separator at bottom and sort them
find -s . -type f -name "*.txt" -print | while read filename; do
echo "======================================$filename========================================="; cat "$filename";
echo "==========================================================================================\n\n\n\n"; done
# cat all files with name as header and seperator at bottom
# -s = sort (may be different than | sort)
# Useful after downloading someones 42 git repo, run this
# and see all code separated by the above header.
find -L . -print | grep blahblah
find -L . -name piscine-stuff
# -L to follow symlinks (like on sdf)
|vim -
# vim read from stdin???
| pbcopy
# Send terminal output to osx clipboard
cat /etc/passwd | grep -v '^#' | awk '!(NR%2)' | cut -d: -f1 | rev | sort -r | awk "(NR>=$some42Var && NR<=$some42Var)" | awk 1 ORS=', ' | sed 's/, $//' | awk 1 ORS='.'
# d01 ex07
C Lang
------
C-c C-h - Add 42 header in emacs
F1 - Add 42 header in vim
Add header to all c files
Only submit main if they ask for a: "program"
They will use their own ft_putchar() [if it is not banned]
Moulinette will check the norm (syntax spec)
norminette -R CheckForbiddenSourceHeader
Use -Wall -Wextra -Werror
Score = 0; If it does not compile
write(1, "@\n", 2);
factoid
-------
To use a factoid use !factoidName
!header
!mail
42 Stupidity
------------
Will check your work
git clean everything out
------------------------
https://stackoverflow.com/questions/11071420/delete-everything-and-upload-new-version
1.) Delete everything in your repository folder
2.) run git rm * to tell git to remove all files (check with git status whether there are any unstaged files left)
3.) do a git commit -a -m "commitmessage" a git push origin master to delete all files on the remote git server
4.) check if you have an empty remote repository now
5.) copy all new files to the local repository folder
6.) run git add * to tell git to add all new files (check with git status whether there are any unstaged files left)
7.) commit and push the new files
Now you should have the version on your remote git repository.
More 42 Tools
-------------
https://github.com/jgigault/42FileChecker
# 42FileChecker is a tiny bash script developed at 42 school for testing and checking the files according to the rules of the subjects.
https://github.com/fwuensche/42-test-monial
# Stupidity simplified
https://github.com/LiuVII/42stats
https://public.tableau.com/profile/mikhail.filipchuk#!/vizhome/42CourseProjectsandScoresbyusers/Dashboard1
# 42 api scores external
cheatera.pp.ua
# Not working but supposedly shows how much xp a project gives
libft commented
---------------
https://github.com/pbie42/libft42commented/blob/master/ft_putnbr.c
https://github.com/CameronFredrickson/libft
https://github.com/R4meau/libft/wiki/Personal-Functions-Documentation
https://github.com/R4meau/libft/tree/master/personal-funcs
https://github.com/ealbert-42/Libft/blob/master/SOURCES/ft_atoi.c
https://repl.it/@acolon/d02ex06-ftputnbr
# Sample code runable
Beat moulinette!
----------------
https://medium.com/@WMisiedjan/how-to-beat-moulinette-at-42-9b6102db9cf
# Couple tools to use
###############################################
https://github.com/mirror12k/42us-stupidity.git
# 42 Stupidty
# Useful to test your code before submitting or
# to check someone else's code before using it as an example.
clone this repository, and then clone a student's work repo inside of this one. run ./spawn.pl THEIR_WORK_REPO/ config.pl (replace THEIR_WORK_REPO with the repo that you cloned, and config.pl with the name of the config file that you wish to test (they are named by day, so d02 would be config_d02.pl)). the spawn script will create test files for all exercises that it finds present.
after spawning, run ./tools/build.sh to build their files with the provided main.c's. run ./tools/verify.sh to have norminette verify all files. finally, run ./tools/check_all.sh to perform all tests. good tests will simply state 'good', errors will be printed with big exclamation marks.
----
./spawn.pl Their_Work_Repo config.pl
./tools/build.sh
./tools/verify.sh
./tools/check_all.sh
###############################################
gitters
-------
miniponps
shell
-----
$?
# Show last return value
man pages
---------
man ascii
man putchar
intra api
---------
oooo where???
https://api.some42Place.url/apidoc
https://profile.some42Place.url/oauth/applications/new
https://api.some42Place.url/apidoc/2.0/users/index.html
# User information
lldb
----
gcc -g
# compile with debug stuff
b main
# Set a breakpoint on a function name
run
# run the program
n
# step through the program
print var_name
# print variable
f
# show stack frame
fr v
# show all variables
homebrew
--------
# Add homebrew to your 42 Mac for your user only
mkdir $HOME/.brew && curl -fsSL
https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C
$HOME/.brew
mkdir -p /tmp/.$(whoami)-brew-locks
mkdir -p $HOME/.brew/var/homebrew
ln -s /tmp/.$(whoami)-brew-locks $HOME/.brew/var/homebrew/locks
export PATH="$HOME/.brew/bin:$PATH"
brew update && brew upgrade
----
Afterwards make sure you add the following lines to your `.zshrc`.
mkdir -p /tmp/.$(whoami)-brew-locks
export PATH="$HOME/.brew/bin:$PATH"
# This way worked for 42
########################
https://andrewjorgensen.com/post/install-homebrew-to-your-home-directory/
# Install homebrew to home directory
# Did not work at piscine
brew cask
---------
brew cask install --appdir=~/Applications racket --verbose
# install a cask without root
cider
-----
https://cider.readthedocs.io/en/latest/using_the_repl/
zsh
---
https://kevinjalbert.com/more-shell-history/
# history size
http://reasoniamhere.com/2014/01/11/outrageously-useful-tips-to-master-your-z-shell/
# Go through this tutorial
https://stackoverflow.com/questions/4318263/java-subtract-0-from-char-to-get-an-int-why-does-this-work
# adding string to '0' to convert to int??
lisp
----
http://trevorjim.com/lisp-and-c/
http://www.drdobbs.com/cpp/the-power-of-lisp-for-c-programmers/199900573
https://softwareengineering.stackexchange.com/questions/9320/why-is-lisp-useful
books
-----
lisp hackers
edgaerrz books
--------------
the way of the bow
the alchemist
games that teach code
---------------------
codingame.com
codecombat.com
http://vimgenius.com/
https://vim-adventures.com/
https://www.openvim.com/
c libraries
-----------
gcc -c putstr.c
# Creates the .o object file to put into the library
ar rc libname.a some_object.o some_other.o just_one_more.o
# Create a library out of some object files.
# Library name has to start with lib.
gcc main.c -L. -lname
# Compile with a library that is in the current directory named libname.a
ranlib libname.a
# Creates an index at the top of you library to speed up gcc compile time.
# As gcc will only use parts of the library that are needed, so need to hunt
# the used ones down.
gcc main.o ft_putchar.o ft_putstr.o
# Link previously compiled object files together into an exectutable binary.
# This lets you recompile only one file and then you can relink them all back,
# which is quicker than recompiling everything.
dynamic memory allocation
-------------------------
#define LEN 42
char *str;
str = malloc(LEN);
free(str);
preprocessor
------------
cpp main.c
# cpp is the preprocesor; calling it like this will let you
# see what the preprocessor is doing, before it starts compiling.
#include "fct.h"
# Include a local file
#ifdef meme
blah blah
#endif
// only show block if meme is defined
#ifndef thisHere
blah blah
#endif
// show block if thisHere is not defined
#ifndef __FT__TES1_H__
# define __FT_TEST1_H__
#include "test2.h"
#endif
// stop file from being included in an infinite loop
typedef struct s_point
{
int x;
int y;
} t_point;
int main(void)
{
t_point a;
t_point b;
t_point *ptr;
a.x = 10;
a.y = 42;
b = a;
ptr = &a;
(*ptr).x = 10; // Can also be written: ptr->x = 10;
return (0);
}
typedef int whatever;;
# Create a custom type (such as: int, char, etc)
books
-----
https://www.learnenough.com/courses
c-standard-library
------------------
glibc, musl libc, diet libc, uClibc, and Bionic
# std libs that can be downloaded
HISTFILE=/dev/null
unset HISTFILE ; unset HISTSAVE ; unset HISTFILESIZE ; unset HISTCONTROL ; unset HISTCMD
# Unset history
Sudoku
------
http://norvig.com/sudoku.html
make file
---------
EXAMPLE_VARIABLE = "whack azz tutorials here at 42"
rule_a:
echo "rule a"
@echo EXAMPLE_VARIABLE
rule_b: rule_a
@echo "rule b"
# Make rule a dependency of rule b
# @ supresses displaying the echo rule a, before it runs it
left-off (makfile example)
############################################################################
### Example Makefile from freebsd
# Created by: roland.jesse@gmx.net
# $FreeBSD: head/graphics/Coin/Makefile 472637 2018-06-17 21:24:37Z adridg $
PORTNAME= Coin
PORTVERSION= 3.1.3
PORTREVISION= 12
CATEGORIES= graphics
MASTER_SITES= https://bitbucket.org/Coin3D/coin/downloads/
MAINTAINER= ports@FreeBSD.org
COMMENT= C++ 3D graphics library based on the Open Inventor 2.1 API
LICENSE= GPLv2
LIB_DEPENDS= libsimage.so:graphics/simage
USES= openal:al libtool pathfix
USE_GL= yes
USE_XORG= ice sm x11 xext xt
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --with-pthread=yes --enable-threadsafe \
--enable-3ds-import --enable-sound \
--enable-javascript-api --enable-debug=no
USE_LDCONFIG= yes
INSTALL_TARGET= install-strip
pre-configure:
@${REINPLACE_CMD} -e 's|DATA install-data-local|DATA|g' \
${WRKSRC}/Makefile.in
@${FIND} ${WRKSRC} \( -name \*.cpp -o -name \*.h -a \! \
-name expat.h \) -a -print0 | ${XARGS} -0 \
${REINPLACE_CMD} 's///g'
post-build:
${REINPLACE_CMD} -e '/^ldflags=/s|-R|-Wl,-rpath,|' \
${WRKSRC}/coin-default.cfg
.include
###-end-example-makefile-freebsd
############################################################################
research
########
pointers to funtions
lldb
valgrind (find memory leaks)
chained list
------------
ft_list.h
Use this structure:
typedef struct s_list
{
struct s_list *next;
void *data;
} t_list;
-----------
(*head).data = data;
** is the same as
** head->data = data;
file descriptors
----------------
0 = stdin
1 = stdout
2 = stderr
fd = open("fileName", 0_RDONLY);
ft_putnbr(fd);
O_WRONLY
O_CREAT
S_IRUSR
S_IWUSR
if (fd == -1)
{ ft_putsr("open() faild\n");}
if (close(fd) == 1)
{
ft_putstr("close() failed\n");
return (1);
}
vim
---
:w|bd
# Write and close a buffer
:wnext
:wn
# Save and go to next buffer
:next
# go to next buffer
:bd
:bdelete
# Close a buffer
// sample function with main
/////////////////////////
#include
char *ft_strcpy(char *s1, char *s2)
{
while ((*s1++ = *s2++))
;
return (s1);
}
int main(void)
{
char str_src[] = "kitty";
char str_dest[] = "Saluteeee";
printf("%s", str_dest);
ft_strcpy(str_dest, str_src);
printf(" %s ", str_dest);
return (0);
}
//end-sample-functions with main
//////////////////////////////
for i in {0..100}; do say "do you wistle while you work?"; done
# Make osx talk (voice synth)
echo -n "&" | xxd -b | awk '{print $2}'
# Use xxd to display binary for an ascii char
echo 00100110 | perl -lpe '$_=pack"B*",$_'
# Convert binary to ascii with perl;
echo "&" | perl -lpe '$_=unpack"B*"'
# Use perl to convert ascii char to binary
Admission Info
--------------
PISCINE
Once you’ve verified your account, you can sign up for one of our Piscine sessions. These are part of the admissions process and are 4 weeks of intensive and immersive coding. No prior coding experience necessary at all! More info here.
START DATES
If you complete the Piscine and are accepted into the program, then you can select a Start Date to begin you adventure in the full 42 program.
--------------
others resources
----------------
Hey guys! I've been making a list of resources that I found to be invaluable during Piscine and was wondering if you have anything to add that really helped you understand some of the concepts? So far I have tutorialspoint.com, C Programming - A modern Approach, Geeksforgeeks.com, Solo Learn C Course, Code Academy's Shell & Git Courses, VIM Adventures, The C Programming Language Ansi C Book, and Caleb Curry's C course as well as MyCodeSchool's C courses on YouTube.
Vipassana retreat
house of sun
eco community
tazhang
"Maryann James"
42 kdc realm (kerberos)
-----------------------
[libdefaults]
default_realm = someUrl
forwardable = true
proxiable = true
dns_lookup_kdc = no
dns_lookup_realm = no
allow_weak_crypto = true
[realms]
someUrl = {
kdc = kdc.someUrl
admin_server = kdc.someUrl
default_domain = someUrl
default_lifetime = 7d
ticket_lifetime = 7d
}
[domain_realm]
.someUrl = someUrl
someUrl = someUrl
-------------
end-kdc-realm
https://www.geeksforgeeks.org/program-to-find-whether-a-no-is-power-of-two/
# power_of_2 info
wget notes
----------
wget -m -np --reject="index.html*" http://nigal.freeshell.org/42/libft/
# Do not create index.html* files
homebrew
--------
brew install emacs
brew uninstall emacs
brew search emacs
brew search "/emacs*/"
brew restart service chunkwm
install chunkwm
---------------
brew tap koekeishiya/formulae
brew install chunkwm
osx tiling wms
--------------
Amethyst
chunkwm
osx automation
--------------
hammerspoon
applescript
podcasts
--------
https://soundcloud.com/twiml
# ML and AI podcast
youtube
-------
https://www.youtube.com/watch?v=2NWeucMKrLI&list=PL6gx4Cwl9DGAKIXv8Yr6nhGJ9Vlcjyymq
# thenewboston c tutorials
clojure
-------
brew install clojure
brew install leiningen
lein repl
emacs
-----
http://www.grokcode.com/207/51-insanely-useful-emacs-shortcuts/
emacs games
-----------
mine sweeper (forgot name)
poker
dunnet
schemes
-------
gieser (emacs; like slime)
chez
chibi
# Good for embedded
chicken
# chicken-install sicp
# Then put: [put at beginning of source file]
# (use sicp)
screen
------
https://tomlee.co/2011/10/gnu-screen-splitting/
http://aperiodic.net/screen/quick_reference
# Grab screen shortcuts for split screen
mousetrack on
# Turn on mouse in .screenrc
fork bomb
---------
:(){ :|: & };:
# Example of a fork bomb
sed
---
sed -i.bu 's/#include \"includes\/libft.h\"/#include \"libft.h\"/' *.c
# Replace include line
# -i.bu makes backups with .bu
bash/zsh
--------
C-v TAB - insert tab
file locks
----------
/Volumes/goinfre/
# Use this area to get around file locks of nfs
gradle??
--------
kyork has a script that lets you test android app on 42 macs
https://github.com/riking?tab=repositories
pygame tutorials
----------------
https://opengameart.org/content/platformersidescroller-tiles-and-backgrounds
# game art content
https://www.youtube.com/watch?v=UdsNBIzsmlI
# one I am following now
https://www.youtube.com/watch?v=iRrMsxQCiJg
# zelda pygame for beginners
https://www.youtube.com/watch?v=K5F-aGDIYaM
# have not looked at
rsync
-----
rsync -avPh -e 'ssh -p 2222' ~/doggyBag UserName@192.168.1.2:/home/someUser/someFolder
rsync -avPh -e 'ssh -p 2222' ~/42-gitted ~/42-play ~/42-testers ~/bkup ~/books ~/lrn ~/shell_scripts ~/doggyBag userName@192.168.1.2:/home/userName/42-bkup
# backup folders from your 42 computer/profile to your own computer.
hercules
--------
systemctl poweroff
/sbin/shutdown -h now
# Turn off debian9 (systemd)
apt-get install sudo
adduser username sudo
# logout and log back in
apt-cache search vim
# Search for a package
apt-cache show vim-nox
# show info about a package
apt-get install vim-nox
# install a package
sudo update-alternatives --config editor
# Change default editor system wide
alias editor=vim
# Change default editor for user
# add to ~/.bashrc
sudo visudo
username ALL=(ALL) NOPASSWD:ALL
# /etc/sudoers
# No passwd for sudo command
libreoffice
-----------
:---:
# Autocorrects to endash
:--:
# Autocorrects to emdash
ssh-copy-id -i debules_id_rsa.pub userName@127.0.0.1 -p 2222
# Copy a specific key over
ssh -i ~/.ssh/debules_id_rsa 127.0.0.1 -p 2222
# Use a specific ssh key to connect
hashbang
--------
systemctl --user enable --now SimpleHTTPServer@9002
# Turn on web space
/usr/local/bin/hashbangctl
# Add remove ssh keys
nfo files
---------
iconv -f cp437 -t utf8 cH-wus3.nfo |less
weechat
-------
alt+l - zoom chat fullsreen
alt+= - show toggle showing joins
osx
---
osascript -e "set Volume .01"
# Change volume from command line
# -e Takes one line of script; does not look for file
# Several -e can be used to build multiline script
# osa = Open Scripting Architecture
# Works with AppleScript and other osa languages
# By defualt OSX will treat files as applescript
# A common extentions is: .scpt
oslang
# Will show which osa languages are installed on your system
https://github.com/mathiasbynens/evil.sh
# Script that messes with people
casks
-----
affinic debugger
vbox
----
VBoxManage modifyvm "debules" --defaultfrontend headless
# Make headless the default for a VM
github not working at 42
------------------------
I, too, just had this problem start all of a sudden
within the past few days. It's definitely not Homebrew
as mentioned above; I ended up doing
git config --global --unset http.proxy
git config --global --unset https.proxy
and then restarting my term session and it works again
------------------------
logout scripts
--------------
cuz we probably changed from using `idle script` to something like `munki
logouthelper` which is tougher. But we should also getting easier software
install and update # Example of what might be used (from a slack post by: seli)
Hello new cadets, if you experienced `iTerm could not open` or other app freeze
on open. Check if your `~/Library/Application Support` etc. symbolic links are
pointing to a valid place. If your `/Volumes/Storage/cache` dir is missing.
Remove the soft link to let your application run or manually soft link them to
`/Volumes/Storage/goinfre` for a temporary fix.
screen recording
----------------
obs is on macs (open broadcasting studio)
text games
----------
flexible-survival
https://blog.flexiblesurvival.com/p/play-flexible-survival.html
cheats
------
/var/folders/zz
# Bunch of stuff created here for each user
lsof | grep /Volumes/[name_of_drive]
# show what process is keeping harddrive from ejecting
nootropics
----------
liftmode.com
default