Skip to content

Instantly share code, notes, and snippets.

View openarun's full-sized avatar
🤓

Arun Kumar Pariyar openarun

🤓
View GitHub Profile
@openarun
openarun / cs35l41_spi.md
Created April 4, 2023 13:13 — forked from lamperez/cs35l41_spi.md
CS35L41 amplifiers in an ASUS Zenbook on linux

Asus Zenbook UX3402 speakers on Linux

I got the speakers working on my Asus Zenbook 14 OLED UX3402, the one with Intel CPU and the two CS35L41 audio amplifiers connected over SPI (not the UM3402YA, with AMD and I²C). The amplifiers are supported by the snd_hda_scodec_cs35l41 module in recent kernel versions, but they require some model-specific configuration paramaters, that should be provided by the BIOS, via ACPI. Of course, they are missing. It seems that the Windows drivers have those parameters somehow hardcoded, instead of using ACPI (bad idea, but who am I to criticise). Since Asus has been nasty and refused/was not able to update the BIOS with the missing data, I have patched the ACPI tables myself.

Warning
As stated by Cirrus developers, if you try this there is a non-zero (low, I hope) possibility of

@openarun
openarun / svg-hamburger.svg
Last active August 20, 2022 22:07 — forked from philsinatra/svg-hamburger
SVG Hamburger
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@openarun
openarun / install.php
Created August 31, 2021 08:18 — forked from tschoffelen/install.php
A simple PHP script that automatically downloads and unzips the latest version of Wordpress in the current directory (./), so that I don't have to download it and upload it to my server through FTP manually.
<?php
echo '<pre>';
echo '<span style="color:blue">DOWNLOADING...</span>'.PHP_EOL;
// Download file
file_put_contents('wp.zip', file_get_contents('https://wordpress.org/latest.zip'));
$zip = new ZipArchive();
$res = $zip->open('wp.zip');
if ($res === TRUE) {
@openarun
openarun / crypto-pbkdf2-auth-example.js
Created October 11, 2020 16:50 — forked from billyxs/crypto-pbkdf2-auth-example.js
CryptoJS PBKDF2 hashing with javascript. This could be used for a simple, not high security, password auth.
// bower install crypto-js
// Add to scripts to html file
// <script src="bower_components/crypto-js/crypto-js.js"></script>
// <script src="bower_components/crypto-js/pbkdf2.js"></script>
function auth(password) {
// Make a salt with CryptoJS.lib.WordArray.random(128/8);
var salt = 'your salt'; // CryptoJS.lib.WordArray.random(128/8);
// 1000 iterations takes a couple seconds in the browser. Wouldn't want to go much higher if this is a browser implementation
@openarun
openarun / readme.md
Created June 6, 2020 11:43 — forked from troyfontaine/readme.md
Logging SFTP interactions on a Chrooted User in Ubuntu 14.04

How to setup SFTP Logging on Ubuntu 14.04 for a Chrooted User

Prerequisites: Using internal-sftp for sftp; rsyslog for logging

Step 1. Set up your chrooted directories

sudo mkdir /sftp/myshare
sudo mkdir /sftp/myothershare

Step 2. Create your groups for your chrooted users

@openarun
openarun / secure_link.php
Created July 31, 2019 20:31 — forked from bftanase/secure_link.php
generate URL for nginx secure_link