Skip to content

Instantly share code, notes, and snippets.

@jocelyn
jocelyn / useradd.sh
Created March 3, 2021 14:54 — forked from mattimatti/useradd.sh
Create new user using command line in Mac OS X. Do not forget to set correct permissions for the file.
#!/bin/sh
if [[ `id -u` != 0 ]]; then
echo "Must be root to run script"
exit
fi
read -p "Enter user name and press [ENTER]: " UserName
if [[ $UserName == `dscl . -list /Users UniqueID | awk '{print $1}' | grep -w $UserName` ]]; then
using System;
using System.IO;
using System.Security.Permissions;
using System.Diagnostics;
using System.Timers;
using System.Collections.Generic;
public class Watcher
{
@jocelyn
jocelyn / console_ansi_control.e
Last active October 18, 2018 16:47
ANSI console control
note
description: "Summary description for {CONSOLE_ANSI_CONTROL}."
date: "$Date$"
revision: "$Revision$"
EIS: "name=ANSI escape codes", "protocol=URI", "src=http://ascii-table.com/ansi-escape-sequences.php"
EIS: "name=ANSI escape codes (MS)", "protocol=URI", "src=https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences"
class
CONSOLE_ANSI_CONTROL
@jocelyn
jocelyn / app.e
Last active October 31, 2016 14:28
Example of SCOOP pool.
note
description: "[
Enter class description here!
]"
class
APP
create
make
@jocelyn
jocelyn / byte_array.e
Last active October 7, 2016 12:20
Proposition to have a byte array solution within Eiffel libs
note
description: "[
Representation for byte array (item value between 0 and 255).
Could be useful in protocol, encoding, ... computations.
It provides useful representations as hex, bin, and also generic base N representation ...
]"
date: "$Date$"
revision: "$Revision$"
@jocelyn
jocelyn / application.e
Last active November 4, 2015 23:24
ewf_encoding_test
note
description: "Basic Service launcher"
class
APPLICATION
inherit
WSF_DEFAULT_SERVICE [APPLICATION_EXECUTION]
redefine
initialize
#!/bin/python
# print time for every thursday
# modify code for other days.
import sys;
from time import *
def print_time (t):
print (strftime ("%d/%m/%Y", localtime(t)))