Skip to content

Instantly share code, notes, and snippets.

@chemakh
chemakh / apache2-000-default.conf
Created January 2, 2020 14:07
Enable directory listing in apache web server
Alias /agendastorage "/home/ubuntu/workspace/agendastorage"
<Directory "/home/ubuntu/workspace/agendastorage">
options Indexes
Order allow,deny
Allow from all
# New directive needed in Apache 2.4.3:
Require all granted
</Directory>
@chemakh
chemakh / command.properties
Last active October 13, 2021 12:47
useful commands
##DOCKER
access_running_container_filesystem: docker exec -it CONTAINER_NAME (sh || bash)
running an inmage into container: docker run IMAGE_ID
remove all stopped containers : docker rm -f $(docker ps -a -q)
list stopped container : docker ps -a
create docker machine WINDOWS 7 :docker-machine create --driver virtualbox --virtualbox-cpu-count=2 --virtualbox-memory=6144 --virtualbox-disk-size=50000 dev
mount shared folder : sudo mount -t vboxsf -o uid=1000,gid=50 c/ldk/dfce /c/ldk/dfce/
dfce-it-test-docker-mount-script : sudo mkdir -p c/ldk/dfce c/ldk/dfce-control-center
sudo mount -t vboxsf -o uid=1000,gid=50 c/ldk/dfce-control-center /c/ldk/dfce-control-center/
@chemakh
chemakh / .gitconfig
Last active August 7, 2019 09:28 — forked from eleduc/gist:35ec6640e1cea23d853990619d1e475c
Git configuration
[user]
# To avoid anonymous commits
name = ...
email = <...>
[push]
# This is to avoid any update of other branches by error (push without destination branch name)
default = current
[core]
# This is to avoid any "cr/lf" issue
autocrlf = input
@chemakh
chemakh / DeleteDirVisitor.java
Created November 8, 2018 09:27
file visitor for deleting directory and his files
import java.io.IOException;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
public class DeleteDirVisitor extends SimpleFileVisitor<Path> {
@Override
@chemakh
chemakh / CopyDirVisitor.java
Created November 8, 2018 09:27
file visitor for copying or moving directory
import java.io.IOException;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
public class CopyDirVisitor extends SimpleFileVisitor<Path> {
private Path fromPath;
private Path toPath;
private boolean move;
@chemakh
chemakh / AbstractWebSocketMessageBrokerConfigurerImpl.java
Last active January 2, 2020 14:25
spring web socket authentication with token
@Override
public void configureClientInboundChannel(ChannelRegistration registration)
{
registration.interceptors(new ChannelInterceptorAdapter()
{
@Override
public Message<?> preSend(Message<?> message, MessageChannel channel)
{
StompHeaderAccessor accessor = MessageHeaderAccessor.getAccessor(message, StompHeaderAccessor.class);
if(StompCommand.CONNECT.equals(accessor.getCommand())) //connect operation : get Token from accessor and check it
@chemakh
chemakh / 0.md
Created April 19, 2017 14:19 — forked from max-mapper/0.md
JS hoisting by example

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)