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 / 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!

From StackOverflow

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

--exec sp_helptext 'SP_Name'

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 / 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.
/*============================================================================*/
/* 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 / 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?

@marcoandre1
marcoandre1 / Microsoft.PowerShell_profile.ps1
Last active September 25, 2020 22:10
Powershell configuration with Dracula theme (No admin access)
Import-Module PSReadLine
Set-Alias git hub
Set-PSReadLineOption -BellStyle None
Import-Module posh-git
Set-Location C:\users\<username>
# Dracula readline configuration. Requires version 2.0, if you have 1.2 convert to `Set-PSReadlineOption -TokenType`
Set-PSReadLineOption -TokenKind Command -ForegroundColor Green
Set-PSReadLineOption -TokenKind Parameter -ForegroundColor Gray
Set-PSReadLineOption -TokenKind Operator -ForegroundColor Magenta
Set-PSReadLineOption -TokenKind Variable -ForegroundColor White
@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 / 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
@marcoandre1
marcoandre1 / PyQt-installation.md
Last active August 11, 2023 12:55
Install PyQt with pip command on windows 10

About

Installation guide to PyQt4 and PyQt5 on windows 10. Works with Python 3.7.3 32-bit and Python 3.7.3 64-bit (tested)

Installing

  1. Verify that python is installed and runnning by typing python --version on the command line.
  2. Verify that you have not installed PyQt before pip list.
  3. pip install PyQt5 this will install PyQt5.
  4. pip install pyqt5-tools this will install the designer.exe in your Scripts folder.