This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"database/sql" | |
"database/sql/driver" | |
"fmt" | |
"net" | |
"os" | |
"time" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Protection from Malicious Domain (ads, malware, hack scripts, fakenews and gambling ) | |
# You may not be doing it but various apps installed on your system doing it internally, so having ad blocker in Browser does not helps. | |
# Execute below command in your terminal once every week. | |
sudo chmod 774 /etc/hosts | |
curl https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn/hosts > hosts | |
sudo mv hosts /etc/hosts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const pg = require('pg-promise')(); | |
const fs = require('fs'); | |
const db = pg({ | |
user: "****", | |
password: "*****", | |
host: "******", | |
port: 5432, | |
database: "*****", | |
ssl: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ignore_for_file: prefer_function_declarations_over_variables | |
import 'dart:async'; | |
import 'dart:collection'; | |
import 'dart:convert'; | |
import 'dart:io'; | |
import 'dart:typed_data'; | |
import 'package:basics/basics.dart'; | |
import 'package:quiver/cache.dart'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Array to store user choices | |
declare -A choices | |
# Log file | |
LOGFILE="/var/log/linux_hardening.log" | |
# Function to log messages | |
log() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# File: /usr/local/bin/configure_malloc.sh | |
set_malloc_config() { | |
local total_ram=$1 | |
local arena_max mmap_threshold trim_threshold top_pad | |
mmap_threshold=524288 # 512 KB | |
trim_threshold=524288 # 512 KB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE PROCEDURE GenericPivot( | |
IN tableName VARCHAR(255), | |
IN pivotColumn VARCHAR(255), | |
IN pivotValues VARCHAR(255), | |
IN aggregateColumn VARCHAR(255), | |
IN groupByColumn VARCHAR(255) | |
) | |
BEGIN | |
DECLARE columnsList TEXT; | |
DECLARE sql_query TEXT; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set variables for key files | |
PRIVATE_KEY_FILE="/etc/ssh/ecdh_private_key.pem" | |
PUBLIC_KEY_FILE="/etc/ssh/ecdh_public_key.pem" | |
SSH_CONFIG_FILE="/etc/ssh/sshd_config" | |
# Function to handle errors | |
handle_error() { | |
echo "Error: $1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import polars as pl | |
import os | |
import time | |
from threading import Thread, Event, RLock, Lock | |
from typing import List | |
import uuid | |
def synchronized(lock): | |
"""Synchronization decorator.""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Configuration | |
NODE_APP="your-app.js" | |
CGROUP_NAME="nodejs_group" | |
MEMORY_LIMIT="4G" | |
SWAP_SIZE="8G" | |
SWAPFILE="/swapfile" | |
SWAPPINESS=60 | |
ZSWAP_ENABLED=1 |