Skip to content

Instantly share code, notes, and snippets.

View zeroows's full-sized avatar
🥰
Rust

Abdulrhman Alkhodiry zeroows

🥰
Rust
View GitHub Profile
@zeroows
zeroows / unsubmodule.md
Created September 3, 2023 09:08 — forked from ryaninvents/unsubmodule.md
Convert git submodule to regular directory

From Stack Overflow.

# Fetch the submodule commits into the main repository
git remote add submodule_origin git://url/to/submodule/origin
git fetch submodule_origin

# Start a fake merge (won't change any files, won't commit anything)
git merge -s ours --no-commit submodule_origin/master
@zeroows
zeroows / pytorch-losses-in-plain-python.ipynb
Created February 6, 2020 07:58 — forked from yang-zhang/pytorch-losses-in-plain-python.ipynb
git/yang-zhang.github.io/ds_code/pytorch-losses-in-plain-python.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zeroows
zeroows / conv_autoencoder_keras.ipynb
Created September 6, 2018 11:35 — forked from naotokui/conv_autoencoder_keras.ipynb
Convolutional Autoencoder in Keras
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zeroows
zeroows / hello_server.ex
Created September 18, 2017 09:58 — forked from blackode/hello_server.ex
GenServer Callbacks examples
defmodule HelloServer do
use GenServer
## Server API
def init(initial_value) do # initiating the state with the value 1 passed
{:ok,initial_value}
end
# add the value to the state and returns :ok
def handle_call({:add,value},_from,state) do
@zeroows
zeroows / _service.md
Created May 31, 2016 17:31 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@zeroows
zeroows / docker-ssl-cert-generate
Created February 16, 2016 09:33 — forked from cameron/docker-ssl-cert-generate
Generate self-signed SSL certs for docker client <— HTTPS —> daemon
#! /bin/bash
# HEADS UP! Make sure to use '*' or a valid hostname for the FDQN prompt
echo 01 > ca.srl
openssl genrsa -des3 -out ca-key.pem
openssl req -new -x509 -days 365 -key ca-key.pem -out ca.pem
openssl genrsa -des3 -out server-key.pem
openssl req -new -key server-key.pem -out server.csr
@zeroows
zeroows / generate_docker_cert.sh
Created February 16, 2016 09:33 — forked from bradrydzewski/generate_docker_cert.sh
Generate trusted CA certificates for running Docker with HTTPS
#!/bin/bash
#
# Generates client and server certificates used to enable HTTPS
# remote authentication to a Docker daemon.
#
# See http://docs.docker.com/articles/https/
#
# To start the Docker Daemon:
#
# sudo docker -d \
@zeroows
zeroows / main.go
Last active September 12, 2015 23:19 — forked from nmerouze/main.go
Example for "Build Your Own Web Framework in Go" articles
package main
import (
"database/sql"
"encoding/json"
"errors"
"fmt"
"log"
"net/http"
"time"
#! /bin/bash
set -e
trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG
trap 'echo FAILED COMMAND: $previous_command' EXIT
#-------------------------------------------------------------------------------------------
# This script will download packages for, configure, build and install a GCC cross-compiler.
# Customize the variables (INSTALL_PATH, TARGET, etc.) to your liking before running.
# If you get an error and need to resume the script from some point in the middle,
# just delete/comment the preceding lines before running it again.