This file contains hidden or 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
| ((SELECT | |
| t.tablename as TableName, | |
| n.nspname AS TableSchema, | |
| a.attname as ColumnName, | |
| pg_catalog.format_type(a.atttypid, NULL) AS DbDataType, | |
| pg_catalog.col_description(a.attrelid, a.attnum) AS ColumnComment, | |
| (a.attnotnull = FALSE) AS IsNullable, | |
| p.conname AS PrimaryKeyConstraintName, | |
| f.conname AS ForeignKeyConstraintName, |
This file contains hidden or 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
| --- | |
| - hosts: all | |
| tasks: | |
| - name: Install prerequisites | |
| apt: | |
| name: ['python3-pip', 'python3-setuptools', 'virtualenv'] | |
| update_cache: yes | |
| - name: Install docker-compose | |
| pip: |
This file contains hidden or 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
| package com.keepithttps; | |
| import com.sun.nio.file.SensitivityWatchEventModifier; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.beans.factory.annotation.Value; | |
| import org.springframework.stereotype.Service; | |
| import java.io.File; |
This file contains hidden or 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 | |
| # | |
| # Diffusion youtube avec ffmpeg | |
| # Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée. | |
| VBR="2500k" # Bitrate de la vidéo en sortie | |
| FPS="30" # FPS de la vidéo en sortie | |
| QUAL="medium" # Preset de qualité FFMPEG | |
| YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube |
This file contains hidden or 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
| # Uses Bluez for Linux | |
| # | |
| # sudo apt-get install bluez python-bluez | |
| # | |
| # Taken from: https://people.csail.mit.edu/albert/bluez-intro/x232.html | |
| # Taken from: https://people.csail.mit.edu/albert/bluez-intro/c212.html | |
| import bluetooth | |
| def receiveMessages(): |
This file contains hidden or 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
| # First, make a dump of the database without data (-s) | |
| $ pg_dump -h localhost -U username -Fc -s -f db_dump dbName | |
| # Create a list of the functions | |
| $ pg_restore -l db_dump | grep FUNCTION > function_list | |
| # Restore the functions in an other database | |
| $ pg_restore -h localhost -U username -d other-dbName -L function_list db_dump |
This file contains hidden or 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 time | |
| import itchat | |
| import smtplib | |
| from email.mime.multipart import MIMEMultipart | |
| from email.mime.text import MIMEText | |
| from email.mime.image import MIMEImage | |
| def sendmail(data): |
This file contains hidden or 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 tornado.ioloop | |
| import tornado.web | |
| import tornado.httpserver | |
| import tornado.httputil | |
| import json | |
| class MainHandler(tornado.web.RequestHandler): | |
| def post(self): | |
| # do something useful | |
| name = self.get_argument('foo') |
This file contains hidden or 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
| # http://stackoverflow.com/questions/4544669/batch-convert-latin-1-files-to-utf-8-using-iconv | |
| find . -type f -exec bash -c 'iconv -f iso-8859-1 -t utf-8 "{}" > /path/to/destination/"{}"' \; |
This file contains hidden or 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
| alert(1); |