#programming
1 messages · Page 19 of 1
I need a little help with qt5. Somehow it produces this error and doesnt open. Ive read sth about local variables not being set correctly but dont know what to do with that. Ive tried reinstalling qt5 but that didnt fix it. Any idea on how to get it working again?
yeah sure. Thats where I found out about the local Variables but that didnt really help me because I dont know what it is and what it has to do with qt5.
What does the qt5ct supposed to do?
Ah the configuration
yeah
What is your OS?
I want to use dolphin file manager on arch with gnome desktop
But dolphin is a KDE package and doesnt accept the system default theme of gnome, which is why I wanted to use qt5 to change that
dont have that
Okay I'm reading from this
Any of these solutions working for you?
nope :/ but I also dont have the qt5ct.conf the guy is talking about. Maybe thats it.
Maybe it is
If that doesn't run you could try with different qt versions and see if it's that
Good idea. Ill try that and come back here if it doesnt work, thanks!
I installed qt6ct and it works just fine :)
Aye! 🙂
ye
no, i used a common password
It would be great if someone can help me
I'm kinda new to coding
I'm like making a "bot thingy"
I'm using selenium to automate the process of: going into the url -> doing stuff
But the url requires a token id
like this lmao.com/?token=123
So I have a list of some token id (which I create a new account to get those)
put it in a json file
and put these 2 lines of code
nah wait i think im figuring it out
lol
@dusty ore JohnLmao how much old are you
ah umm im 16
javascript huh
yes ofcourse
using a browser extension
im kinda stupid
hmm thats a nice suggestion, thanks
but i guess ill still stick to python as im studying it
its a good practice tho
may be
an chrome extension is easy to do and its javsacript 100%
and you can upload script in chrome market
and use it anywhere
oh ye
but this is a temporary project
Like it will be very useful but it will be useless after a month
so you can use imacros if its easy task to do
thanks, ill have a look about it
but there
this is asking for path to .json
json is key value file
{key:value}
i dont know what are you doing, if you show me more code may can help more
great
if you need help let me know
also i can do a chorme extenson fast for you
i have template ready to do so
yes, its very easy jhon!
@cursive orchid I know the issue with your JS script
(If you still need help that is)
anyone who could help me out with the csv module in python?
Just ask
well i have a file open, witch im hashing the passwords in, that woorks well when printing to the terminal.
not so good when im trying to write them to a new file
Can you provide the code
yess sir
so the testpw has some passwords i want to hash to make a rainbowtable. and the rainbow.csv is where i want to store them
your row seems to be out of scope
unless I'm missing something
salt too
why are you salting a rainbow table though?
no reason, used that for another script so just pasted over until i get this to woork
how is it out of scope? for row in "file", what else could i do?
not what I'm seeing
with open("testpw.csv") as passwords:
for row in passwords:
salt_sha512 = crypt.crypt(row, crypt.mksalt(crypt.METHOD_SHA512))
with open('rainbow.csv', 'w', newline='') as rainbow:
fieldnames = ['password', 'hash']
writer = csv.DictWriter(rainbow, fieldnames=fieldnames)
writer.writeheader()
writer.writerow(f'password: {row}, hash: {salt_sha512}')
this is what I see
ooh so you would do "for row in testow.csv"?
just saying that in the rainbow block, row no longer exists
makes sence its outside the block, but ive tryed with it inside to, im doing somthing wierd..
might want to transfer to an intermediate dictionary
makes sence, ill try:)
you are trying to implicitly scope row to global, when it is a transient object
Have a good self-study problem I'm stuck on. Need to generate list of passwords. I'm given 3 separate lists. 4th list is user-generated and varying length depending on cmdline arg. The main problem is this, each password must consist of only ONE element from each list - meaning I will need to generate every possible permutation within these constraints. Itertools is doing the heavy work here but its still confusing as heck.
my code so far and problem prompt are at https://github.com/Droogy/programming-training/blob/main/Problem1/
would def appreciate any guidance!
did not get it to woork.. ill try again tomorow, thnx for the help anyway
well thnx @sharp coral you had the answer to my question in your code XD.
haha glad I could help somehow!
I'd just do four nested loops...
thank you I'll give that a try
I think I have a working version of your problem Droogy so ping me if you need a little nudge and I'll assist :)
will do! appreciate you taking a look
that'll work
unless order needs to be taken into account as well
Depends what you mean by order
lists can be in any order
Because it will be in order, in the order of the list
ie 1, 2, 3, 4 or 4, 3, 2, 1
or 2, 4, 3, 1 (for example)
so there'll be more than 4 loops nested
thats correct hydra, i need all permutations like that so
1234
1243
...
4321
thats my expected output
yeah so there's 4! permutations, assuming I'm not forgetting my combinatorics
gah Im right back where I started with the 4 nested loops vs. itertools
this is a fun question, I might steal it as a kata
that was what i got, hydra n * m * o * p * 24 unique orderings
so yeah a good chunk
it is a fun one, a friends mom forwarded me this, shes an IT exec and said one of her engineers made this question for new hires
Guys, I'm taking a cybersecurity course from ine.com, and in the second module they ask for do a simple exploitation writing a program with c++, and is recommended to use a dirent c++ library and winsock, because the goal is steal the directory info from the lab.
So, my question is in the fact that, I'm doing it, through a lot of read in internet and I have some knowledge in programming because I'm a front-end developer, but the thing is that I don't feel satisfied just being able to do and many things seem so obscure in C++, but when i tried to understand some pieces they grow into bigger ones, and it seems very hard to get all concepts at once.
I would like to know if in your study you were studying every little thing, like networks, tools, programming simultaneously or if you specialized first, like low level programming and then to the next step.
Sorry for my english.
if its for eJPT, I wrote that module in Python, try and adapt new things to your existing skillset and throw away things that don't fit
theres a lot of foundational topics you should understand to break into IT in general, and a further subset of those foundations is necessary for infosec
but don't try to do all the things at once, networking is a great place to start learning imo
I think i understood, about networking i'm studying a lot, but my concern was to not have a deep knowledge in low level programming and this will end up impacting me in the following studies, but your tip, about focus in my existing skillset will be very useful, thanks.
no, low-level programming is good to have a general understanding of, but is generally a pretty niche skillset in infosec usually reserved for malware analysts/reverse-engineers
Oh, right.
Thank you again!
“Automate the boring stuff with Python” is free for a limited time!
One of the highest rated Python courses is free for a limited time.
If it’s not automatically applied, use code FEB2021FREE
It's actually free online forever via the author's website.
https://stackoverflow.com/questions/66006974/how-to-delete-the-history-of-a-git-commit
It would be great if somebody can provide an answer to this question. Thank You.
This is not the solution I'm looking for. Doing this will remove my entire git history. I just want to remove history of a single commit. I've searched a lot but this is the solution I found in all the search results.
You cannot ask how to do something with a very vague request and expect me to know what you want.
I have explained my problem in the question I posted on stack overflow and also mentioned in the body that I want to remove the history of a specific commit.
And I linked you plenty of resources, if you aren't going to read the ones I linked then don't complain.
I'm not complaining. I just explained myself. I am reading all the resources you provided one by one. I just replied to the first one among them.
I read all of them...same thing. Not what I'm looking for
You asked how to remove a commit from the history
I asked "How to remove history of a specific commit”
32
I already removed a commit, now i want to remove the information Stored about it in the history.
Googling the problem results into the same solutions which you provided. That's the very reason I asked here and posted it on stack overflow.
Heya! So I was hoping someone could give me some ideas of how I can get this to properly spit out into clipboard. I started practicing python a solid hour ago after not having touched it since middle school.
Phone_Number = input("Enter five digits for PhoneNumber: ")
First_Name = input("Enter a first name: ")
Last_Name = input("Enter a last name: ")
DOB = input("Enter a date of birth. Year-Day-Month Ex;1996-07-13: ")
Result = "/me hands over their ID\n^*^4 [ID]^r: TID #: ^2"+Player_ID+"^r SSN #: ^2 "+Phone_Number+" ^r | First: ^2"+First_Name+" ^0/ Last: ^2 "+Last_Name+" ^0| DOB: ^2 "+DOB+" ^0|_"
import pyperclip
myStr = Result
pyperclip.copy{myStr}```
It's a program made for a GTA RP server I used to play on. It's what I like to use instead of hello world.
So what is your end goal exactly?
/me hands over their ID ^*^4 [ID]^r: TID #: ^2123^r SSN #: ^2 12345 ^r | First: ^2abc ^0/ Last: ^2 def ^0| DOB: ^2 1996-07-13 ^0|_
Seems to work fine
The only thing I changed was:
import pyperclip
pyperclip.copy(Result)
Honestly everything so far seems to work out. Everything from Player_ID to DOB should be user input. I am just not understanding why I can't get it to clipboa-...
Mhhm, all you had was a syntax error.
Usually when calling functions you use (arguement), as opposed to {arguement}
Might need to restart some stuff. As I'm still running into an error.
Here's the whole program with changes:
Player_ID = input("Enter Server ID: ")
Phone_Number = input("Enter five digits for PhoneNumber: ")
First_Name = input("Enter a first name: ")
Last_Name = input("Enter a last name: ")
DOB = input("Enter a date of birth. Year-Day-Month Ex;1996-07-13: ")
Result = "/me hands over their ID\n^*^4 [ID]^r: TID #: ^2"+Player_ID+"^r SSN #: ^2 "+Phone_Number+" ^r | First: ^2"+First_Name+" ^0/ Last: ^2 "+Last_Name+" ^0| DOB: ^2 "+DOB+" ^0|_"
import pyperclip
pyperclip.copy(Result)
As you can see I only changed the bottom, I may add defining the variable myStr to store the value of Result seems entirely pointless in this program
What error is occurring for you?
I did add a pointless string... Seems PyCharm refuses to believe I have Pyperclip setup.
Ah, I do not use PyCharm. I am using the default Python shell.
I'll work this out, Though I appreciate your help and thank you for noting the useless string. Much I still need to get a grasp on.
Mhm, no problem
Hm?
Nothing
Ok...
I think I found what I did wrong, now I just need to figure out how to resolve it... Say just to make sure I was the big dum... Would me throwing in the pip for pyperclip while it's still in a temp\Rar folder be the reason I am now getting a fileNotFound error?
Does it specify which file is not found?
src/pyperclip/__ init __.py
Not sure how PyCharm works, if it has a console/ package manager try installing pyperclip through there, if not manually copy and paste the pyperclip files to the directory requested. (Be sure not to delete the original files just in-case)
the only good thing about pycharm is its debugging
We gottem boys! I'll be honest. I just close the entire enviroment out and started anew with the same code. Works fine now after dropping pyperclip back in.
👍
PyCharm likes to set up a venv specifically for the project. Ensure that your requirements.txt stuff is installed into the proper place
in theory, you don't, that's the whole point of git. In practice, I think there are ways to poke at the reflog
https://docs.github.com/en/github/authenticating-to-github/removing-sensitive-data-from-a-repository this may help, @wispy tusk
If you commit sensitive data, such as a password or SSH key into a Git repository, you can remove it from the history. To entirely remove unwanted files from a repository's history you can use either the git filter-branch command or the BFG Repo-Cleaner open source tool.
the BFG might work
but because commit history is a graph, removing one single commit will completely break the graph
The problem is I don't have any file to remove. This is a guide which tells how to totally purge a file including its history but I have already removed the file. I just need to clear the history of that deleted file
the file is probably still there then
git doesn't work that way though, it doesn't know about files
I have deleted the commit using interactive rebase. It is a safe method.
ok then what's the problem?
I have checked, It dosen't show up in the git log
interactive rebase rewrites the history
you'll probably need to force push the changes
Yup so i can use it to rewrite the history and exclude a specific commit in the history while rewriting it..thats the trick
Ya I did..my origin master and local master are on same level
so what's the problem?
you rewrote the history, the original commit no longer exists
we're good, no?
'ab472' This is the hash of the commit I removed. It doesn't show up in git log anymore. But when I use git show ab472, it shows all the detals of that commit
https://github.com/7Ragnarok7/DEDMAP The remote repo. It is in par with my local repo. You can have a look
No, I'm not sure what It does.
Oh so it cleans up the repo..okay...just did it.
Still the commit is being shown while using git show
try git reflog expire --expire=now --all && git gc --prune=now --aggressive
(from the BFG homepage https://rtyley.github.io/bfg-repo-cleaner/)
No effect at all, still shows up.
normally what happens in git stays in git. Is there a reason why this commit needs to disappear?
It is a commit committed by some other person with the username shubhayu-64. I have removed the commit but the contributor's name is still being shown in the contributor's section. That's strange.
Yes that is the reason I am trying to remove that specific commit and its history. When I started the project I had least idea about git and github and I added lots of people as contributors rather than following the gitflow, which created a big mess.
seems you may have to nuke and pave, though there appears to be a -mirror option
git is made to keep history as robustly as possible
I successfully removed the commit and now The readme file which that other user commited on is now showing only 1 contributor i.e. me, but in the remote repo the name of the contributor is still being shown even though presently there is not commits in the repo by that user.
git push --mirror --force ?
This is an obvious option but doing this will remove all the history of all the commits
yeah
Not working...
Anyways thanks for your help @brazen eagle 🙂
nuke and pave then, probably, sorry
What did you do to fix?
it's because i was mutating the array directly without making a copy of it first
it was something like
oldCells = [...oldCells];
if () {}
else {}
return [...oldCells];
had to add that top line
i don't fully understand why that works, but i was told i can't mutate the array and then return the copied value or smth
The reason for the if and else statement both running was simply because it was checking a value which was null
i was checking if it wasn't null though in the if
Mhhm, I asked my brother and he told me how to change the program to make it work but I can't remember 😄
ah arrays are by ref yeah
How would you test a web-crawler against live websites / IPs?
I'm thinking:
- pytest-mock the API calls locally so local test times are decreased
- test against live APIs in CI as part of integration testing, and CI can run much longer than pytest can on a small devs laptop etc
- Test against external websites (?) such as those not controlled by the organisation to see if it can hold up (but mark those tests as can-fail, so if they do fail because of an external website going down CI isn't down)
That last point is kinda ??? for me as I'm not sure on best practices 🙂
This is 100% a homework question but I just wanted to triple check with people who are in industry, as well uni didn't teach me these things hahahah
maybe use an existing spider such as that used on ZAP and compare to your results?
or manually trawl through the site to see what you find?
this is for an enterprise production environment™️ not something I'm doing, it's just bringing up points of what should the testing look like 😄
I'd have a known good and compare against that
also go annoy the site devs
😄
but external sites are always iffy to test against,
integration tests need to be on live, but controllable data
Is it too much if I say "deploy a website with cyclic links, broken links, etc on an EC2 instance in a different region"?
cause we can control that I think, we can deploy it with CI whenever we want and we don't rely on someone elses site
Not locally as we want to test latency, network connections between the server and the real world etc
hey i think im actually pretty good at this hahahaha
sure, different regions are always good
it would cost money, but if its essential for the business it's the best we can do I think
have a few links to example.com in the test site
or google
or other big sites that don't change much
import scrapy
class spider1(scrapy.Spider):
name = ‘Wikipedia’
start_urls = [‘https://en.wikipedia.org/wiki/Nikola_Tesla’]
def parse(self, response):
pass
just wrote this for you run it in CLI maybe it gives you some ideas
While it shouldn't happen - have a plan B for your spidering to crater the webserver. Especially if it's a seldom-used intranet server
does anyone know pyautogui here
or how to use it
if so can u tell me if pyautogui have some kind of key detecter
like
if it can see if ur holding down right clicke
What are you trying to do with it? @lilac holly
oh sorry
tryna make this stupid keystroke thing
if its even possible in python
?
Stupid keystroke thing?
You mean a keylogger?
whats that
What are you trying to accomplish? Describe it.
ok have u heard of minecraft keystrokes
if u press w it highlights w
press a it highlights a
well i was bored so i was like hey why not make a keystroke but like just a fun program
You want a GUI that highlights the key you press?
You can but Python probably is not the best for that.
Well it is possible quite easily
yeah
Just use the keyboard module
It has a function to check what key is pressed
if it cant, ill just use pyautogui to check
well tysm
this module will defo help me alot
im also trying to practice pyqt
👍
ok bye
Bye
hello
hi
Anyone good enough to help me with a issue with JS ? Don't hesitate do DM me, I could send it here, but I don't know if I'm allowed lol
If you're not allowed to send it here, there is a chance you're not meant to be discussing it at all.
Why don't you think you're allowed? @pulsar sierra
Oh lol that's not what I meant, I just didn't know if it's the right channel ^^
☝️
If it's programming, it is allowed. Ask away.
Alright
So I have this code
function getApiResult(url, data) {
fetch(url).then(
response => {
return response.json();
}
).then(result => {
for (var i in result.results) {
data.push(result.results[i])
}
if (result.next == null) {
return;
} else {
getApiResult(result.next, data);
}
})
}
let data = [];
getApiResult("http://localhost:8000/api/v1/titles/?sort_by=imdb_score&imdb_score_min=9", data);
console.log(data);
console.log(data[0]);
But when I execute it, I get this in my console :
[]
undefined
While testing, I understand that when the console.log(data) at the end is not fully loaded (waiting for the fetch to finish) ...
I don't get how can I exploit data, only when it's finished :/
PS : I already tried to put it in an async function and make await GetApiResult("...", data) instead of what I have right now
(As long as it follows the rules of the server and laws)
Of course :)
ah promises
D: yeah
you won't get your data back immediately
but the code will continue as if it did
await should work though
though I don't know how the recursion will work with promises
getApiResult("http://localhost:8000/api/v1/titles/?sort_by=imdb_score&imdb_score_min=9", data);
you need to set a value for data in order to properly enter the function
For example: let data = [1];
No prob, have a good one
Are you a polyglot? How many #programminglanguages are you good at? Take the new #developersurvey and share your #coding skills for a chance to win new gear! #Javascript #java #Python #Csharp #PHP #Kotlin #Swift #Lua
<div class="modal fade" id="login" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4>Login</h4>
</div>
<div class="modal-body">
<form id="myForm" method="post" action="authenticate.php">
<div class="input-line">
<input id="email" type="email" name="email" required
placeholder="E-mail" class="input-name">
<input id="password" type="password" name="password"
required placeholder="Password" class="input-name">
<button type="button" id="submit" value="submit"
form="myForm">Submit</button>
</form>
</div>
</div>
</div>
</div>
<form action="authenticate.php" method="post" target="_blank">
<label for="email">Email:</label>
<input type="email" id="email" name="email"><br><br>
<label for="password">Password</label>
<input type="text" id="password" name="password"><br><br>
<button type="submit" value="Submit">Submit</button>
</form>
The one outside the modal is submitting, the one inside the modal is not.. How come?
I'd like to say it's because your indentation isn't consistent, but that's not the reason 
I will apologize for that in advanced, I know it's brutal but this is quick and dirty.
you can add highlighting to the code with \``` html
minus one ` I really have to look up the escapes
I will do that in a moment.
<button type="button" id ="submit" value="submit" form="myForm" formmethod="post">Submit</button>
That was six backslashes. More escapes than an open air prison. Aaaaaaa.
that's different
yeah but I tried to enclose in a ` ` block
which makes the parser derp out
<form id="myForm" method="post" action="authenticate.php">
<div class="input-line">
<input id="email" type="email" name="email" required
placeholder="E-mail" class="input-name">
<input id="password" type="password" name="password"
required placeholder="Password" class="input-name">
<button type="button" id="submit" value="submit"
form="myForm">Submit</button>
</form>
</div>
the divs are off
at least closing tags
oops, i changed that previously.
dunno if the form attribute is strictly necessary on the submit button
I ain't sleeping until I get this whole thing working so it's gonna be a lateeeeeee night for me
nah, that was a test thing as well
shouldn't the form have a name attribute for that to work?
possibly, I'll give it one and test
negative
if anyone comes up with a possible solution, can they @ me please.
copy pasting the form outside the model inside seems to work
@brazen eagle What do you mean? its 1:24AM here, I'm gonna be a little slow.
<div class="modal fade" id="login" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4>Login</h4>
</div>
<div class="modal-body">
<form action="authenticate.php" method="post">
<div class="input-line">
<input type="email" id="email" placeholder="E-Mail" name="email">
<input type="password" id="password" placeholder="Password" name="password">
<button type="submit" value="Submit">Submit</button>
</div>
</form>
</div>
</div>
</div>
ohh
forms are wierd sometimes
sec, work
no problem
ok what's up?
Has anyone ever gotten WPA2 handshakes to be properly captured in Scapy?
I've written a function in python, which loops through the wiki streams API, giving me events as they happen.
I'm processing the events and collecting data.
I want to print the processed data at one minute intervals. What would be a simple solution to maintain a timer parallelly?
I googled and started reading up on asyncio but got a little lost. xD
import time
you can use time.sleep(seconds you want)
I don't need to pause the code
Let's say I get one event every 11 seconds in the loop I'm processing.
In 55 seconds, I'll have five events...
In 66 seconds, I'll have six events....
When 60 seconds of computation has been done, I need to print the results and continue processing for the next minute
i understand that you want to run event in background after that print the data
am i right? btw sorry my english is little bad
Check this out
https://wikitech.wikimedia.org/wiki/Event_Platform/EventStreams#Python
See that for loop? I don't have control over how often an item arrives there
ok
you're looking for a producer-consumer relationship, each on separate timers
effectively, your consumer is looking at a queue being fed by the producer - once a minute, check the queue. if nothing is there, go back to sleep.
I'll search this up
Thanks
if you dont' understand how python multiprocessing libs work, feel free to follow up
I don't, not yet at least. I've just started reading up on them.
Any good starting points which aren't hugely in depth?
the python docs are pretty good - caveat there is i already had an understanding of POSIX threads, so the python stuff is super simple in comparison
pretty good intro in java: https://www.toptal.com/software/introduction-to-concurrent-programming
Concurrency allows programs to deal with a lot of tasks at once. But writing concurrent programs isn't a particularly easy feat. Dealing with constructs such as threads and locks and avoiding issues like race conditions and deadlocks can be quite cumbersome, making concurrent programs difficult to write.
In this ...
@hazy breach i didn't get ur question completely but, threading module might help. threading.timer or something. Set timer of 60s
Thank you @magic falcon and @remote echo
You can use threading library
Thanks @sonic root, I'll check it out
anyone here familiar with syscalls?
got a question about virtualprotect vs ntprotectvirtualmemory
@clear needle
I have an API that users (probably malicious) will use. I can either:
- Have them write to an S3 bucket their input, a program will check their input and then commit to database if valid (and not malicious). Delete the S3 items.
- Have them write to the database, perform a query to find all unchecked items and then calculate if malicious / valid input. If it is, tick a box and put it into S3.
Which one is better? I'm also storing a manual backup in S3 (hence why it puts it there in the 2nd point). Should I go #1 and stop the manual store?
you can rate-limit the API
but for validating, that seems overly complex
why not pass it through a validation function which forwards it to the api if it's clean?
or is said input a file?
We have to compute the validation, I.E. Run a calculation for ~2 seconds
feels odd, but without knowing anything about the input or the api it's hard to say
sorry
Sure, the input is a hash : plaintext: type, the validation is validating that hash(plaintext, type) == plaintext. This is expensive and takes around 1 - 2 seconds depending on the type 😅
ah ok
I think letting them build up and validating all in one go, say once per day or so is cheaper than validating on the fly
hash(plaintext, type) == hash no?
especially with a Lambda function haha
you are right, i am stupid
I think writing to the DB is fine, I can rate-limit to 1mb / day as 1mb is fine ? 😄
1mb is pretty huge
API gateway limits all requests to 10mb, whereas S3 would be unlimited lol
exactlyyy
can you rate limit to n/s to avoid DDOS
yeeee its limited to 1/s, the DB only supports 5/s anyway 😛
right
so caching results for a day and processing as a batch seems alright, so long as there is no expectation that the input is queryable immediately
you can always batch at a shorter interval
its probably better if i write a short lambda func to check how many unverified things are in the DB and if it reaches a threshold, run another lambda func? that way its not determined by time but by usage 😄
maybe
and that shorter one can run a lot more since it'll only exist for a few ms
ah wait, i can just do that check in the main lambda func anyway -- so if there is stuff to add, add it else exit?
might save the spinup time
so... I had an idea for a program that could upload a reverse shell payload to the server, but then realized that I'd probably need a reverse shell already to use it...so that's dumb
maybe a thing to setup a webserver and startup a socat listener
ask the question? 🙂 https://www.nohello.com/2013/01/please-dont-say-just-hello-in-chat.html
Please Don't Say Just Hello In Chat 2010-07-19 12:32:12 you: Hi 2010-07-19 12:32:15 co-worker: Hello. ## CO-WORKER WAITS WHILE YOU PHRA...
Short answer: don't use SQLite
That's fair. I've never had a positive experience using it; eventually every app I've worked on migrates to using a more robust database and it causes many problems
What's the usecase? And what's the problem you are getting?
There are backend problems - sometimes strings don't convert correctly
Honestly, best use for SQLite I've seen so far is CherryTree
Kratos, what's the issue you are running into? I'm more familiar with Postgres and MySQL, but I've also used SQLite several times
did you enable foreign key constraints?
const { Console } = require('console');
const express = require('express');
const app = express();
app.set('port', process.env.PORT || 3000);
app.listen(port, () => {
Console.log(Listening on port ${port});
})
when asking for programming help, remember to let us know what's happening vs what you expect to happen
include errors etc
im making a auth
errors Error: Cannot find module 'express'
Require stack:
- C:\Users\Administrator\Desktop\Auth2\app.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
at Function.Module._load (node:internal/modules/cjs/loader:769:27)
at Module.require (node:internal/modules/cjs/loader:997:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object.<anonymous> (C:\Users\Administrator\Desktop\Auth2\app.js:2:17)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
at Module.load (node:internal/modules/cjs/loader:973:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ 'C:\Users\Administrator\Desktop\Auth2\app.js' ]
}
thats the errors
i want it to say Listening on port ${port}
as you can see
okay well that error means that express is not installed
ok cool
you need to install via whatever package manager you are using (probably npm i express)
no wait i might fix it
const { Console } = require('console');
const express = require('express');
const app = express();
app.set('port', process.env.PORT || 3000); // This line is the problem
app.listen(port, () => {
Console.log(Listening on port ${port});
})
also, that's not how you want to be setting the variable for port
ok
also i have no idea what that Console module is
a typical basic express app looks like this
const express = require('express');
const app = express();
const PORT = 3000;
app.listen(PORT, () => {
console.log(`Listening on port ${PORT}`);
})
you are bringing in a module called console, i suggest reviewing some javascript/node basics before jumping into creating express apps
im making it for a app someone asked me to make a auth for it
You agreed to hammer down some nails without knowing how to use the hammer :)) You should do some nodejs and/or JavaScript specific materials. There are lots of free resources on YouTube, or if you're okay to spend some money, there's a Nodejs course on Udemy by Andrew Mead that is great
can someone explain this to me?
i got stuck on this code earlier, still havent completely figured it out
the '../..' part specially
i really cant understand
@lilac holly No.
That is from a room
No hints until tomorrow @ 7pm.
(as per rule 13)
can someone explain in private then? i already completed the room but i didnt understand this code completely
the filters
got me a bit confused
But writeups are already out i guess🤔
Are they?
Yeah
@pearl zephyr u can dm me if u want, pls 🙂
Also @lilac holly its strange how u completed the room without understanding how filters work
I'm still not sure of the rules here.
I will explain here only
@pearl zephyr i already tried the ../.. thing but it didnt work
so i didnt really need to see this code to know
but when i saw it i thought it was a bit confusing
@true pumice i guess its fine to explain the code if writeups are available🤔
I think you should explain it in #room-help
What room were you working on?
none
That's not a lot. 😄
“Intro to python” room has been removed?
Wydm?
The python room
No no, this is a different issue about programming sqlite
For some reason I can't get my table to have foreign keys
You can always do the python stuff in AoC 2?
Hi, I have managed to capture some Dot11Auth and EAPOL frames using sniff in scapy. I do not capture all of the frames, normally I get frames 2 and 4 of the EAPOL key frames, is there a way I can capture more. I understand scapy sniff can be a little slow to capture frames and packets
I was thinking an lfilter would be faster than checking the frames in the prn function, but I dont know myself
def parse_packets(packet, output):
if packet.haslayer(Dot11Auth) or packet.haslayer(EAPOL):
print("Saving frame")
wrpcap(output, packet, append=True)
...snip...
sniff(filter="", prn=lambda p: parse_packets(p, outpath), store=0, iface='wlan0mon')
guys i have a problem and idk what it is
ok then we cant help much sorry 😦
Hello guys , is there someone who is experienced with IDS systems and detection of web app attacks ?
im not terribly experienced but I do have a working IDS/IPS set-up for my homelab, what is your question?
which IDS system are you using ? i am wondering what approach should i use in order to detect for example XSS attack on my web app
maybe some kind of anomaly detection or ?
i've used an ELK stack, suricata, snort and splunk - splunk will be the easiest to get up and running
filter a search for access logs on the web server, probably filtering for POST requests - manually enumerate your webapp and look for likely vectors of attack and filter those points
then set up an alert in splunk for requests on that endpoint
suricata's eve logs are good for anomaly based detection too, can also be indexed by splunk
A "normal" build of SQLite doesn't support foreign key references. To make it work, you need to either re-compile your SQLite engine, or else download a version that has it enabled
Usually protection against that is done by a load balancer, WAF, or by the application itself
the thing is , i am building my own IDS from scratch. and i am trying to find some interesting approach to detecting theese web attack
detection not prevention juun
Droogy's solution is less what I would think of as being IDS and more being log analysis - my understanding of IDS is that its usually done in real time on layer 3
Firewall mfg (fortinet, ubiquity, cisco) all offer IDS options for their pricier appliances
well tbf there is no intrusion detection without logs to analyze
don't try and reinvent the wheel and build your own IDS, I mean i guess I would start with building some sort of front-end or even basic cgi-script that will essentially tail -f access.log
I was using sqlite with python3 and just importing it
Its my bachelors thesis project 😄 what am i doing now is that i take the HTTP request and look for some suspicious input using REGEX but its obviously not enough
SQLite from where? are you doing this on windows or linux? i'm going to try to recreate your problem
so my question is , what is probabbly the best posible way to analyze theese logs
gotcha, this would be a good place to start, suricata rules contains malicious signatures, there are thousands upon thousands of these rules, you can incorporate the attack signatures into your own db and figure out an interesting way of indexing them maybe https://github.com/jpalanco/alienvault-ossim/blob/master/suricata-rules-default-open/rules/1.3.1/emerging.rules/emerging-web_client.rules
I haven't heard "the experts" use IDS in terms of a SIEM - happy to admit i'm pretty ignorant on SIEM terminology; i have heard networking people talk a LOT about IDS/IPS being done on their appliances. learning new things day by day
so basicly .. its all just regex with some extra steps ?
ahh okay yeah I hear ya, there is definitely a lot of blending between the terminology, they both work best when used together but a SIEM is the aggregate of all alerting and events, an IDS is just a little piece of the entire security posture
yup! hard to think of a better way when it comes to web-apps to filter for malicious activity than good ol regex
if it's for a thesis, you also may want to look into setting up a honeypot web-app on a VPS for some live data
yeah i am using DVWA for that purpose
i allready have some SQLi regex rules but i think its really easy to bypass them
for example if u try to catch ' order by 1 --
ahh having DVWA connected to the internet sounds like a really fun project 😄
u can still do ' or/asd/der by 1 --
gotcha, you can still use regex in that case to look for mutations and edge cases, thats why suricata is so damn good
i mean not on the internet 😄 its just my virtual network
do you have some reference please ?
ofc, i hate to be that guy but their documentation is actually rather good https://suricata.readthedocs.io/en/suricata-6.0.1/quickstart.html
its okay thanks 🙂 , and the bigest problem i am facing rn is that u can run XSS with every fcking html element according to this https://portswigger.net/web-security/cross-site-scripting/cheat-sheet
that will be a lot of work to create regex rules to catch everything
thats why i came here 😄
if you're focusing on XSS you might want to scrap DVWA and just build something custom specifically vulnerable to XSS and just hammer it
If its for school, your dept may have budget to help you out with buying some tools or hardware
i will probably take some inspiration from Suricata IDS
i just tought i was thinking wrong by using regex for this
anyways thank guys 🙂
i did this on windows; i can dm you what i coded?
Anyone have tried PTS preliminary programming
I'd rather you tell me what versions and the sourcing of your SQLite and python, first - code from earlier looked correct, and code won't matter if the db isn't enabled for what you want
Have you tried
preliminary programming from INE
I don't know what that is.
Ok
is that a bootcamp?
Hey @grave salmon , What are your thoughts algoexpert.io?
Is this is a good resource to learn programming?
🤷♂️ not familiar
Are you self taught or go to school?
semi-both.. taught myself a bunch but I did have classes on java, data structures and algorithms, python, javascript etc in uni
Niice, thanks for the insight my guy
I uuhhh
It's alright
he explains it poorly
That tech with Tim guy ?
What's the best and effective way to learn programming in your opinion? @stone kayak
make stuff
^^^ This. Pick a project, figure out how to solve all the problems for it
Codewars any good?
what is the new technics in java for gaining files write's privilege in android?
android.provider.Settings.System.putString is deprecated now
i don't know how to use WifiManager
Why does this AWS API Model take empty string & no list?
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "lookup",
"type": "object",
"properties": {
"Hash": {
"type": ["string"]
}
},
"required": ["Hash"]
}
I don't want it to accept when:
- String is empty
- Hash's value is not a list.
Currently this works (I don't want this to work as it's an empty string):
{"Hash": ""}
These 2 do not work:
{"Hash": []}{"Hash": 6}
Why does it execute on empty string which isn't in a list, but empty list doesn't execute?
How do I make it so it only works if the input is {Hash: ["Hello"]} and not empty string or a single string?
Thanks for any help you can provide 🙂
@sly breach 🥺 if you do AWS API stuff do you know? ❤️
Can you link to the docs?
Only CLI 
How much programming would I need to know in order to land a decent job ?
hey bro you are solving room
job as a what
Software engineer or developer
you'll ideally want to know the language the job requires inside out
An empty string is still a string and matches the schema?
no its my own project
https://tools.ietf.org/html/draft-zyp-json-schema-04
https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-method-request-validation.html
https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-override-request-response-parameters.html
Learn how to enable request validation on methods for API Gateway. You can validate a request body by specifying a model schema or by verifying that required request parameters are valid and non-null.
Learn how to override a an API's request and response parameters and status codes.
Is there a way I can not do that? :))
Lol
{"Hash": ["Hello", "yes"]}``` fails too
I'll have to look up JSON schemas
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "InputModel",
"type": "object",
"required" : ["name"],
"properties": {
"name": { "type": "string" },
}
}```
try this^
🤔
Would be nice if AWS told you what that meant lol
i was playing around with aws and it worked tho
lemme try some json validators
ahhh
the comma
"name": { "type": "string" }, remove comma and it works
does it do what u need tho?
I got it I think
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Hash",
"type": "object",
"properties": {
"Hash": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1,
"uniqueItems": true
}
},
"required": [ "Hash"]
}```
that moment when you are sick of renaming files, that you make a python script that renames files for you xD
that looks ok
howdy yall anybody here knowledgeable with .c files help me out does the .c file need some sort of exit command at the end of the file what tells the compiled binary to stop and exit ?
the program will exit once it returns from main (or exit(int) is called)
hey all, about a week ago I had a good kata-like problem, just wanted to share my solution, would def appreciate some input as I may adapt this program into some crunch-like utility
Prompt:
I forgot a WinRAR-archive password. I remember there was a name of someone from my (hypothetical) family: jake, melissa, oliver, emily.
I remember there was a year of birth of someone from my family: 1987, 1954, 1963.
I remember there was a symbol:
["!","@","#","$","%","&","*","-","=","_","+",".",","]
But I do not remember an order of these elements.
You have to find a list of all possible passwords, based on this information.Addendum: You must also create some way that the user can create a custom list.
import itertools
names = ['jake', 'melissa', 'oliver', 'emily']
years = ['1987', '1954', '1963']
symbols = ['!','@','#','$','%','&','*','-','=','_','+','.',',']
all_lists = [a, names, symbols, years]
# user input list
a = []
# check if we have cmd line args
if len(sys.argv) > 1:
# check that custom(-c) flag is set
if sys.argv[1] == '-c':
# size of list is 2nd cmd line arg
list_size = int(sys.argv[2])
for i in range(list_size):
element = input('add to list: ')
a.append(element)
else:
pass
master_pass = []
# permy does all the heavy lifting
def permy(single):
# itertools magic to iterate over combinations
list_iterator = list(itertools.product(*single))
# join together tuple elements to form a password
final_list = [''.join(tups) for tups in list_iterator]
# add each password to a master list
for i in final_list:
master_pass.append(i)
res = itertools.permutations(all_lists)
for x in res:
permy(x)
with open('all_passwords.txt', 'w') as x:
for password in master_pass:
x.write(f'{password}\n')
# debug master list
#for i in master_pass:
# print(i)
The else statement is completely pointless at the start.
else:
pass
all_lists = [a, names, symbols, years]
# user input list
a = []
a is defined after all_lists so this should result in an error when run in some IDE's.
Why does a exist at all?
It's for "user input" it seems
I would probably do:
try:
# check if we have cmd line args
if len(sys.argv) > 1:
a = []
# check that custom(-c) flag is set
if sys.argv[1] == '-c':
# size of list is 2nd cmd line arg
list_size = int(sys.argv[2])
for i in range(list_size):
element = input('add to list: ')
a.append(element)
# user input list
all_lists = [a, names, symbols, years]
except:
all_lists = [names, symbols, years]
Oh it's used there
Mhm, I do not see why a was used before creation 🤔
oops thats totally my fault,all_lists should be initialized right before master_pass - was copy-pasting code blocks
the try except is a good idea, was thinking of a way to handle no user-input
does anyone know if httputility.urlencode().tostring properly filters out XSS payloads?
where do you see it?
anyone knows any good resources to learn coding? free if possible
i'm writing a python script that loads a json file and downloads images from the links in it
how do i use it as an arbitrary script?
like just provide the file as as argument so it can be used on any json file
python has a built-in json library, json already comes in a keyed value this works out nicely as values can be accessed like a dictionary. you can prompt for user input with input() and then use with...open to create a reader object and pull data from the json object or the user can specify on the command line and you parse that with argv
as for downloading images, requests module is the way to go
See argparse for the pythonic way of reading in CLI arguments https://docs.python.org/3/howto/argparse.html
am i allowed to ask for help/guidance on this shopping cart i am trying to make? it is not school work but its still based around what i do in my classes. Just wanted to ask before posting. But at least i have created a few classes and functions in python for a very simple and basic online shopping cart. It is not supposed to use frameworks like django or flask, nor gui like tkinter. I have also created a html file, but what im currently struggling with is making the html file execute the functions in my python file
i can post the code if allowed to
I assume your python is server-side
so you'll need to expose and call an api
usually via forms or javascript
well it practice based on assignments done in the past in the python course, so we have never had js, so its not for that
hmm sounds like you could maybe do something with cgi scripts if you need your code executed on the page?
feel free to post github link or something, not sure what code box limits are here, im assuming under ~50 lines is reasonable enough to not spam the server - should clarify with mod tho
yea okey, cheers! imma post it, and hope its okey
so this is the code i have this far at least. hope someone got some tips
You could do it janky with a php shell exec
i think i was only allowed to use python and html tho:/ but ty for tip:)
This video simply shows how to embed iframes into HTML.
Run External Python script from HTML, Combining HTML with python
Python working with Python
Click this link to subscribe our Channel : https://goo.gl/HhwC5i
Source Code : https://github.com/the-programming-guy
Facebook : https://www.facebook.com/guideme360, https://www.facebook.com/jav...
huh
Easier than I thought you can just use it in an action
so in your buttons or whatever you would just add an action tag
hmm, okey. thanks! i will watch it and come back to you if i have any questions:P
I have a python dictionary dict = { 'a' : '', 'b' : '1' } whose values I'm calling with first = dict['a']. Since every empty string evaluates False, I'm replacing it with a zero if not first: first = 0.
Is there a possibility to let a for loop do that for me, so I don't have to write the if statement for every variable?
for x in dict:
if dict[x] == '':
dict[x] = '0'
you can probably get fancy with dictionary comprehension but this is probably the easiest way to get that done
*This code has been untested.
If you are working with dictionaries, I would recommend using .items() when iterating over them.
for key, val in dictionary.items():
if not val:
val[key] = '0'
I would also recommend, Droogy, when writing code to use variable names that hint towards what the variable's purpose is:)
that didn't change the result, dict still contains {'a' : ''}
same here, still the same final result
I didn't test my version, gimme a sec to take a look ;)
dictionary = { 'a' : '', 'b' : '1' }
dictionary1 = { k : '0' for k,v in dictionary.items() if not v }
print(dictionary)
dictionary = dictionary | dictionary1
print(dictionary)
Output:
{'a': '', 'b': '1'}
{'a': '0', 'b': '1'}
This way is much better although:
def function(dictionary):
return { k : '0' for k,v in dictionary.items() if not v }
dictionary = { 'a' : '', 'b' : '1' }
dictionary = dictionary | function(dictionary)
print(dictionary)
Output:
{'a': '0', 'b': '1'}
@gusty crescent
There's probably an easier way but this works so 🤷♂️
never change a running system 😄
Thank you! give me a minute to test it
Seems like computer says no, did I missspell something?
Which version of python are you running?
3.8.5
Ah
That only works in 3.9
You would need to do something like:
dictionary = {**dictionary, **function(dictionary)} instead of dictionary = dictionary | function(dictionary)
I don't have 3.8 installed so you'll have to do some playing around :D
No problem :D
This does work for 3.8 btw 🙂
Awesome !
weird, just tested
appreciate the tips jabba!
It's always great to build good habits:)
Huh odd, „but I swear it didn’t work when I tried“ cause now it works for me as well. And I even copied your code, so must’ve been a typo
Want to know how to remove the common elements with only the count of the another elements in a list
Lets say we have a list
b=[1, 2, 1]
the result which I need is [2, 1]```
Any help or tips !
You want to remove duplicates?
Looks like the complement
Not duplicate I mean the exact subtraction of list
Uhh probably like
Like a - b
Yes
for item in list_one:
if item in list_two:
list_two.pop(item)
Actually that would be like that in Kotlin...
Looks like python
So we taking the bigger list as first and removing the elements from second ?
Basically but that's not terribly efficient
Script:
a=[1, 2, 1, 2, 1]
b=[1, 2, 1]
for item in b:
if item in a:
a.remove(item)
print(a)
print(b)
Output:
[2, 1]
[1, 2, 1]
What if b=[1,2,1,3]
We hav to exactly remove the common and print the entire remaining elements
From both lists?
I'm honestly confused
Yes
Oh you're trying to compare the lists
You need the complement of the intersection
I don't understand this sorry what does it mean
Just I need the difference
Am I confusing !
Or remove the common elements from both lists
You need (A-B)+(B-A)
a=[1, 2, 1, 2, 1]
b=[1, 2, 1]
for item in b:
if item in a:
print(item)
Output:
1
2
1
Apparently sets work but I don't know if they handle duplicates in python
Sets changed since python 2 so I don't use them lmao
Ok
I'm expecting like this
A = [1 2 3 1 2 3 1]
B = [ 1 2 3 1]
The result I need is [ 2 3 1]
Yay google
Ok 👍
a = [1, 2, 3, 1, 2, 3, 1]
b = [1, 2, 3, 1]
temp = []
for item in b:
if item in a:
if item not in temp:
print(item)
temp.append(item)
Output:
1
2
3
temp = 1, 2, 3
Seems to
a = [1, 2, 3, 1, 2, 3, 1]
b = [1, 2, 3, 1]
temp = []
for item in a:
if item in b:
if item not in temp:
print(item)
temp.append(item)
1
2
3
>>> print(temp)
[1, 2, 3]
>>>
Seems a bit odd but it's probably a pathological test case
That's finding the set of the intersection
Try with a = [1,2,3,4]; b = [2,5]
So we have to set the two lists and finding the difference is it!? But what if I need the elements which is not in A but in B ..just curious to know how to tackle
That's why I said (A - B) + (B - A)
Oh noted now tks...
You can also use (A + B) - (A intersect B)
Actually I am trying to solve a problem where we have to divide the given list into 2 halves irrespective of list length provided that the average of two lists are equal.. provided that first list have to have the first element in the given list...😀
Hang on a sec while I parse that
intresting problem , imma try it too
So assumes sets S, A, B. S[0] is an element of A. Mean(A) = Mean(B)
I think that mean(S) = mean(A) = mean(B) applies no?
Yeah that's it
Its a type of combinations and stuffs
It's set theory, partly
wait is it set of sets?
Set can mean list here I think
so
sets in py3 ignore duplicates
Is this binary search?
No
Ok It's midnight for me now Ill catch u morning guys...take care have a great day
i have seen this problem
this is a pretty common algorithms homework problem
It's probable
I'd probably start by sorting the list
Then pick min, max, min,... Until I reach the target mean
Probably not reliable though
Seems to work for the examples though
u take sum of all the elements in array,
you traverse the array and add elements one by one for subset1
and u subtract it from the total sum say its subset2
then you check if the average for both are same, then volla u got it(most likely)
Ooo
i have not worded it properly, after all this time
What's going on here?
Very nice
I just found a neat way to add threading to a program without knowing what threading is.
- Shuffle the input
- Run multiple programs
- Hope they never touch the same item at the same time, it's shuffled and if there's many items it'll be okay
Wow it's actually working, I'm a genius
BOGOthreading?
i feel kind of sick at that approach to concurrency
that works until all of a sudden your race condition causes everything to explode
I'll burn that bridge when I get to it
fair
Hi, do anyone knows of a website to learn programming by completing challenges?
I wanna learn C as a beginner, but also I’m very into bash after the bash scripting room on THM. So if you know of just a list of tasks a beginner can complete, and learn programming along with it, would be very helpful
Hackerrank, maybe?
@lilac holly there's a good intro to C course on udemy
"C programming for beginners, master the C language"
Thank you all, I’ll check the resources!
anyone good with ajax/php?
imo learning C is a bit different than other languages
ie, if you wanted to learn bash/python/ruby, I'd say, just come up with a project/go to hackerrank and go through them. With C, I think you should get a good overview of how it deals with memory/pointers/data types etc. it's a different paradigm
then once you have gone through a lengthy tutorial, then move to a project
I have basic assembly knowledge as I knew it’s what C is based on. Of course I don’t know everything so I wanna dig deep into it. I have some ideas of projects, so for now I’m gonna study it as much as I can
And thanks for the overview
looking for someone to HEX-EDIT an old 16-bit "DOS" game I wrote to unlock it. I cant remember the location to change to unlock the program. Anyone got time ?
I need some help installing protoc for golang. I'm on an armel debian, and comiling my own crap is giving me nightmares.
Hi anyone knows any website to learn Ruby language or C language?
oooo thank you so much
can any bodu help me with it
2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.
What is the sum of the digits of the number 2^1000?
Where is this problem from? @glass cape
Project Euler
project euler i want to solve
it using python
i am getting an type error i tried using for loop it wont work
I'm confused on the task exactly?
Find out whatever number 2^1000 is, loop over all the digits and sum them
are you sure so then i have to use for loop on string
i was thinking of using pow function
Well yeah
You gotta calculate 2^1000, store that in a variable, convert it to a string and then you can loop over the digits in the string with a for-in loop
Ah I see now.
got it thanks for your help
can i dm ??
(BTW you don't have to store 2**1000 in a variable)
Yeah but I figured to keep it straight-forward instead of onelining it
@glass cape Sure
Just unnecessary variable assignment
Why store it in a variable when you can directly iterate over it in the for loop?
I'm just breaking it down
??
I found it easier to learn it by breaking it down into more lines
And then after getting it working, seeing how I could rewrite it in a shorter form, such as removing unnecessary variables.
I'm trying to iterate over two excel tables at the same time using openpyxl (in this case both tables are on the same sheet) and paste a value of table A to the corresponding row of table B. I've tried this
current_row = 2
for row in ws.iter_rows(min_row=2, max_row=379):
date_dissection = str(ws.cell(row=current_row, column=3).value)[:10]
nerve_dissection = ws.cell(row=current_row, column=6).value
id = ws.cell(row=current_row, column=1).value
current_line = 2
for line in ws.iter_rows(min_row=385, max_row=617):
date_dmg = str(ws.cell(row=current_line, column=3).value)[:10]
number_dmg = ws.cell(row=current_line, column=7).value
if date_dmg == date_dissection and number_dmg == nerve_dissection:
ws.cell(row=current_line, column=1).value = id
current_line +=1
current_row +=1
But its not doing anything or hangs. Also tried having the tables split to different worksheets, but with the same outcome.
dumb question but is this for a personal project? sounds like something you do with VLOOKUP if you just need a quick and dirty way of mapping values between tables
yes it is, I'm a student so nothing I'd get paid for. I just like python and to automate stuff with it
VLOOKUP function only works if the value is in the left column of table A so if it is then just use a VLOOKUP and then retrieve the data with python CSV
If anyone want a kickstart into writing their own shellcode, I've made a playground that has the following features:
- compiles
.cboth to 32 and 64 bit (filenameandfilename64respectively) - compiles
.asmto 32 bit binaries - compiles
.asm64to 64 bit binaries - provides a shellcode runner that works for 32 and 64 bit
- example shellcode for 32 and 64 bit
make rawwill print the shellcodes as\xstring
./bin/shellcoderun (echo -n -e (make raw | grep -v printf | grep -w 'shell' | awk '{print $2}' -))
Simply change the 'shell' to the name of your binary!
https://github.com/AlexanderBrevig/shellcode-playground/
If anyone knows system design (as in, from an engineering perspective not coding) if you could can you ask me some system design Qs in VC some point this week 🥺
w3schools?
thanks 🙂
Anyone have any experience with Vue JS/Axios and POST requests and willing to have a quick look at something? Not looking for someone to write code for me, as my logic works completely fine on my local machine (which leads me to think one of the server admins has potentially made a change), but would appreciate a more experienced eye to be casted over an issue i'm having.
did you take latency into account with your promises?
I worked around the issue now, i used Fetch in async rather than Axios. I'm not entirely sure what was at fault specifically, but the fact it was working on my local instance and not the server itself (and the extra data it was returning at the top of the response) was strange. My data was being received, it just wasn't in a format i could access due to the additional data. Working with Fetch has circumvented that for now.
I tried a plethora of content-types and accept headers in order to fix it, but i know the issue was with Axios in the process, as debugging through each step the data was as expected right until the point it was returned into Axios.
just a simple question:
for statement{
conditional statement #1{
conditional statement #2{
}
}
}
For this the time complexity should be n + 1 +1 , correct?
== O(n)
well nvm, problem seems to be the competition server.
Should be O(n)
Condition such IF is in linear time so it is assumed constant time. So there is only one loop so it means O(n)
$(document).ready(function() {
console.log("Is it even loading?");
$('#submitLogin').on('submit', function( e ) {
console.log("Is this doing anything?");
e.preventDefault(e);
var form = $('#login form');
console.log("Form logged");
$.ajax({
url: 'authenticate.php',
type: 'POST',
// Get Form Data
data: form.serialize(),
beforeSend: function() {
console.log("Checking...");
},
success: function( msg ){
if(msg) {
console.log("Worked");
} else {
console.log("Didn't Work");
}
}
});
});
});
Can someone assist and tell me why this is unable to get the form data from within a modal?
infact. console.log("Is this doing anything?" doesn't populate in console
can u suggest me a hacking tool that i can code
cause i ran out of ideas in my project CyberCrack
hey guys
It's solved, thanks for asking 👍
Ah cool!
If you need help with a room, please keep it in the room chat. This avoids spoiling the room for others.
oh cool, lemme delete that that then sorry
No problem 
what's the best way to design mobile first sites
should i just set a max-width and go from there?
Spelling mistake there @cursive orchid
👀
does anybody know of a good plafe to learn assembly
I know it only has limited exercises but exercism.io has assembly as a language to learn
This is a little outdated, but I've seen it used in current university courses that each ASM. http://courses.missouristate.edu/kenvollmar/mars/
You can also try tutorialspoint, they have a LOT of content on many subjects... but the content is hit or miss. https://www.tutorialspoint.com/assembly_programming/index.htm
Assembly Programming Tutorial - Assembly language is a low-level programming language for a computer or other programmable device specific to a particular computer architecture in contrast to
alright thanks!
has anybody worked with the google sheets api?
anyone here able to help me understand some documentation for a payment gate that I'm attempting to implement?
I've been going through screenshots that my co-worker and I would take whenever we encountered "not-so-good" code. I found this beauty just now.
Or this beautiful memory leak that somehow made it past review. It would completely clog up your RAM within a couple minutes.
I'm trying to modify an exploit for a machine on tryhackme. The problem is that there are two authentication methods. How can I stay authenticated and do the next authentication. The first one is a basic auth the next authentication can be done via the exploit itself. I need to find a way to persist the basic auth and then continue with the rest of the exploit. Can someone help pls?
There's a way to get basic auth in the url
I used the request module to login and it works fine..but the session is not persistent. It closes as soon as the next line is executed
Found an interesting, and rather short, whitepaper about using polyglot code to potentially evade antivirus software. I found it rather interesting since the author referenced a whitespace esoteric programming language (Jaws) to inject code into different types of files without disrupting their behavior while still being parseable as their intended purpose. I thought someone else here might also find it an interesting read. 🙂
https://scholarworks.uni.edu/cgi/viewcontent.cgi?article=1423&context=hpt
Hello
Does anyone know html/css
Ask your question mate :0
@gray ledge Late to the party but I liked this as well for x86 ASM
https://en.wikibooks.org/wiki/X86_Assembly/
so i want to start programming and coading any ideas
check pins
Has anyone had any luck getting a GDB plugin to work with Ghidra?
Does anyone have a good resource for Python pen-testing scripts or programs? I'm in the process of learning Python as my first language and thought it'd be helpful to dissect other programs to see what types of things are possible.
@tidal panther thanks for that. I'll start digging through some code right away 😉
there is also the book but the book is python 2
I'll definitely look into that too. My library keeps growing the more I want to know. My son will have an awesome collection to learn from once he can understand it all.
Hello. I am about to learn python programming and i would like to know what is the best IDE you might recommend? I see PyCharm is ok 🙂
Pycharm is pretty good; it's what i use for my own coding. When i'm coding for work, I have a set of VIM plugins
largely because it is easier to SSH in than try to develop that codebase locally
I would recommend downloading a bunch of IDEs and seeing which one you find is best fit; at the end of the day it’s what suits your needs.
PyCharm is good but I find it's pretty heavy and takes up a lot more resources then other IDEs
I just use sublime text with my terminal
Its a text editor but it's great either way
Can anyone look over a javascript and tell me why it isn't working
I can, but Im no expert
Well, you're gonna hate this as much as I do, can I dm you further information, so the link?
@bitter field
sure
Ty
If you're a current student with the appropriate email address, you can get all of the JetBrains products for free.
if you're a student you should also apply for the github student developer's pack, its insane how much stuff you get - at least a thousand dollars worth of access to various software suites and stuff
Switch cases in Python are coming https://github.com/gvanrossum/patma/blob/master/README.md#tutorial
Heyy i"m start learning network fundanentals
I want follow network pentest
So do you have some site for practice? Or resources for this major
For system design interviews (other than practice questions) I made a table comparing a bunch of technologies (rabbitMQ vs Kafka etc etc) might be helpful 🙂
Python, powershell, bash, C#
What's nim
Who is nim?
nim is actually quite good imo
Loving Nim
i think that autocorrected from nano
secret of nim
Compiles to JavaScript, gods help us all
Fortunately it doesn't need to do that
Their odd numbers iterator example is inefficient.
Better to return x + x + 1 for all x in positive integers
You can do 2*x + 1 as well though the compiler might optimize that. But avoiding division is probably for the best, though %2 can be replace with &1
Ok I'm done
Actually... (x << 1) + 1 is probably best perf wise
The bitwise &1 is one of my fave tricks for checking odd numbers. Idk if it's faster but in code interviews they go "woah you know bit operators????" 
Definitely faster than modulo
Compiler might be smart enough to optimize that though
Dividing is hard
Adding is easy
Subtracting is just adding
Multiplying is a bit harder than adding but easier than dividing
Bee did you see us adding one to stuff the other day?
damn I can't send images in here
Verify
is there any way that I can?
!docs verify
Jumping is relatively expensive in systems as well so avoiding conditionals is good
they compile to the same thing
although this optimises to just return 0
Shift registers need a clock cycle
Ah mod 2 is doing a shift right
