SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2014-01-16 13:15:16

samZ0rp
#! CrunchBanger
Registered: 2013-12-18
Posts: 122

learning to code

Any ideas that could help me learn faster
I use the terminal occasionally to install update and
  Clean the system but want to be able to use stuff like metasploit. In the end I want to try my hand at white hat hacking (pen testing not stealing stuff) and I want to make as Debian based distro set up by me.


Warning it may eat your hampster

Offline

Help fund CrunchBang, donate to the project!

#2 2014-01-16 13:29:20

spiritchaser
#! CrunchBanger
From: Temple Suspended in Void
Registered: 2013-05-14
Posts: 101

Re: learning to code

so you write that you want to learn to code..
if you have no previous coding experience , i would recommend http://learnpythonthehardway.org/ to grasp the basics of python & programming.

edit: also if you want to explore the command line and *nix in general : Learn Linux The Hard Way http://nixsrv.com/llthw

then maybe something like Nmap Cookbook might interest you
  smile

Last edited by spiritchaser (2014-01-16 13:36:04)

Offline

#3 2014-01-16 13:56:23

retf
#! CrunchBanger
From: On top of spaghetti
Registered: 2013-12-25
Posts: 200

Re: learning to code

If you're interested in learning how to program and are interested in computer security issues, this is a good place to gather a bit of experience in both...

http://www.matasano.com/articles/crypto-challenges/

You sign up for the crypto challenges, and when you've completed a few you advance to the next set.
I'd also recommend learning a little about the C language.  Python makes lots of things a bit too easy, and without a good challenge you're less likely to really learn programming...

In any case, you might want to create a github or gitorious account where you can post your work [not the Matasano stuff though] and people here or other places can view, download, make comments, etc...

github:
https://github.com/

gitorious:
https://gitorious.org/

Last edited by retf (2014-01-16 13:57:47)

Offline

#4 2014-01-16 14:31:10

wmdiem
#! CrunchBanger
Registered: 2008-12-26
Posts: 187

Re: learning to code

It might be starting too high, but I'd recommend starting with C: it's not interpreted and produces fast, lean code, lots of important programs are written in it (so it is really useful to people in the FOSS world), and it is relatively easy to pick up higher-level languages as needed once you have a good grasp of C. Plus, being relatively close to the metal, it forces you to think about what is going on under the hood in your machine, which will be important if you are trying to find vulnerabilities.

If you go this route, I'd recommend starting with a tutorial, e.g., this. Then I'd try writing some proof-of-concept  programs (e.g., can I write a program that successfully uses a doubly linked list, including insertions and deletions?), to make sure I can actually do what I've been reading about. Then I'd, in no particular order:

  • Start reading the source for projects I'm interested in (especially ones that can fit all their code in one file, and that have decent comments), make sure you can follow the whole thing, and know what each bit is going. This can take time, even on a relatively simple projects. Don't be afraid to modify them once you have a grasp of what is going on.

  • Read an article or two on optimization, e.g., here

  • learn how to use gdb. It will make your life so much easier when the bugs start biting.

And remember, man sections 2 and 3 are your friends (so is google).

Good luck!

Offline

#5 2014-01-16 14:52:46

retf
#! CrunchBanger
From: On top of spaghetti
Registered: 2013-12-25
Posts: 200

Re: learning to code

@wmdiem:
The tutorial looks good, but doubly linked lists in C require significant knowledge. I'm not sure the age or educational or financial status of the OP, but I've always found the best way for me to learn something involved - is to take a college level class at a local university/college/community college --- Where I live, there are community colleges and I can audit a class for no grade or credit - just the relatively low fee.  This is seriously what I would recommend to learn programming fast and well.

If, on the other hand, circumstances preclude taking a class - I'd start by picking up an actual paper book to browse/write in/dog ear/etc... and then try to solve and program a few short "assignments" from places like "Project Euler"
https://projecteuler.net/
or the previous Matasano link...

Offline

#6 2014-01-16 16:04:42

wmdiem
#! CrunchBanger
Registered: 2008-12-26
Posts: 187

Re: learning to code

Good thing I didn't go with my original examples: an XOR doubly linked list and a B-tree. : P

But seriously, a doubly linked list isn't *that* hard to write (that said I'm sure I will screw it up), especially with the bajillion examples you can find, and it is a fairly common technique to solve a common problem.

Just for grins (and without checking any examples or references):

void remove_item( struct item *p) {
    if (!p) {
        return;
    };
    if (p->next) { 
        p->next->prev = p->prev;
    };
    if (p->prev) { 
        p->prev->next = p->next;
    } else {
        first_item = p;  //global variable storing the head of our list
    };
    free(p);
}

struct item* insert_item (struct item *position) {
   //creates a new empty item and inserts it after position (to make it first, call with NULL, returns pointer to new struct
   
    struct item *p = (struct item *) malloc(sizeof(struct item));
    p->prev = position;
    if (position) {
      p->next = position->next;
      position->next = p;
    } else { //position is NULL, so we put it at the front of the list
      p->next = first_item;
      first_item = p;
    };
    if (p->next) {
      p->next->prev = p;
    };
   return(p);
}

^caveat lector: Written from scratch, never run through a compiler; may include typos or other errors.

It's working through problems (and working out the inevitable bugs as you go) that make one actually be a good programmer.


BTW, the crypto challenge looks pretty cool. If I had time I might take it.

Last edited by wmdiem (2014-01-16 17:05:43)

Offline

#7 2014-01-16 16:14:36

xero
#! Junkie
From: 0x000000
Registered: 2013-09-30
Posts: 382
Website

Re: learning to code

http://codecademy.com/
http://learnstreet.com/
http://codeschool.com/

are all great online resources (some free, some paid). they are all project based.

as for books, i cannot speak highly enough about *ANYTHING* published by http://www.oreilly.com/
they're consistently publishing works by great authors.

http://github.com is another great resource, if your a learn by seeing + tinkering type. but beware! you can fall in on github very quickly though! i've gotten lost checking out new stuff and wasting half my day there lots of times! lol.

i'd pick a language that appeals to you based on use more than syntax. if you like web, i suggest javascript (along with scripting langs like html, css). or go server side, and learn php or ruby. if you like utility scripts i'd say bash or python. if you want to write "real world" desktop apps: c/c++ or java are the standards, but have a *much* higher learning curve.

either way, i suggest you learn *any* language before diving into metasplot. it's very script heavy, and having at least a basic understanding of programming will help you understand it a lot better.
here's some info-sec links to get you started:

kali linux: when you want to jump into pen-testing, it's a pre-configured hacking swiss army knife.
the owasp project is a great resource, toolkit, community.
offensive-security has an amazing set of courses on using metaspoit. and also offer a comprehensive training of lots of pen testing topics.
and when you're ready to "go pro" there's a comptia  security+ certification.

Last edited by xero (2014-01-16 16:20:21)


▬▬ι═════════-
dotfiles http://git.io/.files

Offline

#8 2014-01-16 17:16:45

dot|not
#! Junkie
From: /dev/null
Registered: 2013-09-05
Posts: 371

Re: learning to code

No Kali Linux. Seriously. Don't. Not because I am one of those guys hating Kali or it's predecessor, Backtrack, for it's bad reputation. But because the information overload is too much for beginners. People end up focussing on the usage of tools without understanding what they are actually doing in the background of the graphical user interface. If you want to do hacking there is much more to learn than programming - something what's often combined in a wrong way - there are networking protocols you will need to get a deep understanding of in order to exploit their flaws, weaknesses and possible misconfiguration. There is systems administration you will need to learn in order to be able to see things from both sides of the tracks which will help you discover potential security holes. There is the human aspect of things, and I am not talking about the "Social Engineering" buzzword here, if you want to be a penetration tester in a professional environment you will on one side socialize a lot and on the other hand take care that you have a clean, professional approach to people. Writing proper sentences in English will help a lot for the beginning. *SCNR* Get to know your operating system intimately before even thinking of doing anything security-related.

I like to refer to this article.

Offline

#9 2014-01-16 18:39:42

samZ0rp
#! CrunchBanger
Registered: 2013-12-18
Posts: 122

Re: learning to code

i would want to use my code to make fun little programs at first. I've got an old commodore 128 in mint condition with accessories like the monitor and floppy drive. i have made a fork bomb in basic and some very simple animations but it got boring fast because it was so unsupported and delicate

im intrested in coding where i would be able to see the results
and intrested in the audreno so mabey i could learn c or mabey bash


Warning it may eat your hampster

Offline

#10 2014-01-16 19:31:24

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

Re: learning to code

samZ0rp wrote:

i would want to use my code to make fun little programs at first. I've got an old commodore 128 in mint condition with accessories like the monitor and floppy drive. i have made a fork bomb in basic and some very simple animations but it got boring fast because it was so unsupported and delicate

im intrested in coding where i would be able to see the results
and intrested in the audreno so mabey i could learn c or mabey bash

You won't be able to get away with rubbish spelling if you want to write code tongue


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

#11 2014-01-16 19:58:21

carlshark
Member
Registered: 2013-10-31
Posts: 36

Re: learning to code

You can learn Computer Science through learning a programming language, and you might just be able to adapt to other languages when the need arises. Or you can learn Computer Science including the boring math stuff.

After all, one doesn't wake up and say, "I think I'll write myself a prescription for an antibiotic and see what happens." It took me 8 years to finally be able to do that. tongue

Offline

#12 2014-01-16 20:27:04

Snap
#! Die Hard
Registered: 2013-10-22
Posts: 567

Re: learning to code

if you want to explore the command line and *nix in general : Learn Linux The Hard Way http://nixsrv.com/llthw

Starting tomorrow. Thanks!

Any recommendation about starting out with bash scripting?

Offline

#13 2014-01-16 20:57:34

Unia
#! Octo-portal-pussy
From: The Netherlands
Registered: 2010-07-17
Posts: 4,634
Website

Re: learning to code

carlshark wrote:

You can learn Computer Science through learning a programming language, and you might just be able to adapt to other languages when the need arises. Or you can learn Computer Science including the boring math stuff.

After all, one doesn't wake up and say, "I think I'll write myself a prescription for an antibiotic and see what happens." It took me 8 years to finally be able to do that. tongue

So.. if it took you eight years to write yourself an antibiotic, how is it one can learn Computer Science through learning a programming language?


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

I am a #! forum moderator. Feel free to send me a PM with any question you have!

Offline

#14 2014-01-16 23:01:56

dot|not
#! Junkie
From: /dev/null
Registered: 2013-09-05
Posts: 371

Re: learning to code

Any recommendation about starting out with bash scripting?

One simple recommendtion: Do it. Write shellscripts. Automate repetitive tasks. Even though Bash has it's pitfalls (Sysaxed can tell you tons of interesting and tricky details.) it's extremely simple to get the basics. Acquire them, start writing code.

Offline

#15 2014-01-16 23:10:56

carlshark
Member
Registered: 2013-10-31
Posts: 36

Re: learning to code

@Unia

Bad allegory from me. I don't know what I'm talking about, sorry sad

I think

You can learn one programming language, and you might just be able to adapt to other languages when the need arises. Or you can learn Computer Science including the boring math stuff.

should be the right advice.

Offline

#16 2014-01-17 03:03:40

shengchieh
#! Die Hard
Registered: 2009-01-07
Posts: 617

Re: learning to code

You're welcome to check out the links I have on

my website (signature)
-> Programming

Sheng-Chieh

Offline

#17 2014-01-17 07:37:26

dot|not
#! Junkie
From: /dev/null
Registered: 2013-09-05
Posts: 371

Re: learning to code

^ My eyes. They bleed.

Offline

#18 2014-01-17 12:15:58

spiritchaser
#! CrunchBanger
From: Temple Suspended in Void
Registered: 2013-05-14
Posts: 101

Re: learning to code

^^ such a great colourscheme <3  (time to fire up lynx smile )

Offline

#19 2014-01-17 12:25:30

samZ0rp
#! CrunchBanger
Registered: 2013-12-18
Posts: 122

Re: learning to code

I've herd of lynx for the commodore and was somewhat interested
My dad had a trs 80 that I may be getting so I was thinking about basic Linux on it or the clunker in my grandpas barrage prob a 8080 or the one after it


Warning it may eat your hampster

Offline

#20 2014-01-17 15:00:38

xero
#! Junkie
From: 0x000000
Registered: 2013-09-30
Posts: 382
Website

Re: learning to code

comment retracted.

*drinks more caffeine, and feels less flamey*

Last edited by xero (2014-01-17 15:08:36)


▬▬ι═════════-
dotfiles http://git.io/.files

Offline

#21 2014-01-28 12:56:07

samZ0rp
#! CrunchBanger
Registered: 2013-12-18
Posts: 122

Re: learning to code

Well I am taking the grade ten computer studies and programihg course. I'm thinking I will not use basic for the projects if needed because I have the commodore to do that.


Warning it may eat your hampster

Offline

#22 2014-01-28 13:13:15

retf
#! CrunchBanger
From: On top of spaghetti
Registered: 2013-12-25
Posts: 200

Re: learning to code

@samZ0rp:
Awesome!
Keep up the good work!
When I was in 10th grade - I was too distracted with other things to really apply myself as I should have.
I would follow the teacher's lead in choosing a language for the projects.  However, I've always liked programming in BASIC.  Although, it's becoming harder to find a good BASIC interpreter.

Offline

#23 2014-01-28 13:23:38

hinto
#! Windbag
From: Cary, NC
Registered: 2010-12-08
Posts: 1,487

Re: learning to code

I learned to code in BASIC by solving systems of equations using determinants (matrix algebra) on a TIMEX Sinclair back in '82. (9th grade)
The key is finding a problem that interests you, then pick a language to solve it in.
-Hinto


"Sometimes I wish I hadn't taken the red pill" -Me

Offline

#24 2014-04-06 13:56:12

samZ0rp
#! CrunchBanger
Registered: 2013-12-18
Posts: 122

Re: learning to code

school uses Microsoft so ive done in scratch (not my prefrences and not useful for what i want)
than the class took apart computers so i managed to swpie a few windows codes from the ones the bad kids took apart ( motherboard was mangeled) and made a gaming pc from the spare parts
now im learning in microsoft visual basic express 2010 (eww) im hoping we move on to python soon)


Warning it may eat your hampster

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo