Skip to content

Instantly share code, notes, and snippets.

View ynroot's full-sized avatar
🏠
Working from home

Yannick Nascimento ynroot

🏠
Working from home
View GitHub Profile
@ynroot
ynroot / certbotresetcert.sh
Created May 7, 2022 12:41 — forked from zoharbabin/certbotresetcert.sh
Delete and reinstall SSL certificates with certbot on Ubuntu
certbot certificates
# find the path to the fullchain certificate you wish to reinstall
certbot revoke --cert-path /etc/letsencrypt/live/... #path to the cert from above
certbot delete --cert-name yourdomain.com
rm -Rf /etc/apache2/sites-available/000-default-le-ssl.conf #or whatever the name of the apache conf you had it configured on
rm -Rf 000-default-le-ssl.conf #or whatever the name of the apache conf you had it configured on
sudo apache2ctl restart
certbot #follow the guide to setup the new certificate
@ynroot
ynroot / clean-up-arch-linux.md
Created March 14, 2021 13:02 — forked from rumansaleem/clean-up-arch-linux.md
Instructions to clean up Arch Linux (Manjaro)

Contents

  • Clean pkg cache
  • Remove unused packages (orphans)
  • Clean cache in /home
  • remove old config files
  • Find and Remove
    • duplicates
    • empty files
    • empty directories
  • broken symlinks
@ynroot
ynroot / README.md
Created February 14, 2021 00:36 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@ynroot
ynroot / xbox-one-controller-bluetooth-ubuntu-fix.md
Created February 9, 2021 17:51 — forked from 2E0PGS/xbox-one-controller-bluetooth-ubuntu-fix.md
Fix to pair Xbox One S Bluetooth controller on Ubuntu

First things first you need to have a new ish bluetooth adapter I have found in my testing.

It may need to be bluetooth 4 compatible I am not sure but my laptop and phone worked whereas my desktop using a £1 dongle did not.

Once you get a successful pair you may notice the controller still has a blinking light. If this is the case see below.

Install sysfsutils

sudo apt-get install sysfsutils

@ynroot
ynroot / OAuth.php
Created October 10, 2019 16:41 — forked from hirobert/OAuth.php
Noun Project API - PHP Example
<?php
// mirror of: http://oauth.googlecode.com/svn/code/php/OAuth.php
// vim: foldmethod=marker
/* Generic exception class
*/
class OAuthException extends Exception {
// pass
}
@ynroot
ynroot / mysqlEncoding.php
Created August 16, 2019 15:14
convert encoding on a table
UPDATE
contas
SET morada =
IF(CONVERT(CAST(CONVERT(morada USING latin1) AS BINARY) USING utf8) IS NULL, morada,
CONVERT(CAST(CONVERT(morada USING latin1) AS BINARY) USING utf8))
@ynroot
ynroot / avoid madol from close it self
Created June 25, 2019 13:38
Prevent Bootstrap Modal from disappearing when clicking outside or pressing escape?
<button type="button" data-backdrop='static' data-keyboard='false' class="btn btn-warning btn-xs" data-toggle="modal" data-target="#qntde">
<i class="fas fa-edit"></i> Alterar
</button>
@ynroot
ynroot / angular css to scss
Created May 14, 2019 14:38
The command to get SCSS working in an Nx workspace:
ng config schematics.@nrwl/schematics:component.styleext scss
@ynroot
ynroot / LoginActivity.java
Created April 27, 2019 21:38 — forked from cutiko/LoginActivity.java
How to customize firebase-ui-auth for Android
public class LoginActivity extends AppCompatActivity {
private static final int RC_SIGN_IN = 343;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
@ynroot
ynroot / generateRandomString.txt
Created April 24, 2019 16:10 — forked from Fast0n/generateRandomString.txt
Generate Random String Android Studio
import java.util.Random;
public class GeneratePassword {
/**
* Genera una password RANDOM
*/
public static final String DATA = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz|!£$%&/=@#";
public static Random RANDOM = new Random();