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
''' | |
A Static Site Generator for small sites with a simple structure. Generates pages, not blog posts. | |
What's included | |
- Jinja2 for templating (like Django): layout changes will be applied to all pages at once! | |
- Navigation is added to the template, and the active page will be highlited (example included) | |
- Watchdog is watching for file changes | |
- A local http server for development | |
- The .html extension is hided by creating a seperate directory for each page |
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
package main | |
// Go program to scan for open ssh ports | |
// Sources | |
// https://github.com/kdar/gorawtcpsyn/blob/master/main.go | |
// https://github.com/Scalingo/go-ssh-examples/blob/master/client.go | |
import ( | |
"log" | |
"os" |
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
package main | |
import ( | |
"flag" | |
"log" | |
"net/http" | |
"github.com/gorilla/websocket" | |
) |
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
apt update | |
apt install openssh-server | |
sed -i -e 's/^#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config | |
systemctl enable ssh | |
systemctl start ssh |
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
alert("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
package com.github.tjeukayim | |
import org.bson.types.ObjectId | |
import org.junit.jupiter.api.Assertions.assertEquals | |
import org.junit.jupiter.api.Test | |
import org.springframework.data.mongodb.core.mapping.Document | |
import org.springframework.data.mongodb.core.query.Criteria | |
import org.springframework.data.mongodb.core.query.CriteriaDefinition | |
import org.springframework.data.mongodb.core.query.isEqualTo | |
import kotlin.reflect.KProperty |
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
import com.fasterxml.jackson.annotation.JsonInclude | |
import com.fasterxml.jackson.databind.introspect.AnnotatedClass | |
import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector | |
import org.springframework.context.annotation.Bean | |
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder | |
@Bean | |
fun jacksonBuilder(): Jackson2ObjectMapperBuilder { | |
return Jackson2ObjectMapperBuilder() | |
.annotationIntrospector(IgnoreByDefaultAnnotationIntrospector) |
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
# http://manpages.ubuntu.com/manpages/xenial/man8/lvextend.8.html | |
lvextend -l +50%FREE /dev/mapper/ubuntu--vg-ubuntu--lv | |
resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv |
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
using Microsoft.EntityFrameworkCore.Design; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.EntityFrameworkCore.Scaffolding.Internal; | |
using Microsoft.EntityFrameworkCore.Scaffolding.Metadata; | |
// Scaffold-DbContext $db Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Context MyDbContext | |
namespace Database | |
{ | |
public class PluralizerServices : IDesignTimeServices |
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
public class LazyReader : TextReader | |
{ | |
private readonly Lazy<TextReader> _lazyReader; | |
public LazyReader(Lazy<TextReader> lazyReader) | |
{ | |
_lazyReader = lazyReader; | |
} | |
public object GetLifetimeService() => _lazyReader.Value.GetLifetimeService(); |
OlderNewer