Skip to content

Instantly share code, notes, and snippets.

@sun4lower
sun4lower / addUser2UserGroup.sh
Created October 7, 2018 14:05
将指定用户添加到用户组
# 将www用户添加到sunflower用户组中,-a代表append
sudo usermod -a -G sunflower www
@sun4lower
sun4lower / navicat.desktop
Created September 29, 2018 02:26
create navicat desktop
[Desktop Entry]
Encoding=UTF-8
Name=Navicat
Comment=Navicat Premium
Exec=/opt/Navicat/start_navicat
Icon=/opt/Navicat/navicat.png
Terminal=false
StartupNotify=true
Type=Application
Categories=Application;Development;
@sun4lower
sun4lower / Fatal error: Class 'PHPUnit_Framework_TestCase' not found
Created August 20, 2018 03:34
Fatal error: Class 'PHPUnit_Framework_TestCase' not found in ...
Fatal error: Class 'PHPUnit_Framework_TestCase' not found
You want to use PHPUnit 6
PHPUnit 6 requires PHP 7.0 or PHP 7.1. It introduces significant changes that require a migration of your existing test suite to PHPUnit 6.
If you use Composer to manage PHPUnit as a dependency of your project and want to use PHPUnit 6 then you should depend on "phpunit/phpunit": "^6.0" in your composer.json file.
If you use PHPUnit from a PHP archive (PHAR) and want to use PHPUnit 6 then you can download PHPUnit from https://phar.phpunit.de/phpunit.phar.
Below you find a list of things to do and keep in mind while migrating your existing test suite to PHPUnit 6:
@sun4lower
sun4lower / InstallPHPUnit.sh
Created August 20, 2018 03:24
Download and Install PHPUnit.
wget http://phar.phpunit.cn/phpunit.phar
wget https://phar.phpunit.de/phpunit-nightly.phar
chmod +x phpunit.phar
sudo mv phpunit.phar /usr/local/bin/phpunit
phpunit --version
@sun4lower
sun4lower / installNginx.sh
Created August 16, 2018 08:29
Nginx Install
##Nginx安装指南
#1、编译环境
#ubuntu
apt-get install build-essential
apt-get install libtool
#centos
yum -y install gcc automake autoconf libtool make
@sun4lower
sun4lower / downloadComposer.sh
Created August 16, 2018 08:25
download composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
@sun4lower
sun4lower / arr.c
Last active March 17, 2018 11:20
The memory in computer
#include <stdio.h>
int main()
{
int a = 3;
int b = 2;
int array[3];
array[0] = 1;
array[1] = 10;
array[2] = 100;
@sun4lower
sun4lower / LastExecuted
Last active March 16, 2018 09:25
Expands to the exit status of the most recently executed foreground pipeline.
echo $?
if [$? -eq 0]; then
# do something
else
# do something else
fi
@sun4lower
sun4lower / LC_ALL
Created March 16, 2018 07:13
when type yum in centos Failed to set locale, defaulting to C
echo "export LC_ALL=en_US.UTF-8" >> /etc/profile
source /etc/profile
@sun4lower
sun4lower / ShowEngine
Created March 15, 2018 13:40
Issue the SHOW ENGINES statement to view the available MySQL storage engines. Look for DEFAULT in the InnoDB line.
SHOW ENGINES;