Using text and variable in matchtext - mirc

I have tried to implement prefixes to my bot without any luck
ON *:TEXT:$($+(%prefix,LEVEL)):#: { msgs here }
There is what I tried without success, any idea how I can fix it so I can use the prefix and the actual command?

Your command is working well.
Assuming %prefix is set to !
If you will change msgs here to echo -ag Is this working ? you will notice everytime someone will write !LEVEL it will echo Is this working ?.

Related

How to clear or change a message in Redis using powershell?

I am using powershell that is hooked up to jupyter redis rediscommander retwis
I am creating codes like hset snap:msg:4 to "che" from "Dax" text "Is this thing on?"
I made a mistake and msg:3 is meant to be msg:4. Is there any way to clear or edit this message?
Thanks
I have tried lpop but I am new to this and do not understand all the words and what they do yet.
Welcome to StackOverflow!
I made a mistake and msg:3 is meant to be msg:4. Is there any way to clear or edit this message?
You want to rename that key using the RENAME command:
RENAME snap:msg:3 snap:msg:4
How do I just clear everything?
If you wish to remove all the keys in the selected Redis database (caution!) you can do that with the FLUSHDB command. Alternatively, the FLUSHALL command removes all the keys from all the Redis databases (even more caution!).

dart:cli start nano command and parse than the content

👋🏼 hallo guys,
i want to write a cli dart app. which starts nano .... and at exit save the input should be parsed to a File(...) as content.
i already tried to look for something like this on the pub.dev site, but couldn't find anything. maybe i'm looking for it wrong ... ?
for example:
var output = *start nano*
var file = File(argResults!['file-name']).writeAsStringSync(output);
how can i do that?
Have a look at the 'editor' function in the dcli package.
https://onepub.dev/packages/dcli
It starts an editor and waits for it to close.

Is there a way in pytest to get rid of the "x tests ran in 0.01s" line in the output?

I have a usecase in which I use pytest to go over each file and just collect some metadata specific for my tests. I would like to use the output in another tool without having to manually remove the === no tests ran in 0.10s === line from the bottom of the output.
I have tried adding multiple quiet options and --no-summary but neither of them removes this.
I have noticed that if i use --collect-only with -qq this makes it disappear. I thought I could just use this but reading through documentation I haven't found a way to trigger the collect-only behavior other than using:
def pytest_configure(config) -> None:
if config.option.collect_metadata:
config.addinivalue_line("addopts", "--collect-only")
but that doesn't seem to work either.
Is there a way to get rid of all the summary lines including === no tests ran in 0.10s === without writing my own test collector?

Specify parameters with SQLMAP

I'm a student learning php & mysql development. i have setup a private lab ( VM ) inside my computer to test & learn how sql injection works. When things get harder i use sqlmap to exploit and later on study the requests it made to my test app using verbose mode & by capturing packets via wireshark. I came across a small problem and that's to specify the parameter in a URL to sqlmap to test.
http://localhost/vuln/test.php?feature=music&song=1
i want sqlmap to scan the parameter song so i tried these solutions
-u http://localhost/vuln/test.php?feature=music&song=1 --skip feature
-u http://localhost/vuln/test.php? --data="feature=music&song=1" -p song
Tried different variations by adding and removing quotes and equal signs , non worked. I even tried setting the --risk to --level to its maximum but it still fails to pick up the last parameter.
I will be very thankful if an expert can help me out with this.
Thank you.
the p option can be used in the following way
-u "http://localhost/vuln/test.php?feature=music&song=1" -p song
I noticed also that you can scan multiple parameters using this :
-u "http://localhost/vuln/test.php?feature=music&song=1" -p 'song,feature'
This will scan the song parameter, then the feature parameter.
If sqlmap find a vulnerable parameter, it will ask you if you want to continue with the others.
You can simply add * to your value of parameter which you want to scan. Did you try that one?
I have this problem too. I think sqlmap inject the first parameter. If you type :
-u http://localhost/vuln/test.php?feature=music&song=1
sqlmap will inject 'feature' parameter. To make it inject 'song' parameter you need to reorder the parameter as follows :
-u http://localhost/vuln/test.php?song=1&feature=music
Dont forget to add '&' between each parameter. It worked for me.
I have already triggered this type of problem. You can simply skip the 'feature' parameter. E.g -u http:// localhost/vuln/test.php?feature=music&song=1 --skip=feature and then certainly it will start testing the 'song' parameter.

Cron Job in Kohana

How do you create a cron job in Kohana? I setup a regular controller which extends off the Controller_Base and I ran the command line:
/usr/bin/wget http://domain/controller/custom_cron
But I can't get it to work. It just doesn't execute. No error, nothing. I didn't put any special code in my controller ... just what I need to run my program. So if there is like a special command to call a cron job, I didn't add it (cause I don't know what it would be).
Also, I need it to make MySQL calls so I would need to include the db info and connection and what not (if it doesn't do that automatically). And I work off a custom model. How would I include that (if it doesn't do it automatically).
Thank you.
php /path/to/index.php --uri=controller/action/etc/etc
Calling it like this pretty much makes it act exactly like in a web environment. The only difference is the protocol for requests is 'cli'. You'll need to keep that in mind if you are generating links.
So if there is like a special command
to call a cron job, I didn't add it
(cause I don't know what it would be)
Daft question - have you added that wget command to crontab or similar?
If on the other hand you're looking to make a "poor man's cron", you could try creating a hook that runs on every page load and checks the last time the job was run, perhaps storing the last timestamp in a file or database.
I had to use cURL as my fire-this-script command in curl
Ex:
30 18 * * * curl "http://domain.com/controller/method"
php and wget didn't work, even when calling index.php and adding the uri as suggested above.
Also, FYI, Most transparent way to test this was just running the line from SSH manually to see what the results were. Once I confirmed it was working there, then I put it in the cron.