Skip to content

Instantly share code, notes, and snippets.

View PeterTough2's full-sized avatar

Chijioke Peter PeterTough2

View GitHub Profile
@PeterTough2
PeterTough2 / sqlsrv_test.php
Created May 3, 2020 13:37 — forked from MCF/sqlsrv_test.php
PDO sqlsrv PHP driver, connect and query SQL Server database - reduced test case.
<?php
$serverName = "sqlserver.example.com";
$database = "myDbName";
$uid = 'sqlserver_username';
$pwd = 'password';
try {
$conn = new PDO(
"sqlsrv:server=$serverName;Database=$database",
$uid,
<?php
/**
* Catch php output buffering data over jQuery AJAX
*
* @author: Sohel Rana (me.sohelrana@gmail.com)
* @author url: https://blog.sohelrana.me
* @link: https://blog.sohelrana.me/catch-php-output-buffering-data-jquery-ajax/
* @licence MIT
*/
@PeterTough2
PeterTough2 / install_pdo_sqlsrv.sh
Created July 3, 2020 18:48 — forked from joecampo/install_pdo_sqlsrv.sh
Install Official MSSQL driver for Unbuntu 14.04 - pdo_sqlsrv
#!/bin/bash
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo -i export CPPFLAGS="-DSIZEOF_LONG_INT=8"
sudo apt-get -y install gcc-5 g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
cd ~
echo "Configuring the unixODBC 2.3.1 Driver Manager"
@PeterTough2
PeterTough2 / gist:7f74e077e1c8186232ca0a9361a82522
Created January 10, 2021 13:42 — forked from tayvano/gist:6e2d456a9897f55025e25035478a3a50
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@PeterTough2
PeterTough2 / ffmpeg.md
Created January 10, 2021 13:43 — forked from steven2358/ffmpeg.md
FFmpeg cheat sheet
@PeterTough2
PeterTough2 / zip-files-with-password.md
Created April 8, 2021 05:36 — forked from githubgobi/zip-files-with-password.md
Creating encrypted ZIP files with password in PHP

Creating encrypted ZIP files with password in PHP

You need at least PHP 7.2 to encrypt ZIP files with a password.

<?php

$zip = new ZipArchive();

$zipFile = __DIR__ . '/output.zip';
@PeterTough2
PeterTough2 / clean-up-boot-partition-ubuntu.md
Created October 21, 2021 08:12 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@PeterTough2
PeterTough2 / ubuntu20.04_php7.4_sqlsrv.sh
Created November 8, 2023 20:41 — forked from leidison/ubuntu20.04_php7.4_sqlsrv.sh
Install PHP 7.4 and SQLSRV on Ubuntu 20.04
#!/bin/bash
#ubuntu 20.04
#php7.4
# install php ppa
apt -y install software-properties-common
add-apt-repository ppa:ondrej/php -y
apt update