Skip to content

Instantly share code, notes, and snippets.

View jmfernandez's full-sized avatar

José María Fernández jmfernandez

View GitHub Profile
@jmfernandez
jmfernandez / Move_Windows_Recovery_Partition.md
Last active January 30, 2023 12:59
Moving the recovery partition on Windows 10
@jmfernandez
jmfernandez / keybase.md
Created August 5, 2021 21:23
keybase.md

Keybase proof

I hereby claim:

  • I am jmfernandez on github.
  • I am jmfernandez (https://keybase.io/jmfernandez) on keybase.
  • I have a public key ASBFVwc61FwcBw-9b-LL2FlbU0Kom_2awMSFe6NqmJjcqAo

To claim this, I am signing this object:

@jmfernandez
jmfernandez / 00_reproducible-R-scripts-recipe-with-renv.md
Last active August 19, 2020 11:32
Creating reproducible R environments with renv

Another way to be able to record all the exact versions of the R packages being used (even BioConductor ones), and install them later, is using renv.

This gist shows an example where CRAN and Bioconductor packages are installed and recorded.

Later, the minimum information is put in a different directory (and machine), and all the installed packages and their dependencies are installed, using the same, exact version used when it was previously installed.

@jmfernandez
jmfernandez / contourV3.html
Last active April 17, 2020 22:24
Plotting functions with D3 (v3, v4 and v5)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<!-- Based on http://bl.ocks.org/enthal/1726550 -->
<title>D3 - Line Chart - continuous function</title>
<!-- script type="text/javascript" src="https://raw.github.com/jquery/sizzle/master/sizzle.js"></script -->
<script type="text/javascript" src="https://d3js.org/d3.v3.min.js"></script>
<script type="text/javascript" src="https://d3js.org/d3-time.v1.min.js"></script>
<style type="text/css">
@jmfernandez
jmfernandez / 00_reproducible-R-scripts-with-packrat-recipe.md
Last active August 19, 2020 09:53
Reproducible R scripts with packrat

The way to be able to record all the exact versions of the R packages being used (even BioConductor ones), and install them later, is using packrat.

This gist shows an example where CRAN and Bioconductor packages are installed and recorded.

Later, the minimum information is put in a different directory (and machine), and all the installed packages and their dependencies are installed, using the same, exact version used when it was previously installed.

@jmfernandez
jmfernandez / ath10k_README.md
Last active March 13, 2024 12:50
Adding wireless / bluetooth co-existence to ath10k firmware

Although ath10k Linux kernel driver supports wireless / bluetooth co-existence on dual devices (wireless and bluetooth), firmware currently available at linux-firmware and https://github.com/kvalo/ath10k-firmware does not enable it, so wireless connectivity is interrupted when a paired bluetooth device, like a headphone, is in active use (for instance, listening to music).

These instructions are useful to download and generate a firmware usable by ath10k Linux driver, enabling the btcoex-param flag.

@jmfernandez
jmfernandez / nfs_wrapper.sh
Created January 25, 2019 14:51
Bash wrapper which runs a command line only when a directory is in a NFS volume
#!/bin/bash
if [ $# -ge 1 ] ; then
folder="$1"
shift
if [ -d "$folder" ] ; then
if df --output=fstype "$folder" | grep -qF nfs ; then
# Launch the guarded program here
eval "$@"
@jmfernandez
jmfernandez / crontab
Last active November 7, 2018 19:47
Script to do backups of a Drupal deployment
# Every day backup, keeping the 7 newest
42 3 * * * /root/doDrupalBackup.sh ; rm -r $(ls -d1 /gpfs/drupal_backups/*-*-* | head -n -7)
# Every week backup, keeping the 4 newest
42 4 * * 1 mkdir -p /gpfs/drupal_backups/weekly && cp -dpr /gpfs/drupal_backups/$(date -I) /gpfs/drupal_backups/weekly ; rm -r $(ls -d1 /gpfs/drupal_backups/weekly/*-*-* | head -n -4)
# Every month backup, keeping the 12 newest
42 5 1 * * mkdir -p /gpfs/drupal_backups/monthly && cp -dpr /gpfs/drupal_backups/$(date -I) /gpfs/drupal_backups/monthly ; rm -r $(ls -d1 /gpfs/drupal_backups/monthly/*-*-* | head -n -12)
# Every year backup
42 6 1 1 * mkdir -p /gpfs/drupal_backups/yearly && cp -dpr /gpfs/drupal_backups/$(date -I) /gpfs/drupal_backups/yearly
@jmfernandez
jmfernandez / juniper-vpn-ubuntu-64-bit-notes.md
Last active August 29, 2015 14:22
Preparing Ubuntu 14.04 64 bit for Juniper VPN client

I have followed the superb guide at MadScientist, and it was very helpful. Also, their client written in Perl works like a charm!

But as I have found the guide uncomplete when you are installing the client from scratch in a clean system, I'm writing this gist.

  1. You have to install both icedtea-plugin and icedtea-netx packages in order to get the Juniper VPN client files for the first time using the Juniper applet launched in your VPN https site. In a clean system, it will pull openjdk-7-jre and icedtea-7-plugin, among other packages.
  2. It is advisable your account has administration privileges, at least when Juniper VPN client files are installed by the Juniper applet.
  3. Once you have got the Juniper VPN client files installed into your account, icedtea-plugin, icedtea-netx and their dependencies are not needed.
@jmfernandez
jmfernandez / lxc-unprivileged-HOWTO.md
Last active December 3, 2020 20:50
Unprivileged lxc containers with phyisical network (and boot with the host!)

Unprivilegedl lxc containers potentially provide higher security levels than privileged ones. But they also have some limitations, like it is not easy to start them on boot, or give them a public IP address. These instructions teach how to achieve these goals.

These instructions have been developed taking as base Ubuntu 14.04 and its packages. They can be adapted to other recent Linux distributions.

  1. Be sure you have installed lxc, bridge-utils, cgmanager-utils and cgroup-bin packages:

    apt-get install apt-get install lxc bridge-utils cgmanager-utils cgroup-bin
  2. Protect access to host dmesg, so in case of a compromised container it does not give clues about the host.