Skip to content

Instantly share code, notes, and snippets.

View marcoandre1's full-sized avatar
✌️
Enjoy your day!

Marco E marcoandre1

✌️
Enjoy your day!
View GitHub Profile
@marcoandre1
marcoandre1 / SSH-configuration-github-gitlab.md
Last active April 17, 2024 14:51
Managing SSH keys for Github and Gitlab

Managing SSH keys for Github and Gitlab

NOTICE: This guide will help you set ssh keys for GitHub and GitLab. However, this is not going to change your commit user.name or user.email. If you need to change those for specific repositories, just run the following commands while in your repository:

git config user.name "Your Name Here"
git config user.email your@email.com

For more info, see this answer. Also, keep in mind this only changes the .git folder inside your repository which never gets added/committed/pushed/uploaded.

I recently had to manage two ssh keys (one for Github and one for Gitlab). I did some research to find the best solution. I am justing putting the pieces together here.

@marcoandre1
marcoandre1 / Laravel.md
Last active November 26, 2022 21:25
Pluralsight Laravel tutorial notes

Getting Started wiht Laravel (PHP Framework) - The Basics

Setting up a project with Laravel

  1. PHP Environment Setup : Apache/Nginx, PHP, MySQL
  2. Download Composer : PHP Package Manager
  3. Install Laravel :

composer create-project --prefer-dist laravel/laravel FOLDER
example : composer create-project laravel/laravel getting-started
For more info, go to Laravel Documentation and follow the installation process.

@marcoandre1
marcoandre1 / SecuriteInformationRevision.md
Last active March 1, 2020 17:07
Révision de la sécurité de l'information

Séance 1


Pourquoi les enjeux de la sécurité sont-ils importants?

  • Évolution des technologies : de la sécurité de l'équipement à la sécurité de l'information
  • Ouverture sur le monde qui expose à plus de risques
  • Conséquences de plus en plus néfaste

Quel est l'objectif final de la sécurité de l'information? Qu'est-ce qu'on sécurise exactement?

/*============================================================================*/
/* Lesson 1: Create & query database objects */
/*============================================================================*/
/*Create a database*/
CREATE DATABASE TestData
GO
/*Switch the Query Editor connection to the TestData database*/
USE TestData
GO
/*Create the table*/
@marcoandre1
marcoandre1 / 7-zip-powershell.md
Last active October 5, 2023 08:43
7-zip in powershell with scripts provided
@marcoandre1
marcoandre1 / JoinSQLServer.md
Last active October 15, 2019 14:52
JOIN statement in SQL Server

From StackOverflow

<join_type> ::= 
    [ { INNER | { { LEFT | RIGHT | FULL } [ OUTER ] } } [ <join_hint> ] ]
    JOIN
  • If you just mention JOIN then by default it is a INNER JOIN.
  • An OUTER join has to be LEFT | RIGHT | FULL you can not simply say OUTER JOIN.

More info Write-Host

To stop script, simply press Ctrl + C

for (;;)
{
    [uint32] $num1 = Get-Random -Count 1 -InputObject (100..999)
    [uint32] $num2 = Get-Random -Count 1 -InputObject (100..999)
    [uint32] $num3 = Get-Random -Count 1 -InputObject (100..999)
    [uint32] $num4 = Get-Random -Count 1 -InputObject (100..999)
@marcoandre1
marcoandre1 / add_comma_to_every_line_in_a_file.md
Last active December 4, 2022 22:55
Add comma to every line in a file with powershell script

From StackOverflow

$inputFile = Get-Content "C:\path\to\data.txt"
$outputFile = "C:\path\to\dataoutput.txt"

$collate = foreach($Obj in $inputFile) {       
    $begin = ""
    $end = ","
    $begin + $Obj + $end

From StackOverflow

SELECT 
    *
FROM sys.procedures
WHERE modify_date > Convert(datetime, '2019/08/01' )
ORDER BY modify_date DESC

--exec sp_helptext 'SP_Name'
@marcoandre1
marcoandre1 / Copy_table_from_database.md
Last active August 13, 2019 12:15
How to copy a table from a database to another database.

From StackOverflow

Just to show yet another option (for SQL Server 2008 and above):

  1. right-click on Database -> select Tasks -> select Generate Scripts
  2. Select specific database objects you want to copy. Let's say one or more tables. Click Next
  3. Click Advanced and scroll down to Types of Data to script and choose Schema and Data. Click OK
  4. Choose where to save generated script and proceed by clicking Next

This generates a sql file that contains all the entries of the table. Depending on the size of the table, the file can be big!