Skip to content

Instantly share code, notes, and snippets.

# http://stackoverflow.com/questions/1388025/how-to-get-id-of-the-last-updated-row-in-mysql
# single row update
SET @update_id := 0;
UPDATE some_table SET column_name = 'value', id = (SELECT @update_id := id)
WHERE some_other_column = 'blah' LIMIT 1;
SELECT @update_id;
# Multiple rows updated
SET @uids := null;
Written by Thanos Apostolou
http://askubuntu.com/questions/53822/how-do-you-run-ubuntu-server-with-a-gui
Some more info can be found here https://help.ubuntu.com/community/ServerGUI. I assume you start with a clean install of Ubuntu Server 16.04 (some modifications may be needed for older versions of Ubuntu). Depending on your needs you can do these:
Minimal GUI:
sudo apt install xorg
sudo apt install --no-install-recommends openbox
Run the command startx and openbox will start (you can open a terminal there and run any application you want)
/* global __DEV__ */
import React, { useState, useEffect, useRef } from "react"
import {
facebookAppId,
facebookDisplayName,
iosOneSignalAppId,
androidOneSignalAppId,
sentryDsn,
} from "./app.json"
import { version } from "./package.json"
@cmpscabral
cmpscabral / install_libxl_php5.6.sh
Created March 11, 2021 19:37 — forked from dyazincahya/install_libxl_php5.6.sh
Package command for install libxl in ubuntu 16.04
#!/bin/bash
#
# Modify by k4ng
#
# ilia/php_excel extension example install script
#
# usage:
# > sudo ./install_phpexcel_php5.6.sh
# > (optionally) sudo service php5.6-fpm restart
#
@cmpscabral
cmpscabral / adding-pixel-to-raspbian-lite.md
Created November 1, 2020 22:19 — forked from kmpm/adding-pixel-to-raspbian-lite.md
Adding PIXEL to Raspbian Lite

Adding PIXEL/GUI to Raspbian Lite

These 'notes' were primarily intended for my own consumption but since there have been surprisingly many comments to it over the years I wanted to do some updates and clarifications. Thanks for all comments.

These instructions will require you to have connection to internet from your pi, WiFi, Ethernet or by some other means like a 3G USB dongle or something.

Preparations

@cmpscabral
cmpscabral / quasar android
Last active June 24, 2020 22:33
quasar_android.md
# Install graddle
Download the Gradle Binary Only Distribution from https://gradle.org/gradle-download/
Open a terminal
Run the following to unzip the android sdk to the Development directory that is under your user home directory
unzip ~/Downloads/gradle-3.1-bin.zip -d ~/Development
Open up the vi editor and edit your bash profile. We need to add in the GRADLE_HOME environment variable
@cmpscabral
cmpscabral / pass-slots.md
Created June 8, 2020 11:52 — forked from loilo/pass-slots.md
Vue: Pass Slots through from Parent to Child Components

Vue: Pass Slots through from Parent to Child Components

The Situation

  • We've got some components A, B and C which provide different slots.
    const A = {
      template: `<div><slot name="a">Default A Content</slot></div>`
    }

const B = {

@cmpscabral
cmpscabral / webpack-cache-chunk.js
Created April 6, 2020 16:34
quasar, cache busting, webpack, keep names
// First add this to your webpack config:
mix.webpackConfig({
output: {
chunkFilename: '[name].js?id=[chunkhash]',
}
});
//Then, when you specify the chunk name using this: /* webpackChunkName: "js/dashboard" */
//You will get this as a result: js/dashboard.js?id=0791710073c12eff5a3d in the webpack output dialog.
@cmpscabral
cmpscabral / gist:b650be23cd37cdfc9f3213c2ae53d201
Created February 17, 2020 12:11
forward traffic to virtual machine
echo "
rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
rdr pass inet proto tcp from any to any port 443 -> 127.0.0.1 port 8443
" | sudo pfctl -ef -
@cmpscabral
cmpscabral / pdfconvert-a
Last active October 15, 2019 11:37
convert PDF to PDF/a
gs -dPDFA -dBATCH -dNOPAUSE -dUseCIEColor -sProcessColorModel=DeviceCMYK -sDEVICE=pdfwrite -sPDFACompatibilityPolicy=1 -sOutputFile=output.pdf input.pdf