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
# ------------------------------------------------------------------ # | |
# POSTFIX CONFIGURATION # | |
# ------------------------------------------------------------------ # | |
# ------------------------------------------------------------------ # | |
# 1. WHO IS THIS MAIL SERVER? # | |
# ------------------------------------------------------------------ # | |
myorigin = /etc/mailname |
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
172.104.159.48 | |
141.98.10.0/24 |
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 | |
useradd -s /bin/bash -d /lab $1 | |
printf "$2\n$2\n" | passwd $1 | |
usermod -aG sudo $1 |
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
package colors | |
import "strconv" | |
type Color int | |
const ( | |
Black Color = iota | |
Red | |
Green |
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
/** | |
* Base abstraction of a pair. | |
* | |
* @param <K> key | |
* @param <V> value | |
*/ | |
public interface Entry<K, V> { | |
/** | |
* Get 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
public <T> T makeObject(Class<T> clazz, Object... args) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException { | |
Class<?>[] types = Arrays.stream(args).map(cls -> getPrimitiveType(cls.getClass())).toArray(Class[]::new); | |
Constructor<T> constr = getConstructor(clazz, types); | |
constr.setAccessible(true); | |
return constr.newInstance(args); | |
} | |
@SuppressWarnings("unchecked") | |
public <T> Constructor<T> getConstructor(Class<T> clazz, Class<?>... types) { | |
return (Constructor<T>) Arrays.stream(clazz.getDeclaredConstructors()) |
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
import java.util.Arrays; | |
import java.util.stream.Stream; | |
public final class QuickSet<E> { | |
/** | |
* Maximum size of elements before beginning the rotation. | |
*/ | |
private final int maxSize; |
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
#define npos_v 18446744073709551615UL | |
static std::string color_format(int color) { | |
std::string formatted = "\u001b[38;5;" + std::to_string(color) + "m"; | |
return formatted; | |
} | |
typedef struct color_t { | |
std::string color; | |
std::string escape; |
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
class Colors: | |
@staticmethod | |
def red() -> str: | |
""" | |
The color red | |
:return: red | |
""" | |
return Colors.__fmt(124) |
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 | |
cd ~/.Trash | |
NAME=`echo "$1" | awk -F/ '{print $4}'` | |
wget "$1" -q | |
viu ~/.Trash/"$NAME" | |
rm ~/.Trash/"$NAME" |
NewerOlder