View check_sum.rb
This file contains 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
#!/usr/bin/env ruby | |
require 'digest' | |
require 'fileutils' | |
# Function to calculate the checksum for a directory | |
def calculate_checksum(directory_path, excluded_directories = []) | |
checksum = Digest::SHA256.new | |
Dir[File.join(directory_path, '**', '**/*')].each do |file| |
View add_two_numbers.js
This file contains 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
function ListNode(val, next) { | |
this.val = (val === undefined ? 0 : val); | |
this.next = (next === undefined ? null : next); | |
} | |
const addTwoNumbers = (l1, l2) => { | |
let carry = 0; | |
let result = new ListNode(-1) | |
let dummy = result; |
View lru_cache.js
This file contains 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 LruCache { | |
constructor(capacity) { | |
this.capacity = capacity; | |
this.map = new Map(); | |
} | |
get(key) { | |
if(this.map.has(key)) { | |
let val = this.map.get(key); | |
this.map.delete(key); |
View main.go
This file contains 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 main | |
import "fmt" | |
func main() { | |
var a = [][]int{ | |
{0, 0, 1, 1, 0}, | |
{0, 0, 1, 1, 0}, | |
{1, 0, 1, 0, 0}, | |
{1, 0, 1, 0, 0}, |
View BluetoothOn
This file contains 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
bluetoothctl | |
power on | |
discoverable on | |
pairable on | |
scan on |
View ng_image_skin.sh
This file contains 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 | |
# This script downloads photo of the day from nationalgeographic.com and set it as desktop wallpaper. | |
# Applicable for Ubuntu KDE 18.04 | |
# Permission to copy, modify, and distribute is granted under GPLv3 | |
# Last Revised 7 Mar 2019 | |
# | |
# Initial installation: | |
# Place the script into /usr/local/bin/ng_image_skin | |
# Run it to pull image and create symlink to it which will be lcocated at ~/Picture/Wallpapers/wp_image | |
# Set desktop image manually that pointed to ~/Picture/Wallpapers/wp_image |
View kernel_4.19.sh
This file contains 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 | |
# | |
# Install linux kernel 4.19 | |
# | |
# To check last available dep's visit https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19/ | |
# | |
## | |
rm -rf linux-*; |
View phpldapadmin.conf
This file contains 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
server { | |
listen 80; | |
server_name localhost; | |
# application: phpldapadmin | |
location /phpldapadmin { | |
alias /usr/share/phpldapadmin/htdocs; | |
index index.php index.html index.htm; |