Sapiens Search

How to rename a branch on git?


1-Go to your repository
cd /<Path to your git repository>
2-Type:
git branch -m <Old branch name> <New branch name>

Example

git branch -m blog garouBlog

How discover your local IP address on Linux?

1-Open terminal
2-Type
ifconfig <interface>
where interface is your name of your network interface
3-Look for
inet end.:

Example

ifconfig eth0
ifconfig eth1
ifconfig wlan0

Output

eth1 Link encap:Ethernet Endereço de HW 78:e4:00:22:f8:86
inet end.: 192.168.10.100 Bcast:192.168.10.255 Masc:255.255.255.0
endereço inet6: fe80::7ae4:ff:fe22:f886/64 Escopo:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Métrica:1
pacotes RX:371047 erros:0 descartados:0 excesso:0 quadro:221100
Pacotes TX:245369 erros:59 descartados:0 excesso:0 portadora:0
colisões:0 txqueuelen:1000
RX bytes:475482323 (475.4 MB) TX bytes:57852121 (57.8 MB)
IRQ:17

Arcam Sapientia

Some other usefull commands are, ifconfig, ifconfig -a to list all networks.

If you don't know the name of your network interface just type ifconfig and search in each result what you are looking for.

How to prevent Google Translate translate a text on a web page?

1-Add the text inside a element with the
class notranslate

Example

This text will be translated. 
But this text will be always in english.
The text above have a span class surrounding it.
< span class='notranslate'>Your text here.</span>

Arcam Sapientia

You can use this to write blogs like these one and write some codes that should be always the same.

PS.: soon this blog will implement this.

How to fit the terminal/console results on the screen?

<Your command> | less


Example

ps ax | less

Arcam Sapientia

Using this tip we can prevent the output results of our command scroll down to the end. Or, we can fit the results to the screen and pressing Enter see rest of the results

How to use ASCII characters on KDE?

1-Go to
System settings->Input devices->Keyboard->Advanced->Position of the compose key
2-Choose a option available, like Right Control
3-Test it typing
Righ_Control =  c
4-You get
€ 

Arcam Sapientia

This is the equivalent to the Alt on Windows systems.

How to change the keyboard layout for the console (Ctrl+Alt+F1)?

1-Go to the console
Press Control+Alt+F1, for example
2-Install the console-common package
sudo apt-get install console-common
3-Follow the instructions and choose your new keyboard layout
4-Test the new layout

 Arcam Sapientia

 To reconfigure your keybout layout run
sudo dpkg-reconfigure console-common
This tip is useful to us keyboard for foreign users.Users that have pipeline (|) missing can emulate it using this tip too.

How to run external programs/commands/functions in Sublime Text 2?

1-Preferences->Key Bindings - User
2- Override [`,`] to:
[
{ "keys": ["<Your shortucut>"], "command": "exec", "args": { "cmd"["<Path to your command>"]} }
]


Where <Your shortcut> could be f1, ctrl+shift+f1, etc. and <Path to your command> echo, /home/garou/scripts/my_script.py, ls, etc.

Example


    [
        { "keys": ["f1"], "command": "exec", "args": { "cmd": ["/media/data/Scripts/myScript"]} },
    ]


Arcam Sapientia

This virtually could run any system command.