Skip to content

Instantly share code, notes, and snippets.

View hugopereira84's full-sized avatar

Hugo Pereira hugopereira84

View GitHub Profile
@hugopereira84
hugopereira84 / check_mods_emable
Last active October 3, 2016 21:43
Apache (Tips)
Check module rewrite is active:
$ ls /etc/apache2/mods-enabled | grep rewrite
If line above, returns empty, do the following:
$ sudo a2enmod rewrite && sudo service apache2 restart
@hugopereira84
hugopereira84 / new_gist_file_0
Created September 19, 2016 11:25
Optimize querys
Tools to optimize:
Anemometer - https://github.com/box/Anemometer/wiki
@hugopereira84
hugopereira84 / permissions_apache
Last active December 6, 2016 23:07
Files / folders permissions
Permissions in apache:
- folder: 0750/ 0755
- files: 0640 / 0644
@hugopereira84
hugopereira84 / create_mind_maps
Last active April 3, 2024 13:42
Tools to help managing websites
Collaborative Mind Maps:
https://coggle.it/#pricing
Work with agile:
https://www.sococo.com/
@hugopereira84
hugopereira84 / new_gist_file_0
Last active May 24, 2016 01:09
boost mysql
add in /etc/my.cnf:
----------------------------------------
key-buffer_size = 64M
sort_buffer_size = 32M
#
## thread buffers ##
#
sort_buffer_size = 5M
@hugopereira84
hugopereira84 / install_lamp_arch
Last active October 3, 2016 19:39
Arch Linux (helpers)
Install lamp server in arch linux:
- https://www.linode.com/docs/websites/lamp/lamp-server-on-arch-linux
- https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-arch-linux
@hugopereira84
hugopereira84 / best_pratices_laravel
Last active November 7, 2016 10:07
Best practices in Laravel
Validate forms:
. FormRequests (https://mattstauffer.co/blog/laravel-5.0-form-requests)
Use modules in laravel:
. pingpong-labs (https://github.com/pingpong-labs/modules)
Create repositories in laravel:
. http://heera.it/laravel-repository-pattern#.WCBSDnWLTQ3
@hugopereira84
hugopereira84 / new_gist_file_0
Created March 12, 2016 10:39
debian, install wifi drivers
go to :
https://packages.debian.org/jessie/all/firmware-realtek/download
install:
sudo dpkg -i firmware-realtek_0.43_all.deb
@hugopereira84
hugopereira84 / git_remove
Last active October 3, 2016 20:36
Making git “forget” about a file that was tracked but is now in .gitignore
Making git “forget” about a file that was tracked but is now in .gitignore:
.gitignore will prevent untracked files from being added (without an add -f) to the set of files tracked by git, however git will continue to track any files that are already being tracked.
To stop tracking a file you need to remove it from the index. This can be achieved with this command.
Files:
git rm --cached <file>
The removal of the file from the head revision will happen on the next commit.
Directory:
git rm -r --cached <folder>
@hugopereira84
hugopereira84 / git_change
Last active June 20, 2025 17:25
Git, show all changed files
Assuming you mean you haven't yet committed, and want to package up all of the files that currently have local modifications, you can get the list of modified files with git ls-files --modified. If you want the files which were changed by the last commit, you could use git diff --name-only HEAD^. Where you go from there is up to you.
Examples:
zip modified-files.zip $(git ls-files --modified)
cp $(git ls-files --modified) ../modified-files
Note that this is using the versions of files in the working tree currently.
If you have spaces in filenames, you'll have to go to a little more trouble.
(Of course, depending on what you're really trying to do, you might be looking for git stash, which stashes away all modified files and leaves you with a clean working tree, or you could simply want to make a temporary branch to commit to.)