This file contains 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 os | |
import sys | |
def collect_go_files_content(directory): | |
content = "" | |
for root, _, files in os.walk(directory): | |
for file in files: | |
if file.endswith(".go"): | |
file_path = os.path.join(root, file) | |
with open(file_path, 'r', encoding='utf-8') as f: |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Magic Square Generator</title> | |
<style> | |
table { | |
border-collapse: collapse; | |
margin: 20px 0; |
This file contains 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 | |
# This is a bash script that creates a CloudFormation stack for a public certificate with DNS validation, | |
# based on input parameters provided as command line flags. | |
# The script starts by defining the print_help function that displays the usage information for the script, | |
# along with the available command line flags. | |
# Next, the script uses the getopts command to parse the command line flags and store their values in variables | |
# (stack_name, csv_file, and domain_name). If any of the required flags are missing, the script will display | |
# an error message and exit. | |
# The script then reads the contents of the CSV file into a bash array (subject_alternative_names), which | |
# will be used to specify the SubjectAlternativeNames for the certificate. |
This file contains 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 | |
# This bash script will check if a branch named BRANCH_NAME exists in the Git repository. | |
# If it exists, it will checkout to that branch and reset the branch to the previous commit, | |
# discarding all previous commits except the last one. It will then rename the latest | |
# commit to COMMIT_NAME and push the rewritten branch to the remote repository. | |
# Finally, it will display a message indicating that the branch has been rewritten | |
# and the last commit has been renamed. | |
if [ $# -ne 2 ]; then |
This file contains 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
# This script is a command line tool that reads German conjugations of the verb "sein" (to be) | |
# in the present tense using Festival TTS engine on Linux. The script declares an array of strings, | |
# each string containing a conjugation of the verb "sein" for a different personal pronoun. | |
# Then, it uses an infinite while loop to iterate over the array, reading each conjugation 60 times | |
# with a sleep of 1 second in between each reading. The script uses the echo "$i" | festival --tts -voice de | |
# command to read the current string in the array, where -voice de option is added to the festival --tts command, | |
# which causes the TTS engine to use a German voice. The script is useful for language learners who want to | |
# practice the conjugations of the verb "sein" in the present tense on Linux. | |
# How to install festival: | |
# sudo apt-get install festival |
This file contains 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
################################################################### | |
# Protected links | |
# | |
# Protects against creating or following links under certain conditions | |
# Debian kernels have both set to 1 (restricted) | |
# See https://www.kernel.org/doc/Documentation/sysctl/fs.txt | |
#fs.protected_hardlinks=0 | |
#fs.protected_symlinks=0 | |
net.ipv4.ip_forward=1 | |
#net.ipv4.ip_local_reserved_ports=30000-32767 |
This file contains 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
global | |
localpeer haproxy-1 | |
defaults | |
timeout connect 5s | |
timeout client 1m | |
timeout server 1m | |
peers haproxy-peers |
This file contains 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 | |
############################################################################## | |
# SHORTCUTS and HISTORY | |
############################################################################## | |
CTRL+A # move to beginning of line | |
CTRL+B # moves backward one character | |
CTRL+C # halts the current command | |
CTRL+D # deletes one character backward or logs out of current session, similar to exit | |
CTRL+E # moves to end of line |
This file contains 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/sh | |
#Check the Drive Space Used by Cached Files | |
du -sh /var/cache/apt/archives | |
#Clean all the log file | |
#for logs in `find /var/log -type f`; do > $logs; done | |
logs=`find /var/log -type f` | |
for i in $logs |
This file contains 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
# Ask for the user password | |
# Script only works if sudo caches the password for a few minutes | |
sudo true | |
# Install kernel extra's to enable docker aufs support | |
# sudo apt-get -y install linux-image-extra-$(uname -r) | |
# Add Docker PPA and install latest version | |
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" |
NewerOlder