Skip to content

Instantly share code, notes, and snippets.

View 0del's full-sized avatar
🏠
Working from home

Bany 0del

🏠
Working from home
View GitHub Profile
@0del
0del / readme.md
Created March 14, 2023 08:48
Resize tablespace in oracle

1. Run a query similar to the following to identify if the tablespace is:

  • Permanent, undo, or temporary
  • Smallfile or bigfile
SQL> SELECT TABLESPACE_NAME, CONTENTS, BIGFILE FROM DBA_TABLESPACES;

2. Run a query similar to the following to check if the autoextend feature is turned on, the current size of the datafile, and the maximum configured limit:

For Permanent and undo tablespaces:

@0del
0del / readme.md
Created January 9, 2023 09:02
regex
  1. Name - allow vietnamese characters
  • ^[a-z0-9A-Z_\x{00C0}-\x{00FF}\x{1EA0}-\x{1EFF} ,.'-]{3,35}+$
@0del
0del / run.sh
Created November 4, 2022 04:23
Docker command run postgresql conatiner
docker run --name postgres-latest -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=secret -d postgres
docker exec -it postgres-latest createdb --username=root --owner=root <db_name>
@0del
0del / docker-compose.yml
Created October 18, 2022 06:06
Docker compose for kafka
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper:6.2.1
hostname: zookeeper
container_name: zookeeper
ports:
- "2181:2181"
environment:
@0del
0del / main.go
Created July 30, 2022 08:45 — forked from montanaflynn/main.go
Gin request timeout middleware and handler
package main
import (
"context"
"log"
"net/http"
"time"
"github.com/gin-gonic/gin"
)
@0del
0del / main.go
Created July 30, 2022 04:49
Context with timeout in Go
package main
import (
"context"
"fmt"
"math/rand"
"os"
"os/signal"
"syscall"
"time"
@0del
0del / go-bench.sh
Created July 28, 2022 09:05
Generate benchmark files in a Git repository.
#!/bin/bash
#
# Generate benchmark files in a Git repository.
#
# Usage: TIMES=1 go-bench [prefix]
#
# Number of times to run the benchmark; useful for benchstat.
TIMES=${TIMES:-1}
@0del
0del / hash_password_salt.go
Created July 25, 2022 01:37
Hash password with salt
import (
"crypto/rand"
"fmt"
"io"
"log"
"code.google.com/p/go.crypto/scrypt"
)
const (
@0del
0del / jwt_maker.go
Created July 20, 2022 02:30
Token maker in go
package token
import (
"errors"
"fmt"
"time"
"github.com/dgrijalva/jwt-go"
)
@0del
0del / run.sh
Created July 6, 2022 03:07
Docker logs container with time
docker logs --since=2022-07-05T17:30:00Z help-check-bot-cn