Skip to content

Instantly share code, notes, and snippets.

@janikvonrotz
janikvonrotz / SQL Cheat Sheet.md
Last active April 18, 2024 18:08
SQL Cheat Sheet#SQL#Markdown

SQL languages

DDL is short name of Data Definition Language, which deals with database schemas and descriptions, of how the data should reside in the database.

DML is short name of Data Manipulation Language which deals with data manipulation, and includes most common SQL statements such SELECT, INSERT, UPDATE, DELETE etc, and it is used to store, modify, retrieve, delete and update data in database.

DCL is short name of Data Control Language which includes commands such as GRANT, and mostly concerned with rights, permissions and other controls of the database system.

Datatypes

Text types

@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@withr
withr / server.R
Last active April 3, 2024 19:55
Encrypt password with md5 for Shiny-app.
library(shiny)
library(datasets)
Logged = FALSE;
PASSWORD <- data.frame(Brukernavn = "withr", Passord = "25d55ad283aa400af464c76d713c07ad")
# Define server logic required to summarize and view the selected dataset
shinyServer(function(input, output) {
source("www/Login.R", local = TRUE)
observe({
if (USER$Logged == TRUE) {
@lavoiesl
lavoiesl / process-mysqldump.c
Last active January 16, 2024 10:35
Add newlines before parenthesis for a SQL mysqldump
// gcc -O2 -Wall -pedantic process-mysqldump.c -o process-mysqldump
// Usage: cat dump.sql | process-mysqldump
// Or : process-mysqldump dump.sql
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#define BUFFER 100000
@bradfordcp
bradfordcp / README.md
Last active July 28, 2023 10:10
Setting up Apache Spark to use Apache Shiro for authentication of Spark Master dashboard.

Securing Apache Spark with Apache Shiro

  1. Download shiro-core-1.2.5.jar Apache Shiro Downloads
  2. Download shiro-web-1.2.5.jar Apache Shiro Downloads
  3. Note the location of the JAR files and shiro.ini. I placed it in the root of my Spark download
  4. Update the spark-env.sh file with the Shiro JARs and add an entry for the path where the shiro.ini resides
  5. Start the Spark master sbin/start-master.sh
  6. Navigate to the Spark master dashboard
  7. Authenticate with credentials in shiro.ini

Note this was developed / tested with Apache Spark 1.4.1, but should work with newer versions as well.

@trestletech
trestletech / server.R
Last active August 1, 2022 14:12
Sample Shiny application demonstrating usage of Shiny Server Pro's authentication feature to customize the app according to the privileges of the logged-in user.
library(shiny)
library(ggplot2)
# Get the current day of the month
dom <- 25
# Define the target for salespeople in our organization.
salesTarget <- 15000
# Set the seed so we always get the same data.
@rajeevkannav
rajeevkannav / pdf2htmlEX.sh
Last active March 29, 2022 18:28
Install CMake, pkg-config,GNU Getopt,GCC,poppler,fontforge,pdf2htmlEX in Ubuntu 15.05
#!/bin/bash
# Ubuntu Developer Script For pdf2htmlEx
# Created by Rajeev Kannav Sharma
# http://rajeevkannav.github.io/
#
#
# Downloads and configures the following:
#
# CMake, pkg-config
# GNU Getopt
import requests
import re
import sys
tags = ['', 'python', 'javascript', 'django', 'web', 'google', 'java', 'ajax',
'rails', 'plugin', 'android', 'cplusplus', 'mysql', 'dotnet', 'game',
'appengine', 'php', 'flash', 'jquery', 'database', 'gwt']
seen_tags = set(tags)
@hrbrmstr
hrbrmstr / app.R
Last active February 17, 2020 14:13
Example basic shinydashboard framework
library(shiny)
library(shinydashboard)
library(sparkline)
library(httr)
library(jsonlite)
library(data.table)
library(dplyr)
library(rvest)
library(magrittr)
library(XML)
@tevino
tevino / n2n_v2_osx_fix.diff
Created March 27, 2014 02:10
This fix an error about the function `tun_close` in n2n_v2(r7394 tested) when compiling on OS X
If you see the error message below, you may need this patch:
Undefined symbols for architecture x86_64:
"_tun_close", referenced from:
_tuntap_open in n2n.a(tuntap_osx.o)
ld: symbol(s) not found for architecture x86_64
# How to use
If you got the source code from official repository, like me:
svn co https://svn.ntop.org/svn/ntop/trunk/n2n