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
Add aliases in your .(shell)rc: | |
alias gcb='f(){ gcc "$1" -o "$2"; ./"$2"; unset -f f; }; f' | |
alias gcr='f(){ gcc "$1"; ./a.out; rm -f a.out; unset -f f; }; f' | |
The first modifies the name of the binary and executes it. The second compiles, runs, and delete the binary. | |
Demo gcb: | |
~$ gcb main.c build | |
Hello World |
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
sudo nano /etc/systemd/system/[email protected] | |
PASTE this code (dont forget to change the username): | |
""" | |
[Unit] | |
Description=Start TightVNC server at startup | |
After=syslog.target network.target | |
[Service] | |
Type=forking |
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
## Create a connection to Linode S3 file storage | |
!pip install boto3 | |
AWS_S3_ENDPOINT_URL = f'https://{REGION_NAME}.linodeobjects.com' | |
import boto3 | |
s3 = boto3.client('s3', | |
region_name = 'REGION_NAME', | |
endpoint_url = AWS_S3_ENDPOINT_URL, | |
aws_access_key_id = 'XXXXXXXXXXXXXXXXXXXX', | |
aws_secret_access_key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') |
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
sudo nano /etc/apt/sources.list | |
#Write this into list | |
deb http://deb.debian.org/debian stretch-backports main contrib non-free | |
deb-src http://deb.debian.org/debian stretch-backports main contrib non-free | |
sudo apt update | |
sudo apt install python-certbot-nginx -t stretch-backports |
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
## allow ssh connections (otherwise you will lock yourself out) | |
sudo ufw allow 22/tcp | |
## allow VNC connections from one IP address (edit the port if you don't use 5901) | |
sudo ufw allow from 12.34.56.78/24 to any port 5901 | |
## reject all other incoming connections | |
sudo ufw default reject incoming | |
## enable the firewall | |
sudo ufw enable |
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
version: '3.1' | |
services: | |
db: | |
image: mysql | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: mysqlrootpassword | |
MYSQL_DATABASE: test_db | |
ports: | |
- "3308:3306" |
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
version: '2' | |
services: | |
mariadb: | |
image: 'docker.io/bitnami/mariadb:10.3-debian-10' | |
environment: | |
- ALLOW_EMPTY_PASSWORD=yes | |
- MARIADB_USER=bn_magento | |
- MARIADB_DATABASE=bitnami_magento | |
volumes: | |
- 'mariadb_data:/bitnami/mariadb' |
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
### Keybase proof | |
I hereby claim: | |
* I am imasimali on github. | |
* I am asimali (https://keybase.io/asimali) on keybase. | |
* I have a public key whose fingerprint is 1522 E77A 5B6A 8A57 9813 E07C D83D 8077 8435 C8B3 | |
To claim this, I am signing this object: |