Skip to content

Instantly share code, notes, and snippets.

View wellington1993's full-sized avatar
🏠
Working from home

Wellington Torrejais da Silva wellington1993

🏠
Working from home
View GitHub Profile
@wellington1993
wellington1993 / Adjust screen bightness in LXDE
Created April 11, 2022 20:43 — forked from tkdchen/Adjust screen bightness in LXDE
Add this piece of configuration into ~/.config/openbox/lxde-rc.xml. Then, Fn+Home and Fn+End can increase and decrease screen's brightness individually. After saving, issue command ``$ openbox --reconfigure`` to load new configuration.
<keybind key="XF86MonBrightnessUp">
<action name="Execute">
<command>xbacklight -inc 10%</command>
</action>
</keybind>
<keybind key="XF86MonBrightnessDown">
<action name="Execute">
<command>xbacklight -dec 10%</command>
</action>
</keybind>
@wellington1993
wellington1993 / mysql_backup.sh
Created July 29, 2021 18:57 — forked from tleish/mysql_backup.sh
Bash Script to backup all MySQL databases
#!/bin/bash
#==============================================================================
#TITLE: mysql_backup.sh
#DESCRIPTION: script for automating the daily mysql backups on development computer
#AUTHOR: tleish
#DATE: 2013-12-20
#VERSION: 0.4
#USAGE: ./mysql_backup.sh
#CRON:
# example cron for daily db backup @ 9:15 am
@wellington1993
wellington1993 / config.md
Created January 10, 2020 21:19 — forked from 0XDE57/config.md
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable.

I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

@wellington1993
wellington1993 / config.md
Created January 10, 2020 21:18 — forked from ivermac/config.md
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable.

I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

# Ways to execute a shell script in Ruby
# Example Script - Joseph Pecoraro
cmd = "echo 'hi'" # Sample string that can be used
# 1. Kernel#` - commonly called backticks - `cmd`
# This is like many other languages, including bash, PHP, and Perl
# Returns the result of the shell command
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111
@wellington1993
wellington1993 / domain.xml
Created September 27, 2019 00:17 — forked from Informatic/domain.xml
How to use Windows 10 OEM license in libvirt VM (<smbios mode='host' /> does not work as Windows seems to verify UUID; apparmor/security configuration changes may be needed)
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<!-- ... -->
<qemu:commandline>
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/some/path/slic.bin'/>
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/some/path/msdm.bin'/>
<qemu:arg value='-smbios'/>
<qemu:arg value='file=/some/path/smbios_type_0.bin'/>
<qemu:arg value='-smbios'/>
@wellington1993
wellington1993 / gist:40b4a2b666c511863112f596e8754df4
Created July 29, 2019 13:46 — forked from kgaughan/gist:3772976
Aggressively compact a git repository
git fsck --unreachable
git reflog expire --expire=0 --all
git repack -a -d -l
git prune
git gc --aggressive
@wellington1993
wellington1993 / nil_empty_blank_present_ffdierence_in_ruby
Created July 4, 2019 20:22 — forked from pythonicrubyist/nil_empty_blank_present_ffdierence_in_ruby
Difference between nil?, empty?, blank? and present? in Ruby and Ruby on Rasils.
# nil? can be used on any Ruby object. It returns true only if the object is nil.
nil.nil? # => true
[].nil? # => false
{}.nil? # => false
"".nil? # => false
" ".nil? # => false
true.nil? # => false
# empty? can be used on some Ruby objects including Arrays, Hashes and Strings. It returns true only if the object's length is zero.
nil.empty? # NoMethodError: undefined method `empty?' for nil:NilClass
<!-- Prevent FOUC (flash of unstyled content) - http://johnpolacek.com/2012/10/03/help-prevent-fouc/ -->
<style type="text/css">
.no-fouc {display: none;}
</style>
<script type="text/javascript">
document.documentElement.className = 'no-fouc';
// add to document ready: $('.no-fouc').removeClass('no-fouc');
</script>
# ##############################################################################
# # URL REWRITES #
# ##############################################################################
# ------------------------------------------------------------------------------
# | Rewrite engine |
# ------------------------------------------------------------------------------
# Turning on the rewrite engine and enabling the `FollowSymLinks` option is
# necessary for the following directives to work.