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 | |
| if [[ $1 =~ ^[0-9]+$ ]] | |
| then | |
| cat /dev/urandom | tr -dc '[:graph:]' | head -c $1; echo | |
| else | |
| cat /dev/urandom | tr -dc '[:graph:]' | head -c 20; echo | |
| fi |
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
| # replace volume-alias with your preferred alias and /mnt/encrypted with your preferred mount point | |
| fdisk /dev/xvdb | |
| cryptsetup luksFormat /dev/xvdb1 | |
| cryptsetup luksOpen /dev/xvdb1 volume-alias | |
| mkfs.ext4 /dev/mapper/volume-alias | |
| mkdir /mnt/encrypted | |
| mount /dev/mapper/volume-alias /mnt/encrypted | |
| umount /dev/mapper/volume-alias | |
| cryptsetup luksClose volume-alias |
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
| const main = () => | |
| { | |
| const node = new Ipfs(); | |
| node.on('ready', () => | |
| { | |
| document.getElementById('files').addEventListener('change', handleFileSelect, false); | |
| }); | |
| const handleFileSelect = (event) => |
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
| using System; | |
| using System.Security.Cryptography; | |
| public class PBKDF2 | |
| { | |
| private int hashBytes; | |
| private int saltBytes; | |
| private int iterations; | |
| public PBKDF2(int _hashBytes, int _saltBytes, int _iterations) |
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
| using System; | |
| using System.IO; | |
| using System.Security.Cryptography; | |
| using System.Text; | |
| class AES | |
| { | |
| public static string Encrypt(string plainText, string keyString) | |
| { | |
| byte[] cipherData; |
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
| const toSmartDate = (date) => | |
| { | |
| const year = date.getFullYear() * 10000; | |
| const month = (date.getMonth()+1) * 100; | |
| const day = date.getDate(); | |
| return year + month + day; | |
| } | |
| const fromSmartDate = (smartDate) => | |
| { |
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
| ffmpeg -loop 1 -framerate 1 -i image.jpg -i music.mp3 -c:v libx264 -preset veryslow -crf 0 -c:a copy -shortest output.mkv |
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
| foreach (DataRow task in tasks) | |
| { | |
| DataRow manufacturer = GetManufacturer(Convert.ToInt32(task["ManufacturerID"])); | |
| DataRowCollection recipients = GetRecipients(Convert.ToInt32(task["ManufacturerID"])); | |
| if (recipients.Count > 0) | |
| { | |
| DataSet results = GetResults(Convert.ToDateTime(task["StartDate"]), Convert.ToDateTime(task["EndDate"]), Convert.ToInt32(task["ManufacturerID"])); | |
| ExcelPackage package = new ExcelPackage(); | |
| ExcelWorksheet worksheet = package.Workbook.Worksheets.Add("Sheet1"); |
OlderNewer