Skip to content

Instantly share code, notes, and snippets.

View otnansirk's full-sized avatar
:octocat:
Coding

Kris otnansirk

:octocat:
Coding
View GitHub Profile
@otnansirk
otnansirk / HistoryWifi.md
Last active April 28, 2025 02:50
Get list wifi history in ubuntu
  1. sudo cat /etc/NetworkManager/system-connections/*
  2. See on value psk=YOUR_WIFI_PASSWORD

or you can use grep for filter

  1. sudo cat /etc/NetworkManager/system-connections/* | grep -i -A 10 "YOUR_WIFI_SSID_NAME"

-i for incase-sensitive -A 10 for show 10 line after found text

WEBVTT
NOTE
Transcription provided by Deepgram
Request Id: d1edd3d2-865f-4750-abd2-7a4120f9db82
Created: 2024-09-09T04:17:30.388Z
Duration: 679.9035
Channels: 1
00:00:00.080 --> 00:00:02.640
@otnansirk
otnansirk / download.js
Created August 16, 2024 00:07
Function for donwload file in js
export const downloadHandler = async (uri) => {
try {
const response = await fetch(uri, {
mode: 'cors',
});
if (!response.ok) {
throw new Error('Network response was not ok');
}
@otnansirk
otnansirk / readme.md
Created November 27, 2023 04:44
Upload mp4 or gif to google meeting background

Steps

  1. Right click to upload background on g-meet and click inspect (open dev tools)
  2. Search
<input type="file" jsname="tif8Pe" jsaction="change:E7zRc" accept="image/jpeg, image/png" style="display: none;">
Where it says accept="image/jpeg, image/png"

and replace to this

accept="image/jpeg, image/png, image/gif, video/mp4"
@otnansirk
otnansirk / editorjs.php
Last active September 25, 2023 15:22
PHP-editorjs parse to html
<?php
function jsonToHtml($jsonStr) {
$obj = json_decode($jsonStr);
$html = '';
foreach ($obj->blocks as $block) {
switch ($block->type) {
case 'paragraph':
$html .= '<p>' . $block->data->text . '</p>';
break;
@otnansirk
otnansirk / isDarkColor.js
Last active June 5, 2023 23:38
How to detect color included in the dark or light category
function isDarkColor(color) {
const luminance = (0.299 * color[0] + 0.587 * color[1] + 0.114 * color[2]) / 255;
return luminance <= 0.5;
}
function hexToRgb(hex) {
const r = parseInt(hex.substring(1, 3), 16);
const g = parseInt(hex.substring(3, 5), 16);
const b = parseInt(hex.substring(5, 7), 16);
@otnansirk
otnansirk / Helpers.js
Last active July 28, 2022 15:47
This is a helper.js
/**
* Get domain from string url
* @param {*} url
* @returns string
*/
export const getDomain = url => {
const urlParts = getApiUrl(url)
.split('/')
.slice(0, 3)
Install Certutil
$ apt install libnss3-tools -y
Install mkcert
$ wget https://github.com/FiloSottile/mkcert/releases/download/v1.1.2/mkcert-v1.1.2-linux-amd64
$ mv mkcert-v1.1.2-linux-amd64 mkcert
$ chmod +x mkcert
$ cp mkcert /usr/local/bin/
docker exec -i CONTAINER_ID mysql -uroot -proot DB_NAME < BACKUP_DB.sql
kill -9 `ps ax | grep node | grep meteor | awk '{print $1}'`