Skip to content

Instantly share code, notes, and snippets.

View Cvar1984's full-sized avatar
⚠️
This account is under NSA investigation

Bellatrix Lugosi Cvar1984

⚠️
This account is under NSA investigation
View GitHub Profile
@Cvar1984
Cvar1984 / how_to_ask.md
Created February 22, 2025 10:14
generated by GPT-3

How to Ask a Technical Question

When you're trying to ask a technical question, following a structured approach can help you get the most accurate and useful responses. Here’s a simple tutorial to guide you:

1. Define the Problem Clearly

  • Be Specific: Describe exactly what the issue is. Instead of saying, “My code doesn’t work,” explain what the code is supposed to do and what it is doing instead.
  • Context: Provide background information about the project or situation.

2. Provide Relevant Details

  • Code or Configurations: If applicable, share relevant code snippets, configuration files, or error messages. Make sure to format the code properly for readability.
@Cvar1984
Cvar1984 / panthera.lua
Created February 19, 2025 10:10
Simulate and calculate terror of nowhere panthera weapon cost
-- Function to simulate enkephalin usage and calculate paralysis occurrences
local function simulatePanthera(userInputEnkephalin)
-- Constants for calculations
local percentage = 1 -- Percentage of total enkephalin used per hit
local base = 3 -- Base cost for each hit
local minimum = 5 -- Minimum cost for a hit
local totalEnkephalin = userInputEnkephalin -- Total enkephalin available
local hitCounter = 0 -- Counter for the number of hits made
local costCounter = 0 -- Counter for the total cost incurred
local paralizeCounter = 0 -- Counter for paralysis occurrences
@Cvar1984
Cvar1984 / .htaccess
Created December 24, 2024 10:58
Disable malicious php execution from arbitrary file uploads
# Disable PHP execution for all handlers and ensure compatibility with any system
<IfModule mod_php4.c>
php_flag engine off
</IfModule>
<IfModule mod_php5.c>
php_flag engine off
</IfModule>
<IfModule mod_php7.c>
php_flag engine off
</IfModule>
import decimal
def binary_split(a, b):
if b == a + 1:
Pab = -(6*a - 5)*(2*a - 1)*(6*a - 1)
Qab = 10939058860032000 * a**3
Rab = Pab * (545140134*a + 13591409)
else:
m = (a + b) // 2
@Cvar1984
Cvar1984 / compress_folder
Created October 1, 2024 06:11
highly compress 7zip
7za a -t7z -m0=lzma2 -mx=9 -md=1024m -ms=on "$1" "$2"
# /etc/danted.conf
logoutput: syslog
internal: eth0 port = 1080
external: eth0
external.rotation: same-same
socksmethod: pam.username
user.privileged: cvar1984
user.notprivileged: nobody
@Cvar1984
Cvar1984 / which_planet.lua
Created September 3, 2024 08:48
Find Gravity by free fall test
io.write("Initial acceleration of the object in m/s: ");
local initial_velocity = io.read("*n")
io.write("Height in meter: ")
local height = io.read("*n")
io.write("Times the object is dropped from a height in sec: ")
local time = io.read("*n")
local gravity = 2 * (height - initial_velocity * time) / time ^ 2
@Cvar1984
Cvar1984 / find_alpha.lua
Created September 3, 2024 06:53
Find alpha degrees for suncalc
local function degrees(radians)
return radians * 180 / math.pi
end
io.write("Height of the pole: ")
local height = io.read("*n")
io.write("Length of the shadow: ")
local wide = io.read("*n")
@Cvar1984
Cvar1984 / free_fall.lua
Created September 2, 2024 07:05
Determine your height with time
local initial_velocity, time, gravity, height;
-- The gravitational acceleration of the Earth is 9.80665 m/s².
gravity = 9.80665;
io.write("Initial acceleration of the object: ");
initial_velocity = io.read("*n");
io.write("Times the object is dropped from a height: ");
time = io.read("*n");
@Cvar1984
Cvar1984 / is_same_server.php
Last active June 22, 2024 06:50
Check if given domain list have same ip (living in the same server instance)
#!/usr/bin/env php
<?php
if ($argc < 3) {
echo sprintf('%s <domainList> <domain/ip>%s', $argv[0], PHP_EOL);
exit(1);
}
/**
* ValidateDomainOrIp