Skip to content

Instantly share code, notes, and snippets.

@dainiuxt
dainiuxt / readme.md
Created October 3, 2023 13:02 — forked from primaryobjects/readme.md
How to remote desktop from Linux Mint to Windows 10 with AzureAD Azure AD login
View readme.md

How to remote desktop from Linux Mint to Windows 10 with AzureAD

The following steps detail how to connect over Remote Desktop from Linux Mint or Ubuntu to Windows 10 with an AzureAD username and password login account.

  1. In Windows 10, right-click This PC or My Computer and select Properties.
  2. Click Remote Settings.
  3. Check the option Allow remote connections to this computer.
  4. Uncheck the option Allow connections only from computers running Remote Desktop with Network Level Authentication.
  5. Click OK.
@dainiuxt
dainiuxt / task_2023.py
Last active September 11, 2023 07:42 — forked from albertas/task_2023.py
CCT academy task 2023
View task_2023.py
"""
My comments
Illumination for every street light is the sum of self illumination (1 if street light is working,
0 if street light is not working), plus illuminations of working neighbouring street lights.
Taking into account only thouse, which illuminations are greater than 0.01, we should use in calculations
only thouse in distance of 180 m or index +/- 9. These illuminations can be calculated using function
below (calculate_illumination() function):
"""
@dainiuxt
dainiuxt / settings.jsonc
Created May 16, 2023 07:22 — forked from hyperupcall/settings.jsonc
VSCode config to disable popular extensions' annoyances (telemetry, notifications, welcome pages, etc.)
View settings.jsonc
// I'm tired of extensions that automatically:
// - show welcome pages / walkthroughs
// - show release notes
// - send telemetry
// - recommend things
//
// This disables all of that stuff.
// If you have more config, leave a comment so I can add it!!
{
@dainiuxt
dainiuxt / keychron_linux.md
Created June 28, 2022 09:59 — forked from andrebrait/keychron_linux.md
Keychron keyboards on Linux + Bluetooth fixes
View keychron_linux.md

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work

Keychron Keyboards on Linux use the hid_apple driver (even in Windows/Android mode), both in Bluetooth and Wired modes. By default, this driver uses the F-keys as multimedia shortcuts and you have to press Fn + the key to get the usual F1 through F12 keys.

View new_object.js
function Player(name, marker) {
this.name = name
this.marker = marker
this.sayName = function() {
console.log(name)
}
}
const player1 = new Player('steve', 'X')
const player2 = new Player('also steve', 'O')
@dainiuxt
dainiuxt / 1 AWS Cloud9
Created October 29, 2020 14:39 — forked from yshmarov/0 AWS Cloud9
Ruby on Rails 6: Learn 25+ gems and build a Startup MVP 2020
View 1 AWS Cloud9
# All AWS C9 envments
https://eu-central-1.console.aws.amazon.com/cloud9/home?region=us-east-1
# Instance management
https://console.aws.amazon.com/ec2/home?region=eu-central-1#Instances:sort=instanceId
# Create AWS C9 environment
https://eu-central-1.console.aws.amazon.com/cloud9/home/create
Setting - set tabs to 2
View slice-splice-arrays.js
/* Free c code camp task
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice
Are there any flaws in my solution (code passes test as OK)?
You are given two arrays and an index.
Use the array methods slice and splice to copy each element of the first array into the second array, in order.
Begin inserting elements at index n of the second array.
Return the resulting array. The input arrays should remain the same after the function runs.
*/
function frankenSplice(arr1, arr2, n) {
View gist:f6680dd662548f4f15ddee85cd9e70b7
sudo smartctl --all /dev/sda
smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.10.0-28-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Toshiba 2.5" HDD MK..76GSX
Device Model: TOSHIBA MK6476GSX
Serial Number: 22DDPAMST
LU WWN Device Id: 5 000039 3d2786cc0
Firmware Version: GS001C
@dainiuxt
dainiuxt / wpSQL.md
Last active December 8, 2017 07:58
How to Work with the WordPress Database: 11+ Useful SQL Queries
View wpSQL.md

https://www.wpkube.com/work-wordpress-database-11-useful-sql-queries/

  1. Change Your WordPress Password

Forgotten your password and locked yourself out of your WordPress site? No worries – you can reset it manually in the database with this SQL query:

UPDATE wp_users SET user_pass = MD5( '[new_password]' ) WHERE user_login = '[username]';

MD5 encrypts the new password so anyone gaining access to the database is not able to read the password.