root

Android device rooted check

本小妞迷上赌 提交于 2020-01-04 14:11:48
问题 I want to check my device is rooted or not. When I try this code below in real device is not rooted, its ok. But Non rooted emulator break in this line if (new File(path).exists()) return true; "/system/xbin/su" path is exists. private static boolean isRooted() { String[] paths = { "/system/app/Superuser.apk", "/sbin/su", "/system/bin/su", "/system/xbin/su", "/data/local/xbin/su", "/data/local/bin/su", "/system/sd/xbin/su", "/system/bin/failsafe/su", "/data/local/su", "/su/bin/su"}; for

Windows下安装MySQL详细教程(附详细的图文解析mysql安装教程)

≡放荡痞女 提交于 2020-01-04 09:37:06
Windows下安装MySQL详细教程   1、安装包下载    2、安装教程     (1)配置环境变量     (2)生成data文件     (3)安装MySQL     (4)启动服务     (5)登录MySQL     (6)查询用户密码     (7)设置修改用户密码     (8)退出 详细的阅读学习请点我 1、安装包下载。 下载地址:https://dev.mysql.com/downloads/mysql/ 点击下载之后,可以选择注册Oracle账号,也可以跳过直接下载。 下载完成后,选择一个磁盘内放置并解压。 2 安装教程 (1)配置环境变量 变量名:MYSQL_HOME 变量值:E:mysql-5.7.20-winx64 (2)生成data文件 以管理员身份运行cmd 进入E:pythonmysqlmysql-8.0.12-winx64bin>下 执行命令:mysqld –initialize-insecure –user=mysql 在E:pythonmysqlmysql-8.0.12-winx64bin目录下生成data目录 (3) 安装MySQL 继续执行命令:mysqld -install (4)启动服务 继续执行命令:net start MySQL (5)登录MySQL 登录mysql:(因为之前没设置密码,所以密码为空,不用输入密码,直接回车即可

How can I execute “su” on Android?

孤街醉人 提交于 2020-01-04 02:03:07
问题 process = Runtime.getRuntime().exec("su"); os = new DataOutputStream(process.getOutputStream()); os.writeBytes(command + "\n"); os.writeBytes("exit\n"); os.flush(); process.waitFor(); The system says: "07-06 11:01:34.337: I/System.out(3864): su: uid 10170 not allowed to su" I execute "adb root" in my terminal :~/android/android-sdk/platform-tools$ ./adb root adbd is already running as root Any ideas? 回答1: It looks like your adb is running as root, but you only have the stock 'su' tool. You

【48】gdb 查看core堆栈信息

醉酒当歌 提交于 2020-01-04 00:13:04
1、查看系统资源设置情况 用户态程序Segmentation fault会生成core文件,如果没有生成core文件,则使用ulimit命令显示系统资源的设置,看看core文件大小设置,可以看到现在core file size是0,无法生成core文件 root@cd-106:~/pcieinject# ulimit unlimited root@cd-106:~/pcieinject# ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 319992 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t)

SpringDataJpa Specification接口用法

若如初见. 提交于 2020-01-03 19:58:43
原文链接:https://blog.csdn.net/bird_tp/article/details/83654789 Specification是springDateJpa中的一个接口,用于当jpa的一些基本CRUD操作的扩展,即spring jpa的复杂查询接口。Criteria 查询,是一种类型安全和更面向对象的查询。而Spring Data JPA支持JPA2.0的Criteria查询,相应的接口是JpaSpecificationExecutor。 Specification接口中只定义了如下一个方法: Predicate toPredicate ( Root<T> root, CriteriaQuery<?> query, CriteriaBuilder cb ) ; 先简单了解JPA2.0的Criteria查询: Criteria 查询是以元模型的概念为基础的,元模型是为具体持久化单元的受管实体定义的,这些实体可以是实体类,嵌入类或者映射的父类。 CriteriaQuery接口:代表一个specific的顶层查询对象,它包含着查询的各个部分,比如:select 、from、where、group by、order by等注意:CriteriaQuery对象只对实体类型或嵌入式类型的Criteria查询起作用。 Root接口:代表Criteria查询的根对象

docker制作镜像(apache,systemctl , ssh)

百般思念 提交于 2020-01-03 19:45:41
Docker制作镜像 本章结构 Docker镜像的分层 Dockerfile基本创建方法 Dockerfile创建各种应用容器 Docker镜像的分层 Dockerfile中的每个指令都会创建一个新的镜像层 镜像层将被缓存和复用 当Dockerfile的指令修改了,复制的文件变化了,或者构建镜像时指定的变量不同了,对应的镜像缓存就会失效 某一层的镜像缓存失效之后,它的镜像层缓存都会失效 镜像层是不可变的,如果在某一层中添加一个文件,然后在下一层中删除它,则镜像中依然会包含该文件 Docker镜像的创建 Docker镜像 是应用发布的标准格式 可支撑一个Docker容器的运行 Docker镜像的创建方法 基于已有镜像创建 基于本地模板创建 基于Dockerfile创建 基于已有镜像创建 将容器里面运行的程序及运行环境打包生成新的镜像 docker create -it centos /bin/bash docker commit -m "new" -a "daoke" a19597abf62d daoke:centos -m:说明信息 -a:作者信息 -p:生成过程中停止容器的运行 基于本地模板创建 通过导入操作系统模板文件生成新的镜像 使用wget命令导入为本地镜像 wget http://123.56.134.27/pub/package/LAMP-C7/nginx-1.12.0

linux练习

痞子三分冷 提交于 2020-01-03 08:44:00
1.查看linux的path变量 环境变量 echo $PATH 3.递归创建文件夹 mkdir -p test/{a,c,d} mkdir -p a/c b/k 4.显示/tmp/下所有内容详细信息 ls -la /tmp 7.查看/etc/passwd的内容并且打印行号 cat -n /etc/passwd 10.如何用echo清空一个文件? echo "" > aa.txt 11.复制/tmp/下所有内容到/home cp -r /tmp/* /home 12.重命名test.py为my.py mv test.py my.py 13.强制删除/tmp下内容 rm -r /tmp/* 14.找到服务器上的settings.py find / -name settings.py 15.找到/etc下的网卡配置文件,(提示网卡配置文件名是ifc开头) (这里题目,请先cp /etc/passwd /tmp/ 拷贝文件) find /etc -name ifc* 16.过滤出/tmp/passwd下有关root的信息 grep "root" /tmp/passwd 17.过滤出/tmp/passwd下除了/sbin/nologin的信息,且打印行号 grep -vn "/sbin/nologin" /tmp/passwd 18.查看/tmp/passwd前 25行 head -25

How to refer back to public_html root file using include after going up one file directory out of public_html

痞子三分冷 提交于 2020-01-03 03:05:29
问题 Based on some exceptionally helpful tips, I am using the following code to include PHP files outside my root directory which looks similar to this: define('WEB_ROOT', __DIR__); define('APP_ROOT', dirname(__DIR__)); define('PHP_ROOT', APP_ROOT . DIRECTORY_SEPARATOR . 'application'); include(PHP_ROOT . DIRECTORY_SEPARATOR . 'bootstrap.php'); My question is this, lets say for example you include the code bootstrap.php as per what you have above. What if that PHP file bootstrap then had its own

Run PHP shell_exec() like root user

a 夏天 提交于 2020-01-03 02:54:11
问题 I building one PHP application where I create command line functionality for Linux debian Jessie. All works fne but I need to be able use some commands like root user. Is there a way to use shell_exec() or similar command to access like root user via PHP? Idea of this command line is to people who have access to that server can handle with it over internet from any place or device. Here is image of console: 回答1: Executing commands as root via PHP will leave yourself wide open to all sorts of

App cannot be installed after bad uninstall

不打扰是莪最后的温柔 提交于 2020-01-03 02:08:11
问题 Using Eclipse, or even by using an Exported Apk, The App Refuses to install, LogCat says : 12-03 21:25:34.310: W/PackageManager(1073): Package com.app.example signatures do not match the previously installed version; ignoring! But the Problem is that I have already uninstalled the App before installing it again, I have tried to reboot in Recovery > Wipe Cache/Wipe Dalvik Cache with no luck, I am running LolliPop 5.1 & I Removed the Guest Account too with no luck. The Apk install fine on