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 openai | |
import telegram | |
# Configura la API de ChatGPT | |
openai.api_key = "TU_API_KEY" | |
# Configura el bot de telegram | |
bot = telegram.Bot(token="TU_TOKEN_BOT") | |
# Esta función se ejecutará cuando el usuario envíe un mensaje al bot |
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
# -r, copy recursively | |
# -p, maintain permissions of the files | |
# -i, without specifying the private key, the ssh auth will not work | |
# -o ignore on screen logs that would disrupt the scp protocol | |
# to copy from remote to local, just change the order of the two last parameters | |
scp -i .ssh/login-key.key -o "StrictHostKeyChecking no" -rp /source/folder username@remote_hostname_or_ip:/destination/folder/ |
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
########################################################################################## | |
# Basic configuration and some simple hardening for an Debian/Ubuntu server | |
########################################################################################## | |
# This guide assume that a fresh server is being configured. | |
# It is assumed that the user has root priviledges, | |
# and most of the sentences are to be run as superuser (root) | |
# Root Passwd; |
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
docker cp <containerId>:/file/path/within/container /host/path/target |
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 | |
# Clear the initial creen contents | |
clear | |
echo ------------------------------------------------------------------ | |
echo CPU info [Number, type, speed...] | |
echo ------------------------------------------------------------------ | |
lscpu | |
echo ------------------------------------------------------------------ |
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
# Pulls the image (4Gb!) | |
docker pull cloudera/quickstart | |
# Ports to be opened (most commonly used) | |
# - 8888 expose hue interface | |
# - 7180 expose cloudera manager | |
# - 80 expose cloudera examples | |
# - 8983 expose port of Web UI solr search | |
# - 50070 expose name node web ui interface | |
# - 50090 expose secondary name node |
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 is the all-in-one, standalone Discourse Docker container template | |
## | |
## After making changes to this file, you MUST rebuild | |
## /var/discourse/launcher rebuild app | |
## | |
## BE *VERY* CAREFUL WHEN EDITING! | |
## YAML FILES ARE SUPER SUPER SENSITIVE TO MISTAKES IN WHITESPACE OR ALIGNMENT! | |
## visit http://www.yamllint.com/ to validate this file as needed | |
templates: |
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
# delete local tag '12345' | |
git tag -d 12345 | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :refs/tags/12345 | |
# alternative approach | |
git push --delete origin tagName | |
git tag -d tagName |
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 | |
# old-files.sh - Borrado sessiones de XXXX para XXXX. | |
# | |
# Añadido por Cartograf XXXX-XX-XX, añadido en user XXXX por limpieza | |
# y organizacion | |
# | |
# Debemos añadir el fichero a cron (/etc/cron.d/old-files, o similar) | |
# | |
# --------------------------------------------------- | |
# Cron para backups |
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
# .htaccess Snippets | |
A collection of useful .htaccess, all in one place. I decided to create this repo after getting so tired (and bored) with Googling everytime there's a need of forcing `www` for my new website. | |
**Disclaimer**: While dropping the snippet into an `.htaccess` file is most of the time sufficient, there are cases when certain modifications might be required. Use with your own risks. | |
**NOTE**: Apache 2.4 introduces a few breaking changes, most notably in access control configuration. For more information, check the [upgrading document](https://httpd.apache.org/docs/2.4/upgrading.html) as well as [this issue](https://github.com/phanan/htaccess/issues/2). | |
## Table of Contents | |
- [Rewrite and Redirection](#rewrite-and-redirection) | |
- [Force www](#force-www) |
NewerOlder