Skip to content

Instantly share code, notes, and snippets.

× π − √ ∠ · ] [ → Δ θ °C → ← © Ⓡ ∂
Relational operators:
≠ ≥ ≤ ±
• Bullet
≈ ⊕
@tedz2usa
tedz2usa / Procedure for Resetting MySQL root password on Ubuntu 18.04 LTS.MD
Last active May 22, 2020 17:55
Procedure for Resetting MySQL root password on Ubuntu 18.04 LTS

Procedure for Resetting MySQL root password on Ubuntu 18.04 LTS

There is a way to start MySQL in a safe mode with the SUDO command, bypassing user authentication. When we start the MySQL Server in this mode, we can enter the mysql shell without a password, and have access privileges to all databases and tables. From there, we'll be able to reset the mysql root user password.


First, stop the existing MySQL Server:

@tedz2usa
tedz2usa / Copy-Paste Convert to Plain Text Strategy
Last active September 26, 2022 00:44
Copy/Paste Convert to Plain Text Strategy
Windows:
Use tenclips
Assign Ctrl+Shift+V Shortcut.
Mac:
Use Keyboard Maestro
Assign Ctrl+Shift+V hotkey to perform this 1 action:
Insert text by pasting
(Choose Insert Token > Clipboard > System Clipboard, which inserts the variable):
@tedz2usa
tedz2usa / Emacs Shortcut Notes
Last active April 26, 2019 15:54
Emacs Shortcut Notes
Move to beginning or end of line: [HOME] or [END]
Move by word: [ALT]+[F], [ALT]+[B]
Disable line wrapping: M-x toggle-truncate-lines
@tedz2usa
tedz2usa / Installing SML-NJ on Ubuntu 18.04
Last active April 8, 2024 13:37
Installing SML-NJ on Ubuntu 18.04
Installation Tips for SML/NJ on Ubuntu 18.04
Ted Zhu
First, follow the steps outlined in the SML/NJ installation instructions for Unix:
http://smlnj.org/install/
The final step,
$ config/install.sh
Last Updated for Quartus II 18.1.0
Megafunctions
Set Generate Netlist to CHECKED.
Disable Advanced Fitter
Assignments => Settings => Compiler Settings => Advanced Settings (Fitter)
Set "Advanced Physical Optimization" to OFF.
; Win+N for new notepad window
; Win+S for new Sublime Text Window
#n::
Run, Notepad.exe
return
#s::
; The "hide" portion is to prevent a console window from opening when running
#n::
Run, Notepad.exe
return
!Media_Prev::
Send !{F4}
return
!j::
Send {Left}
http://stackoverflow.com/questions/1056411/how-to-pass-variable-number-of-arguments-to-printf-sprintf
void Error(const char* format, ...)
{
va_list argptr;
va_start(argptr, format);
vfprintf(stderr, format, argptr);
va_end(argptr);
}
If you want to manipulate the string before you display it and really do need it stored in a buffer first, please please please use vsnprintf instead of vsprintf. vsnprintf will prevent an accidental buffer overflow error.
http://stackoverflow.com/questions/1641182/how-can-i-catch-a-ctrl-c-event-c
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
void my_handler(int s){
printf("Caught signal %d\n",s);
exit(1);