Skip to content

Instantly share code, notes, and snippets.

@paulczar
paulczar / gist:5493708
Created May 1, 2013 04:16
Patch to fix libiconv for glibc >= 2.16 - originally found at http://www.itkb.ro/kb/linux/patch-libiconv-pentru-glibc-216
--- srclib/stdio.in.h.orig 2011-08-07 16:42:06.000000000 +0300
+++ srclib/stdio.in.h 2013-01-10 15:53:03.000000000 +0200
@@ -695,7 +695,9 @@
/* It is very rare that the developer ever has full control of stdin,
so any use of gets warrants an unconditional warning. Assume it is
always declared, since it is required by C89. */
-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+#endif
@Aufree
Aufree / ImagePreview.js
Created October 10, 2014 13:07
Preview image before uploading in jquery
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function(e) {
$('#previewHolder').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
}
@jwalanta
jwalanta / OpenWrt detect new device and send text message.md
Last active July 2, 2024 18:37
Detect new network devices connecting to OpenWrt and send text message
@Brainiarc7
Brainiarc7 / ffmpeg-qsv-enabled-build-ubuntu-18.04lts-testbed.md
Last active July 14, 2024 13:29
This gist will generate an Intel QSV-enabled FFmpeg build using the open source Intel Media SDK. Testbed used: Ubuntu 18.04LTS. A fallback is also provided for the intel vaapi driver where needed.

Build FFmpeg with Intel's QSV enablement on an Intel-based validation test-bed:

Build platform: Ubuntu 18.04LTS

Ensure the platform is up to date:

sudo apt update && sudo apt -y upgrade && sudo apt -y dist-upgrade

Install baseline dependencies first (inclusive of OpenCL headers+)

@xmeng1
xmeng1 / wsl2-network.ps1
Created July 14, 2019 06:50
WSL2 Port forwarding port to linux
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}