Skip to content

Instantly share code, notes, and snippets.

@cuu
cuu / c7_install_tensorflow.sh
Created November 28, 2016 14:30
centos7 install tensorflow
sudo yum -y install epel_release
sudo yum -y install gcc gcc-c++ python-pip python-devel atlas atlas-devel gcc-gfortran openssl-devel libffi-devel
pip install --upgrade virtualenv
virtualenv --system-site-packages ~/venvs/tensorflow
source ~/venvs/tensorflow/bin/activate
pip install --upgrade numpy scipy wheel cryptography #optional
#visit https://www.tensorflow.org/versions/master/get_started/os_setup.html#pip-installation to get the latest url
#and only cpu version I need
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl
@cuu
cuu / server.go
Created February 3, 2019 08:23
godbus server example
package main
import (
"fmt"
"github.com/godbus/dbus"
"github.com/godbus/dbus/introspect"
"os"
//"encoding/xml"
)
@cuu
cuu / simple_agent.go
Created February 5, 2019 14:01
simple_agent.go
package main
import (
"fmt"
"log"
"os"
"strings"
"github.com/godbus/dbus"
// "github.com/godbus/dbus/introspect"
@cuu
cuu / expand_rootfs
Last active May 26, 2023 05:30
expand_rootfs for gameshell
#!/bin/sh
### BEGIN INIT INFO
# Provides: expand_rootfs
# Required-Start:
# Required-Stop:
# Default-Start: 3
# Default-Stop:
# Short-Description: Expand the root filesystem to fill partition
# Description:
### END INIT INFO
#include <stdio.h>
#include <stdlib.h>
#include <SDL2/SDL.h>
int main() {
int windowHeight = 240;
int windowWidth = 320;
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
#include <stdio.h>
#include <stdlib.h>
#include <SDL2/SDL.h>
int main() {
int windowHeight = 240;
int windowWidth = 320;
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
package main
import (
"fmt"
"math/rand"
"github.com/veandco/go-sdl2/sdl"
"os"
)
var winTitle string = "Go-SDL2 Render"
@cuu
cuu / simple_irc.c
Created May 3, 2019 13:34
simple_irc.c
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <netdb.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <unistd.h>
@cuu
cuu / retroarch-core-options.cfg
Created August 6, 2019 05:17
gameshell v0.4 mame 2003 plus fix for gamepad
mame2003-plus_analog = "digital"
mame2003-plus_art_resolution = "1"
mame2003-plus_brightness = "1.0"
mame2003-plus_cheat_input_ports = "disabled"
mame2003-plus_core_save_subfolder = "enabled"
mame2003-plus_core_sys_subfolder = "enabled"
mame2003-plus_dcs_speedhack = "disabled"
mame2003-plus_deadzone = "20"
mame2003-plus_display_artwork = "enabled"
mame2003-plus_display_setup = "disabled"
@cuu
cuu / cut_video_fragments.sh
Created September 4, 2019 11:30
微信小视频切割脚本
#!/bin/bash
FILENAME=${1}
MIN_FRAGMENT_LENGTH=300
if [ ! -f "${FILENAME}" ]; then
echo "FILE NOT FOUND: $FILENAME"
exit 1
fi