Skip to content

Instantly share code, notes, and snippets.

@byshen
byshen / tmux-cheatsheet.markdown
Created May 16, 2018 21:57 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

Vim Cheatsheet

Generally helpful stuff

Open a file for editing             :e path/to/file.txt
Return to Normal mode               ESC   or <CTRL>+C

Navigating around text

create a new dataframe by filter according to a column's value in another dataframe.

df1 = df[~df['row].isin(list)]
<?xml version="1.0" encoding="utf-8"?>
<!--
/* //device/apps/common/AndroidManifest.xml
**
** Copyright 2006, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
#include <vector>
#include <iostream>
using namespace std;
int partition(vector<int>& vec, int left, int right) {
int pivot = vec[left];
int l = left + 1;
int r = right;
while (l<=r) {
if (vec[l] > pivot && vec[r] < pivot) {

A list of mysql commands

use dbname;
show tables;

show table schema

@byshen
byshen / aclCheckLocal.patch
Created August 12, 2020 01:12
Enhance log messages for aclCheckLocal() related error messages
diff --git a/src/common/errmsg.h b/src/common/errmsg.h
index 2fa52f6..d3afbc4 100755
--- a/src/common/errmsg.h
+++ b/src/common/errmsg.h
@@ -51,7 +51,7 @@
# define HANDSHAKE_ERROR "Bad handshake"
# define ACCESS_DENIED_ERROR "Access to database denied"
# define NO_DB_ERROR "No Database Selected"
-# define PERM_DENIED_ERROR "Permission denied"
+# define PERM_DENIED_ERROR "Permission denied: the operation is only permitted to Admin_User on localhost."
@byshen
byshen / aclCheckPerm.patch
Created August 12, 2020 01:13
Enhance log messages related to aclCheckPerm()
diff --git a/src/msqld/main/process.c b/src/msqld/main/process.c
index 41a98bf..1d2dc18 100755
--- a/src/msqld/main/process.c
+++ b/src/msqld/main/process.c
@@ -102,12 +102,19 @@ extern char *packet;
**************************************************************************/
#define _checkWriteAccess(server) \
- if (!aclCheckPerms(WRITE_ACCESS) || server->config.readOnly) \
+ if (!aclCheckPerms(WRITE_ACCESS) ) \
xrandr --newmode "1600x900" 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync
xrandr --addmode Virtual1 "1600x900"
xrandr --output Virtual1 --mode "1600x900"
xrandr --newmode "2560x1440" 302.00 2560 2744 3016 3472 1400 1403 1413 1451 -hsync +vsync
xrandr --addmode Virtual1 "2560x1440"
xrandr --output Virtual1 --mode "2560x1440"
http://cs6035-warmup.gatech.edu:5000/tools