Skip to content

Instantly share code, notes, and snippets.

@rzani
rzani / Using Byobu.md
Last active Aug 29, 2015
Using Byobu
View Using Byobu.md

Using byobu

What's byobu?

Byobu is a GPLv3 open source text-based window manager and terminal multiplexer. It was originally designed to provide elegant enhancements to the otherwise functional, plain, practical GNU Screen, for the Ubuntu server distribution. Byobu now includes an enhanced profiles, convenient keybindings, configuration utilities, and toggle-able system status notifications for both the GNU Screen window manager and the more modern Tmux terminal multiplexer, and works on most Linux, BSD, and Mac distributions.

Create new session

$ byobu new -s yourname
@rzani
rzani / remove github commit.md
Last active Aug 29, 2015
How to remove a commit that is already pushed to Github
View remove github commit.md

Using this is dangerous in a collaborative environment: you're rewriting history

$ git reset --hard <old-commit-id>
$ git push -f origin <branch>
@rzani
rzani / iTerm2 configs.md
Last active Aug 29, 2015
iTerm2 configuration and tricks
View iTerm2 configs.md

iTerm2 home and end of line config

FOR   ACTION          SEND
⌘←    "HEX CODE"      0x01 
⌘→    "HEX CODE"      0x05
⌥←    "SEND ESC SEQ"  b
⌥→    "SEND ESC SEQ"  f
View get ip aws ec2
Public IP
curl http://169.254.169.254/latest/meta-data/public-ipv4
Local IP
curl http://169.254.169.254/latest/meta-data/local-ipv4
@rzani
rzani / min-responsive.css
Last active Aug 29, 2015
Default responsive css
View min-responsive.css
img {
max-width: 100%;}
/* Structure */
.container {
max-width: 1128px;
margin: 0 auto;}
/* Clearfix */
@rzani
rzani / setBrightness.md
Last active Sep 1, 2015
Salvar configuração do brilho de tela Linux
View setBrightness.md

Abra o terminal e digite o seguinte comando para retornar o diretório das configurações de brilho:

ls /sys/class/backlight

NOTA: No meu caso o diretório chama intel_backlight

View Fixing a Corrupted UEFI Partition in Windows 8 or 8.1
We get this question often lately. Here's the scenario:
I was trying to re-size or copy my UEFI (Unified Extensible Firmware Interface) for one reason or another and now I can't boot my Windows 8 or 8.1 PC.
There are some free software solutions out there some seem to work some don't. Most often when we receive this question the user has tried to use the Windows Copy command and the Windows Disk Management Tool (WDMT) to copy the UEFI partitions contents to larger partition, then uses the WDMT to delete the old UEFI partition then re-size the new one, set the new UEFI partition to active and then re-boot. This is were the trouble starts. At this point the BCD store is corrupted and the system will not boot. Here is a fix that I hope will help.
Firstly, boot from a Windows 8 recovery drive (CD/DVD/USB). If you don't have a recovery drive (and this is likely because most new machines don't come with one), then you will either have to install the drive into another Windows 8 machine or obtain a Windows 8 rec
@rzani
rzani / howto.md
Created Oct 25, 2015
Fixing a Corrupted UEFI Partition in Windows 8 or 8.1
View howto.md

We get this question often lately. Here's the scenario:

I was trying to re-size or copy my UEFI (Unified Extensible Firmware Interface) for one reason or another and now I can't boot my Windows 8 or 8.1 PC.

There are some free software solutions out there some seem to work some don't. Most often when we receive this question the user has tried to use the Windows Copy command and the Windows Disk Management Tool (WDMT) to copy the UEFI partitions contents to larger partition, then uses the WDMT to delete the old UEFI partition then re-size the new one, set the new UEFI partition to active and then re-boot. This is were the trouble starts. At this point the BCD store is corrupted and the system will not boot. Here is a fix that I hope will help.

Firstly, boot from a Windows 8 recovery drive (CD/DVD/USB). If you don't have a recovery drive (and this is likely because most new machines don't come with one), then you will either have to install the drive into another Windows 8 machine or obtain a Windows 8 rec

View free disk and memory
selection=
until [ "$selection" = "0" ]; do
echo "
PROGRAM MENU
1 - Display free disk space
2 - Display free memory
0 - exit program
"
echo -n "Enter selection: "
View Swapping alt and ctrl keys.md

To do this manually you want to create a file called .Xmodmap in your home directory. You could do this using a command from the terminal

~$ gedit ~/.Xmodmap

That will create the file and open it in gedit. Add the following lines to the file:

clear control