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
| #!/usr/bin/env bash | |
| # French Guide : https://github.com/FredBezies/arch-tuto-installation | |
| # Install ARCH Linux with UEFI | |
| # The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description. | |
| # Download the archiso image from https://www.archlinux.org/ | |
| # Copy to a usb-drive | |
| dd if=archlinux.img of=/dev/sdX bs=16M status=progress && sync # on linux |
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
| # Fill all empty space with zero | |
| # @see https://seshagiriprabhu.wordpress.com/2012/11/22/shrink-virtualbox-image-and-export-it-into-and-ovaovf-file-format/ | |
| sudo dd if=/dev/zero of=/bigemptyfile | |
| sudo rm -rf /bigemptyfile | |
| # If the free space on the guest OS is not much left, you can use the following alternative: | |
| # cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill |
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 | |
| # scp-speed-test.sh | |
| # Author: Alec Jacobson alecjacobsonATgmailDOTcom | |
| # http://www.alecjacobson.com/weblog/?p=635 | |
| # | |
| # Test ssh connection speed by uploading and then downloading a 10000kB test | |
| # file (optionally user-specified size) | |
| # | |
| # Usage: | |
| # ./scp-speed-test.sh user@hostname [test file size in kBs] |
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
| <?php | |
| class CSVStream { | |
| /** | |
| * List of available source fields. | |
| * | |
| * @var array | |
| */ | |
| protected $fields = array(); |
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
| <?php | |
| // Подключаемся к бд. первый параметр - линк к бд вида "драйвер:host=хост;port=порт;dbname=имя_бд | |
| // Второй и третий параметры - логин и пас соответственно | |
| $db = new PDO( | |
| "mysql:host=localhost;port=3306;dbname=tmp_db", | |
| "root", | |
| "*************" | |
| ); |
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
| <?php | |
| // Основные команды и сниппеты при использовании PDO | |
| //Соединение с БД | |
| $db = new PDO('mysql:host=localhost;dbname=mini-site', 'root', ''); | |
| // 1. Выбор данных из БД без защиты | |
| $username = 'Joker'; | |
| $password = '555'; |
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
| # Stop all containers | |
| docker stop `docker ps -qa` | |
| # Remove all containers | |
| docker rm `docker ps -qa` | |
| # Remove all images | |
| docker rmi -f `docker images -qa ` | |
| # Remove all volumes |