This file contains 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
# Secure copy | |
scp ~/my_local_file.txt user@remote_host.com:/some/remote/directory | |
scp user@remote_host.com:/some/remote/directory ~/my_local_file.txt |
This file contains 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
while ($true) { | |
$result = curl http://localhost:3000 | |
if ($result -eq $null) { | |
write-host "null!" | |
} | |
if ($result.StatusCode -eq 200) { | |
Write-Host "Success" . $result.StatusCode |
This file contains 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
const request = require('request'); | |
const cheerio = require('cheerio'); | |
const http = require('https'); | |
const fs = require('fs'); | |
class CertificateDownloader { | |
constructor() { | |
this.limit = 100; |
This file contains 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
app.use(function(req, res, next) { | |
res.header("Access-Control-Allow-Origin", "*"); | |
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); | |
next(); | |
}); | |
app.get('/', function(req, res, next) { | |
// Handle the get for this route | |
}); |
This file contains 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
// Installing node on linux | |
// https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora | |
// Basic Express App | |
var express = require('express'); | |
var app = express(); | |
app.get('/', function (req, res) { | |
console.log('Root URL hit'); | |
res.send('Hello World!'); |
This file contains 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
# Renew dhcp ip address | |
sudo dhclient -r | |
sudo dhclient | |
sudo dhclient -r eth0 | |
sudo dhclient eth0 | |
# Find runlevel of the system (multi-user.target=runlevel3, graphical.target=runlevel5) | |
systemctl get-default | |
# Set runlevel |
This file contains 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
declare @schemaName nvarchar(100) = 'item' | |
declare @tableName nvarchar(100) = 'location' | |
declare @dataType nvarchar(100) = 'decimal' | |
select | |
s.name, | |
t.name, | |
c.name, | |
c.is_nullable, | |
st.name |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<xsl:stylesheet version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:msxsl="urn:schemas-microsoft-com:xslt" | |
exclude-result-prefixes="msxsl"> | |
<xsl:output method="xml" indent="yes"/> | |
<xsl:template name="Put.InventoryUpdate"> | |
<AspDotNetStorefrontImport Version="7.1"> |
This file contains 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
string dir = "c:\sites\app\Content\Images\Rank\1000\"; | |
string fileName = "image1.jpg"; | |
if (!Directory.Exists(dir)) | |
Directory.CreateDirectory(dir); | |
file.SaveAs(dir + fileName); |
This file contains 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
var domainTeam = new Team() { Name = "Team 1", Description = "..." }; | |
public class TeamRepository | |
{ | |
public void Create(Team team) | |
{ | |
// Don't forget to do your Mapper.Map<> in your bootstrap code in Global.asax or something or you'll get an unknown map error | |
var entityFrameworkTeam = Mapper.Map<Entities.Team>(team); | |
// db.add |