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 pywikibot | |
wikidata_site = pywikibot.Site("wikidata", "wikidata") | |
wikidata_repo = wikidata_site.data_repository() | |
page = pywikibot.Page(wikidata_site, 'Wikidata:WikiProject_Materials/Test') | |
print(page.exists()) | |
print(page.text)) |
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
# Install Django | |
! pip install django | |
# Create a project | |
! django-admin startproject mysite . | |
# Launch devlopment server | |
! python manage.py runserver | |
! python manage.py runserver 8080 # Custom port (default to 8000) | |
! python manage.py runserver 0.0.0.0:8080 # Allow external access |
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
# print the help | |
command --help | |
# ssh commands (use --help) | |
ssh connect using ssh -pxxxx [email protected] | |
scp ssh copy | |
rsync remote sync | |
# common shell commands (use --help) | |
ls list |
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
# Update the system | |
apt-get update | |
apt-get upgrade | |
# Change root password | |
passwd root | |
# Add a new user and give sudo rigts | |
adduser username | |
apt-get install sudo #probably not needed |
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
https://docs.docker.com/compose/reference/overview/ | |
docker-compose build # build containers (usefull if changed) | |
docker-compose up # builds, (re)creates, starts, and attaches to containers for a service. | |
docker-compose up -d # same in detached mode | |
docker-compose up --force-recreate # stop all containers and recreate | |
docker-compose up --build # rebuild custom images | |
docker-compose stop # stop but dont remove | |
docker-compose start # restart | |
docker-compose down # stop & remove containers |
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
git init projectname | |
git commit -a | |
git push origin master | |
git push remotename branchname | |
git clone https://github.com/USERNAME/REPOSITORY.git | |
git fetch remotename | |
git merge remotename/branchname | |
git pull remotename branchname |
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
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa | |
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa | |
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa |
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' | |
services: | |
neo4j: | |
image: neo4j:3.5 | |
restart: unless-stopped | |
ports: | |
- 7474:7474 | |
- 7687:7687 |
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
# Connect through ssh | |
ssh [email protected] | |
# Create the Linux user | |
sudo adduser username | |
# Check it | |
cat /etc/passwd | |
# Grant him sudo privileges (if needed) |
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.3" | |
networks: | |
# Allow the use of traefik in other docker-compose.yml files | |
traefik: | |
external: true | |
services: | |
traefik: |
OlderNewer