Skip to content

Instantly share code, notes, and snippets.

View ramaureirac's full-sized avatar
🏠
Working from home

Rodrigo Andrés Maureira Contreras ramaureirac

🏠
Working from home
View GitHub Profile
@clarkmcc
clarkmcc / delete-shutdown-pods.sh
Last active May 11, 2022 12:15
Deletes Kubernetes pods with a status of Shutdown that are usually left over after a GKE pre-emptible node goes offline.
#!/bin/sh
for namespace in $(kubectl get ns | awk '{print $1}' | grep -v NAME); do
for pod in $(kubectl get pod -n $namespace --field-selector=status.phase!=Running | grep Shutdown | awk '{print $1}' | grep -v NAME); do
kubectl delete pod -n "$namespace" "$pod"
done
done

Windows Forms: Como encriptar/desencritar la cadena de conexión en el archivo app.config usando C#

Esta nota te muestro cómo cifrar y descifrar la cadena de conexión en el archivo app.config en una aplicación de Windows Forms de C# .Net

Puede usar muchos algoritmos diferentes para cifrar y descifrar una cadena de texto. Sin embargo, dentro del alcance de este artículo, solo le muestro cómo usar el algoritmo TripleDes para cifrar y descifrar su cadena de conexión.

La cadena de conexión generalmente se almacena en app.config y rara vez se cifra. Si alguien abre el archivo app.config, verá la información de conexión del servidor de datos. Esto es muy peligroso si inician sesión en la base de datos para sabotear o editar datos sin usar software.

Por lo tanto, el cifrado de la cadena de conexión es esencial, le ayuda a proteger la información de conexión a la base de datos.

@bigbeno37
bigbeno37 / install-laravel.sh
Last active November 20, 2021 11:14
Install Laravel 5.4, MySQL 5.7, Apache2.4 and PHP7.1 on Ubuntu 16.04
# CREATED BY BEN O'SULLIVAN / BIGBENO37 (GITHUB.COM/BIGBENO37)
# LICENSED UNDER CREATIVE COMMONS 'Attribution 4.0 International' LICENSE
# https://creativecommons.org/licenses/by/4.0/
# FEEL FREE TO USE AND ADAPT THIS SCRIPT IN COMMERCIAL AND NON COMMERICAL PRODUCTS
# AS LONG AS PROPER ACCREDITATION IS GIVEN
# VARIABLES
echo -e "\x1B[01;95mWhat would you like to name your Laravel project?\x1B[0m"
read LARAVEL_PROJECT_NAME
@laobubu
laobubu / ABOUT.md
Last active May 27, 2024 21:40
A very simple HTTP server in C, for Unix, using fork()

Pico HTTP Server in C

This is a very simple HTTP server for Unix, using fork(). It's very easy to use

How to use

  1. include header httpd.h
  2. write your route method, handling requests.
  3. call serve_forever("12913") to start serving on port 12913
@m-hofmann
m-hofmann / main.py
Created October 6, 2016 17:14
QListWidget PyQt Example
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QListWidget, QVBoxLayout, QLabel, QPushButton, QListWidgetItem, \
QHBoxLayout
class CustomQWidget(QWidget):
def __init__(self, parent=None):
super(CustomQWidget, self).__init__(parent)
label = QLabel("I am a custom widget")
@Integralist
Integralist / Python TCP Client Example.py
Created September 18, 2016 15:07
Python TCP Client Server Example
import socket
hostname, sld, tld, port = 'www', 'integralist', 'co.uk', 80
target = '{}.{}.{}'.format(hostname, sld, tld)
# create an ipv4 (AF_INET) socket object using the tcp protocol (SOCK_STREAM)
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# connect the client
# client.connect((target, port))
@syafiqfaiz
syafiqfaiz / how-to-copy-aws-rds-to-local.md
Last active June 22, 2024 20:31
How to copy production database on AWS RDS(postgresql) to local development database.
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored
@andytill
andytill / ListViewIndexChangesWhenItemUpdated .java
Created July 15, 2012 13:07
Example application showing how changing an item in a ListView changes its index
import java.io.IOException;
import java.util.Arrays;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.beans.Observable;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;