Can be use full for scp or ssh command line, usually i use it to connect with my aws machines.
This is another security layer with security groups.
Check the image to see instructions to convert your ppk file which you already use to connect with your instance to id_rsa file (openssh)
in this gist https://gist.github.com/soft2help/50574f23996f79ffc19712a1efb53d34 we use it to refresh vendor folder in a php project

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE USER 'USERNAME'@'%' IDENTIFIED BY 'PASSWORD'; | |
| GRANT ALL PRIVILEGES ON DATABASE_NAME.* TO 'USERNAME'@'%'; | |
| FLUSH PRIVILEGES; |
We can't make this file beautiful and searchable because it's too large.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Andalucía;Almería;Abla;37.14114;-2.780104;871.1684;1504;783;721 | |
| Andalucía;Almería;Abrucena;37.13305;-2.797098;976.9387;1341;682;659 | |
| Andalucía;Almería;Adra;36.74807;-3.022522;10.97898;24373;12338;12035 | |
| Andalucía;Almería;Albánchez;37.2871;-2.181163;481.3123;815;422;393 | |
| Andalucía;Almería;Alboloduy;37.03319;-2.62175;388.4346;674;334;340 | |
| Andalucía;Almería;Albox;37.38979;-2.147483;426.4268;11178;5731;5447 | |
| Andalucía;Almería;Alcolea;36.97449;-2.961038;744.6956;908;486;422 | |
| Andalucía;Almería;Alcóntar;37.33585;-2.596944;955.1331;603;315;288 | |
| Andalucía;Almería;Alcudia de Monteagud;37.23598;-2.266174;1018.354;141;74;67 | |
| Andalucía;Almería;Alhabia;36.9893;-2.587667;288.056;724;363;361 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set Path="C:\tmp\" | |
| for /f "tokens=*" %%a in ('dir /A:-D /B /O:-D /S %Path%') do set NEW=%%a&& goto:n | |
| :n | |
| echo %NEW% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set folder = "C:\tmp" | |
| set fileExtension = ".txt" | |
| set daysOlder = 90 | |
| forfiles -p %folder% -s -m *%fileExtension% /D -%daysOlder% /C "cmd /c del @path" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd ~ | |
| sudo apt-get update | |
| sudo apt install libldap2-dev | |
| sudo apt install apache2-dev | |
| sudo apt install libgmp-dev | |
| sudo ln -sf /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/libldap.so | |
| sudo ln -sf /usr/lib/x86_64-linux-gnu/liblber.so /usr/lib/liblber.so | |
| sudo ln -sf /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h | |
| wget https://github.com/php/php-src/archive/php-7.2.2.tar.gz | |
| tar --extract --gzip --file php-7.2.2.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| This is the table with inserts about territorial organization in spain (Comunidades, provincias, localidades) | |
| https://es.wikipedia.org/wiki/Organizaci%C3%B3n_territorial_de_Espa%C3%B1a | |
| Organización territorial de España | |
| */ | |
| create table if not exists OTEComunidad | |
| ( | |
| Comunidad varchar(256) not null, | |
| Id int auto_increment | |
| primary key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // in first place you should install domir.regreplace and enable it after in your settings.json inside .vscode folder or in global settings | |
| // Each time that the file is save it will put first brace in same line of declaration | |
| //in here i use it to php file but can be any file that you want. check the extension documentation https://marketplace.visualstudio.com/items?itemName=DomiR.regreplace | |
| { | |
| "regreplace.commands": [ | |
| { | |
| "name": "brace on same line", | |
| "match": "\\.php?$", | |
| "regexp": "\\)(\\s*)\\n(\\s*)\\{(\\s*)\\n", | |
| "global": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #refresh project folder to help your ide for example from remote ssh access server, | |
| #you should have 7zip tool to windows and also your certificate to ssh server access | |
| #check how get certificate https://gist.github.com/soft2help/1a037fc08ade3be87418ce50a0383063 | |
| #you should place in folder that will containt project folder in your localproject | |
| #Usually i put it inside the folder .vscode folder and call it from a shortcut that i have in my powershell modules check https://github.com/soft2help/powershell-profile | |
| #of course that you can use this script to update local from remote any folder that you want, this is an example with vendor | |
| #PAY ATTENTION BECAUSE IN FIRST LINE OF SCRIPT REMOVE EVERYTHING EXCEPTS THE .vscode FOLDER, before download it from the remote | |
| Get-ChildItem -Path '*' -Recurse | Where-Object {($_.FullName -notlike "*.vscode*")} | Remove-Item -Recurse -ErrorAction SilentlyContinue | |
| Remove-Item -Recurse -Force project.tar.gz -ErrorAction SilentlyContinue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| apt-get update -y | |
| apt-get install -yqq automake autotools-dev fuse g++ git libcurl4-openssl-dev libfuse-dev libssl-dev libxml2-dev make pkg-config | |
| cd /home | |
| if [ ! -d "/home/s3fs-fuse" ] ; then | |
| git clone https://github.com/s3fs-fuse/s3fs-fuse.git | |
| cd s3fs-fuse | |
| ./autogen.sh | |
| ./configure | |
| make |
NewerOlder