Skip to content

Instantly share code, notes, and snippets.

@luisfc
luisfc / Create BASH Script Executable in whole System
Created April 19, 2017 14:54
Create BASH Script Executable in whole System
# Add execute permission to script
~/mipc> chmod +x script.sh
# Copy script in directory that your system.
# there are two directories to copy the executable script
# 1 - Only available for the user of the system - /usr/bin or /usr/local/bin
# 2 - For share in all users of the system - /usr/local/bin
#1 ~/mipc> sudo cp script.sh /usr/bin/script
#2 ~/mipc> sudo cp script.sh /usr/local/bin
@luisfc
luisfc / Resize images in Ubuntu
Last active June 13, 2017 19:36
Resize images in Ubuntu
sudo apt-get install nautilus-image-converter
#After finish the installation restart nautilus
killall nautilus
@luisfc
luisfc / Import and export tables in MySQL
Last active January 14, 2019 21:01
Import and export tables in MySQL
#Generating table backup:
mysqldump databaseName tableName > backup.sql -u user -p
#Restore table backup:
mysql -u root -p databaseName < backup.sql
@luisfc
luisfc / MYSQL - Copy data table1 to table2
Last active June 5, 2017 20:01
Copy data of one table to another table
INSERT INTO table2 SELECT * FROM table_origin;
INSERT INTO table2 (field1, field2) SELECT table_origin.field1, table_origin.field2 FROM table_origin
@luisfc
luisfc / Install_phpMyAdmin
Created April 10, 2017 04:38
Install phpMyAdmin
sudo apt-get update
sudo apt-get install phpmyadmin php-mbstring php-gettext
@luisfc
luisfc / Change permissions to directories or files
Created April 9, 2017 15:34
Change permissions to directories or files
#Change permissions recursively only to directories:
find . -type d -exec chmod -R 0755 {} \;
#Change permissions recursively only to files:
find . -type f -exec chmod -R 0644 {} \;
@luisfc
luisfc / install_drush
Created April 8, 2017 05:09
Install Drush
cd ~
$ wget --quiet -O - http://ftp.drupal.org/files/projects/drush-7.x-5.9.tar.gz
$ tar -zxf drush-7.x-5.9.tar.gz
$ ln -s ~/drush/drush /usr/local/bin/drush
$ drush
@luisfc
luisfc / selector not y nth-child css
Created April 5, 2017 23:32
selector not y nth-child css
#jQuery
jQuery("thead tr th:not(:nth-child(3n+2))").css("display", "none");
jQuery("tbody tr td:not(:nth-child(3n+2))").css("display", "none");
#css
thead tr th:not(:nth-child(3n+2)),
tbody tr td:not(:nth-child(3n+2)) {
display: none;
}
@luisfc
luisfc / fix mysql ubuntu
Created April 5, 2017 07:12
fix mysql ubuntu
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu trusty universe'
sudo apt-get update
sudo apt install mysql-server-5.6 * see note below if you get an error
sudo apt install mysql-client-5.6
####
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu trusty universe'
sudo apt-get update
sudo apt-get install mysql-server-5.6 mysql-client-5.6
@luisfc
luisfc / Install wireless drivers Lenovo T430u.txt
Created April 5, 2017 07:09
Installing Broadcom Wireless Drivers Lenovo T430u
lspci -knn | grep Net -A2
sudo apt-get install bcmwl-kernel-source
sudo apt-get install --reinstall bcmwl-kernel-source