- https://cheatsheets.zip/
- https://devhints.io/
- https://learnxinyminutes.com/
- https://github.com/gto76/python-cheatsheet
- https://guialinux.uniriotec.br
- https://quickref.me/
- https://yoksel.github.io/flex-cheatsheet/
- https://git.uwaterloo.ca/-/snippets/117
- https://gist.github.com/beyonddream/a43e067db6336b03a2c4fc5da59ba507
- https://crontab.guru/
Variable | Description |
---|---|
%APPDATA% |
Path to the current user's Application Data folder |
%TEMP% |
Path to the temporary folder for the current user |
%USERPROFILE% |
Path to the current user's profile folder |
%PROGRAMFILES% |
Path to the Program Files folder |
%SYSTEMROOT% |
Path to the Windows installation directory |
%USERNAME% |
Current user's username |
%WINDIR% |
Path to the Windows directory |
%HOMEPATH% |
Path to the current user's home folder |
%LOCALAPPDATA% |
Path to the current user's local AppData folder |
shell:startup |
AppData\Roaming/Microsoft/Windows/Start Menu/Programs/Startup folder |
Shortcut | Program |
---|---|
control |
Control Panel |
sysdm.cpl |
System Properties |
ncpa.cpl |
Network Connections |
appwiz.cpl |
Programs and Features |
desk.cpl |
Display Properties |
firewall.cpl |
Windows Firewall |
inetcpl.cpl |
Internet Options |
timedate.cpl |
Date and Time |
mmsys.cpl |
Sound |
powercfg.cpl |
Power Options |
devmgmt.msc |
Device Manager |
compmgmt.msc |
Computer Management |
services.msc |
Services |
taskmgr |
Task Manager |
ps -A --format=pcpu,args --sort=-pcpu | head -n 11 | cut -c 1-100
sudo service --status-all
sudo service smbd status
sudo service smbd start
sudo service smbd stop
sudo systemctl list-units | grep smbd.service
sudo systemctl list-units | grep docker.service
sudo systemctl start docker.service
sudo systemctl stop docker.service
sudo systemctl enable docker.service
sudo systemctl disable docker.service
sudo systemctl status docker.service
Copy files from server to local:
scp [email protected]:/folder/*.* /local/folder/
Copy files from local to server:
scp /local/folder/*.* [email protected]:/folder/
In this example, the server IP is 192.168.1.55
Add read/write permissions recursivelly for all groups in all files/folders:
sudo chmod -R a+rw /path/to/folder
Comando | C# | Node | Python |
---|---|---|---|
String interpolation | $"my name is {name}" |
`my name is ${name}` |
f'my name is {name}' (new)"my name is {}".format(name) |
ENV vars | Mac | Linux | PowerShell |
---|---|---|---|
Show all | echo $ENV |
printenv |
dir env: |
Show one | echo $ENV_VAR |
echo $ENV_VAR |
dir env:JAVA_HOME |
Add new | export NEW_VAR=value |
export NEW_VAR=value |
$env:NEW_VAR = "value" |
Comando | Linux / Mac | cmd or Powershell |
---|---|---|
AND operator (vários comandos) | && |
&& |
Line Break (útil para linhas muito grandes) | \ |
^ para cmd e 'backtick' para powershell |
Exibir caminho de app no path | which |
where |
Localizar arquivo | find ./ -iname "*teste*" |
dir -Recurse teste.txt |
Variáveis de ambiente | env export VAR1=teste echo $VAR1 |
set set VAR1=teste echo %VAR1% Get-ChildItem Env:VAR1 Set-Item -Path Env:VAR1 -Value "teste" |
Persistir variáveis de ambiente | /etc/enviromment ~/.bachrc /etc/profile |
Windows + R, type: rundll32 sysdm.cpl,EditEnvironmentVariables or, type: SETX FOO BAR |
Testar uma porta | Telnet 192.168.1.55 80 nc -vz 192.168.1.55 80 |
Telnet 192.168.1.55 80 |
Command substitution | $(pwd) or `pwd` |
não tem |
Flush DNS | sudo killall -HUP mDNSResponder; say dns cleared (mac) sudo /etc/init.d/networking restart linux |
ipconfig /flushdns |
Watch file | tail -f /var/log/syslog |
Get-Content -Path "C:\scripts\test.txt" -Wait |
remove all | rm -rf folder |
Remove-Item -Force -Recurse folder |
create file | touch file.txt |
New-Item file.txt |
Objetivo | Comando |
---|---|
Stash one file | git stash push -m "message" -- test.txt |
Stash untracked files | git stash push -m "message" -u |
Apply staged too | git stash apply --index |
Apply specific stashed | git stash apply stash@{0} |
Objetivo | Comando |
---|---|
Baixar uma imagem | docker pull mcr.microsoft.com/dotnet/core/runtime:3.1 |
Listar imagens: | docker image list --all |
Remover uma imagem | docker image rm mcr.microsoft.com/dotnet/core/runtime:3.1 |
Remover imagens sem container associado | docker image prune --all |
Criar/Executar container (1) | docker run --name dotnet31 -it --rm --privileged mcr.microsoft.com/dotnet/core/runtime:3.1 /bin/bash |
Criar/Executar container (2) | docker run --name ubuntu -it --rm --privileged -p 445:445 ubuntu:20.04 /bin/bash |
Criar/Executar container (3) | docker run -it --rm --entrypoint /bin/bash app1 (override entrypoint) |
Objetivo | Comando |
---|---|
Criar container | docker container create -it --name 31 --privileged -v c:\temp:/home mcr.microsoft.com//core/runtime:3.1 /bin/bash |
Listar containers | docker container list --all |
Iniciar container | docker container start 31 |
Copiar arquivos para container | docker cp bin/. 31:home/bin |
Conectar em um container | docker container exec -it 31 /bin/bash |
Acompanhar logs | docker logs --follow 31 |
Parar container | docker container stop 31 |
Remover container | docker container rm 31 |
Remover containers parados | docker container prune |
Limpar tudo (!!!!) | docker system prune --all |
Objetivo | Comando |
---|---|
Docker compose "iterativo" | sudo docker-compose run --rm service1 |
Exemplo de docker-compose.yml "iterativo":
version: "3"
services:
service1:
image: mcr.microsoft.com//core/runtime:3.1
stdin_open: true
tty: true
command: "/bin/bash"
docker system prune --all
docker volume prune
dotnet publish --configuration release --runtime linux-x64
dotnet publish --configuration release --runtime osx-x64 --self-contained true -p:PublishSingleFile=true
dotnet publish --configuration Release --runtime win-x64 --self-contained -p:PublishSingleFile=true -p:PublishTrimmed=true
dotnet nuget locals all --clear
Instalar os plugins:
- EditorConfig for VS Code
- ESLint
- vscode-icons
Configurar o settings.json (CTRL + SHIFT + P) - Preferences - Open Settings:
{
"editor.fontFamily": "'Source code pro', Consolas, 'Courier New', monospace",
"editor.fontSize": 14,
"window.zoomLevel": 0,
"workbench.startupEditor": "newUntitledFile",
"workbench.iconTheme": "vscode-icons",
"vsicons.presets.foldersAllDefaultIcon": true,
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"workbench.colorCustomizations": {
"tab.activeBorderTop": "#ff0000"
}
}
- Open the Command Palette (Ctrl+Shift+P) and type 'shell command' to find the Shell Command:
- Install 'code' command in PATH command.
Subnet CIDR examples:
+--------+-----------------+
| CIDR | Subnet Mask |
+--------+-----------------+
| /32 | 255.255.255.255 |
| /24 | 255.255.255.0 |
| /16 | 255.255.0.0 |
| /8 | 255.0.0.0 |
+--------+-----------------+
Atalhos do Windows:
- Network connections => Win+R ncpa.cpl
- more...
- more...
- etc...
Tirar o "verdão" do background da exibição dos diretórios no comando ls
.
Colocar isso no .bashrc
da pasta home
do usuário.
LS_COLORS='ow=01;36;40'
export LS_COLORS
CTRL + D no Visual Studio igual ao Visual Studio Code: Tools => Options => Keyboard => Show Command containing string:
Edit.InsertNextMatchingCaret
Edit.Duplicate
ssh no git:
ssh-keygen -t rsa -b 4096 -C "[email protected]"
Fonte Source Code PRO
https://fonts.google.com/specimen/Source+Code+Pro
Instalar Java runtime 8 no MAC (pra usar com o VSTABI):
https://www.java.com/en/download/mac_download.jsp
Instalar o Java Development Kit 8 no MAC (pra desenvolver com o Eclipse):
https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
Link direto para o MAC OSX Mojave: https://itunes.apple.com/us/app/macos-mojave/id1398502828?ls=1&mt=12
Muito bom: https://loading.io/css/
trocar cor da janela do windows não ativado (chipa Microsoft!!!):
https://superuser.com/questions/1245923/registry-keys-to-change-personalization-settings
remove windows 10 watermark https://www.youtube.com/watch?v=X-E7syOcPEE
https://coderwall.com/p/7smjkq/multiple-ssh-keys-for-different-accounts-on-github-or-gitlab
find ./* | xargs xattr -r -d com.apple.quarantine
Dica do Akita
As Administrator!!!!
wmic diskdrive list brief
wsl --mount \\.\PHYSICALDRIVE1
echo $env:JAVA_HOME
dotnet nuget locals all --clear
The root account is disabled by default in Ubuntu, so there is no root password, that's why su fails with an authentication error.
WIP
Command | Visual Studio | Visual Studio Code | LunarVim | Rider |
---|---|---|---|---|
Info (Hover) | Ctrl + K, Ctrl + I |
Ctrl + K, Ctrl + I |
K |
Ctrl + Q |
Go to Definition | F12 |
F12 |
gd |
Ctrl + B / Ctrl + Click |
Go to Implementation | Ctrl + F12 |
Ctrl + F12 |
gD |
Ctrl + Shift + B |
Go to References | Shift + F12 |
Shift + F12 |
gr |
Alt + F7 |
Rename Symbol | Ctrl + R, Ctrl + R |
F2 |
:lua vim.lsp.buf.rename() |
Shift + F6 |
Refactoring | Ctrl + R, Ctrl + R |
Ctrl + Shift + R |
:lua vim.lsp.buf.code_action() |
Ctrl + Alt + Shift + T |
Format Document | Ctrl + K, Ctrl + D |
Shift + Alt + F |
:lua vim.lsp.buf.format() |
Ctrl + Alt + L |
Quick Fix | Ctrl + . |
Ctrl + . |
:lua vim.lsp.buf.code_action() |
Alt + Enter |
Peek Definition | Alt + F12 |
Alt + F12 |
:lua vim.lsp.buf.definition() |
Ctrl + Shift + I |
Navigate Back | Ctrl + - |
Alt + Left Arrow |
Ctrl + o |
Ctrl + Alt + Left |
Navigate Forward | Ctrl + Shift + - |
Alt + Right Arrow |
Ctrl + i |
Ctrl + Alt + Right |
Show Errors | Ctrl + Shift + M |
Ctrl + Shift + M |
:lua vim.diagnostic.open_float() |
Alt + 6 |
Open Terminal | Ctrl + ~ |
Ctrl + ` |
:term |
Alt + F12 |
Use sudo to become root:
sudo -i