This file contains 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 | |
# Bash script to set up local site using LAMP on Ubuntu | |
# Requires Apache2, MySQL, mkcert (https://github.com/FiloSottile/mkcert) | |
# See also sitedrop.sh https://gist.github.com/jonattanbossenger/4950e107b0004a8ee82aae8b123cce58 | |
# This version improved by @haydar on github | |
if [[ $EUID -ne 0 ]]; | |
then |
This file contains 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 | |
add_filter( 'wp_unique_post_slug', 'cpt_unique_slug_by_tax', 10, 6 ); | |
function cpt_unique_slug_by_tax( $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug ) { | |
if ( 'guide' === $post_type ) { | |
global $wpdb; | |
$post_tax = get_the_terms( $post_ID, 'guide_cat' ); | |
// Check if another CPT exists in the same taxonomy with the same name. |
This file contains 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
Starting Named Session | |
Named sessions are useful when you run multiple screen sessions. To create a named session, run the screen command with the following arguments: | |
screen -S session_name | |
It’s always a good idea to choose a descriptive session name. | |
Working with Linux Screen Windows | |
When you start a new screen session, it creates a single window with a shell in it. |
This file contains 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
{ | |
"name": "webpack-dev", | |
"version": "1.0.0", | |
"description": "Webpack development workflow with laravel-mix", | |
"main": "index.js", | |
"scripts": { | |
"dev": "npm run development", | |
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | |
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | |
"hot": "cross-env NODE_ENV=development webpack-dev-server --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", |
This file contains 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 | |
# | |
# Резервное копирование каталогов и файлов из домашнего каталога | |
# Этот командный скрипт можно автоматически запускать при помощи cron | |
# | |
DATE=`date +%F` # This Command will add date in Backup File Name. | |
TIME=`date +%H-%M-%S` # This Command will add time in Backup File Name. | |
COMPNAME=EB | |
DESDIR=/home/anwas/clouds/nextCloud-eb/personal-share/backups_srv # Destination of backup file. |
This file contains 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
git init | |
git add . | |
git commit -a -m "Initial commit" | |
git tag -a 1.0.0 | |
git tag -n | |
git checkout -b develop master | |
git checkout -b feature-clean-footer develop | |
git checkout develop |
This file contains 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
## https://utappia.org/2016/04/22/how-to-search-install-remove-snap-packages-in-ubuntu/ | |
## https://docs.snapcraft.io/core/usage | |
## https://www.youtube.com/watch?v=5F-1cuBfSm0 | |
sudo snap find : To list the available packages | |
sudo snap install <package name>: To install a package | |
sudo snap list: To view all the installed snap packages | |
sudo snap changes: To view a list of logged actions | |
sudo snap refresh <package name>: To upgrade a package to its latest available version |
This file contains 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
From the boot menu, select recovery mode, which is usually the second boot option. | |
The root account is the ultimate administrator and can do anything to the Ubuntu installation (including erase it), so please be careful with what commands you enter in the root terminal. | |
In recent versions of Ubuntu, the filesystem is mounted as read-only, so you need to enter the follow command to get it to remount as read-write, which will allow you to make changes: | |
mount -o rw,remount | |
If you have forgotten your username as well, type | |
ls /home | |
This file contains 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
## Add repository | |
### https://launchpad.net/%7Eondrej/+archive/ubuntu/php | |
### https://launchpad.net/~ondrej/+archive/ubuntu/apache2 | |
sudo add-apt-repository ppa:ondrej/php | |
sudo add-apt-repository ppa:ondrej/apache2 | |
sudo apt-get update | |
sudo apt-get dist-upgrade | |
NewerOlder