void *p = (void *)rand();
post @ 2019-06-09
1
2
3
4
5
composer create-project laravel/laravel blog 5.5.* --prefer-dist //5.5.*是LTS版本
composer require laravelcollective/html=5.5.* //Form支持
composer require barryvdh/laravel-ide-helper //ida 支持
php artisan vendor:publish --provider="Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider" --tag=config //导出配置
php artisan ide-helper:generate
1
2
Collective\Html\HtmlServiceProvider::class,
Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
1
'From' => Illuminate\Support\Facades\Facade::class,
1
2
config/ide-helper.php:
'include_fluent' => true,
阅读此文
post @ 2018-12-24

vs2017 github 添加项目文件时忽略指定文件。

各种坑。
vs2017集成了与github
点几下就可以把项目丢到github 比较方便
添加项目文件时想排除一些关键的 比如数据库连接阿 什么的 可是他不管你。
笨办法;文件移动目录外
.gitignore文件添加你需要忽略的文件就好了

1
2
3
4
5
6
*.a # 忽略所有 .a 结尾的文件
!lib.a # 但 lib.a 除外
/TODO # 仅仅忽略项目根目录下的 TODO 文件,不包括 subdir/TODO
build/ # 忽略 build/ 目录下的所有文件
doc/*.txt # 会忽略 doc/notes.txt 但不包括 doc/server/arch.txt
test.txt
阅读此文

WIN10 + vmware + WIN10_guest kdnet调试环境设置

官方介绍:

拷贝后运行得知:

1
2
3
4
Failed to parse the busparams:PCI 11 0 0
Network debugging is not supported on any of the NICs in this machine.
KDNET supports NICs from Intel, Broadcom, Realtek, Atheros, Emulex, Mellanox
and Cisco.

so:

1
2
bcdedit /debug on
bcdedit /dbgsettings net hostip:192.168.0.xxx port:65535

Microsoft Store -> Search -> Windbg PreView

Attach to kernel

net

port 65535 key = xxxxxx(上面cmd会给你的)

Target = guest ip

reboot guest

阅读此文
post @ 2018-10-07

js嵌套razor语法 例子:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<script>
$(function () {
@{
var islogin = this.Html.ViewContext.HttpContext.Session.GetString("Manage");
if (islogin == null)
{
<text>
{
view.gohome();
}
</text>
}
}
});
</script>

页面生成如下:

1
2
3
4
5
6
7
8
9
<script>
$(function () {
{
view.gohome();
}
});
</script>

session使用:
nuget: Microsoft.AspNetCore.Session

1
2
3
4
5
6
7
8
9
10
11
12
this.HttpContext.Session
public static void Set<T>(ISession session, string key, T value)
{
session.SetString(key, JsonConvert.SerializeObject(value));
}
public static T Get<T>(ISession session, string key)
{
var value = session.GetString(key);
return value == null ? default(T) :
JsonConvert.DeserializeObject<T>(value);
}

建议不要使用asp.net core mvc了
测试
只是个登陆页面 什么操作都没有 so 还是少用吧

阅读此文
post @ 2018-10-07
  • 不要运行大任务! 不然会后悔的! win10 subsystem for ubuntu 16.04!
阅读此文
post @ 2018-10-05

记录下,不用每次去查

1
2
3
4
5
6
7
8
9
10
11
12
13
sudo apt install mysql-server
sudo netstat -tap | grep mysql
mysql_secure_installation //~mysql/bin/mysql_secure_installation
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf //bind-address
mysql-u root -p
CREATE USER 'username'@'%' IDENTIFIED BY 'passwd';//创建一个用户 可以远程访问
CREATE DATABASE mydb; //创建mydb这个库
GRANT SELECT, INSERT ON mydb.* TO 'username'@'%';
flush privileges;
sudo service mysql restart

阅读此文

Jexus官方介绍 jexus
为了方便:
直接安装jexus独立版 for ubuntu

1
sudo curl https://jexus.org/release/x64/install.sh|sudo sh

配置就不需要了调试环境:

1
2
cd /usr/jexus/siteconf
vim demo

1
2
3
4
port = 8080 //端口
hosts = * //没有域名 可看官方介绍
root = /home/ubuntu/8080root //www目录
indexs = index.html
1
2
cd ..
sudo ./jws restart

上面就配置好了
打开vs (ver = 2017)
发布
上传至www目录下
访问即可

阅读此文
post @ 2018-09-25

微软官方安装方法

1
2
3
4
5
wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install aspnetcore-runtime-2.1
后发现:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
root@DESKTOP-ME54PJV:/home/xxoo# sudo apt-get install aspnetcore-runtime-2.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
dotnet-sdk-2.1 : Depends: dotnet-runtime-2.1 (>= 2.1.4) but it is not going to be installed
Depends: aspnetcore-runtime-2.1 (>= 2.1.4) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
  • 解决方法:
    1
    2
    apt install aptitude
    aptitude install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
root@DESKTOP-ME54PJV:/home/xxoo# sudo apt-get install aspnetcore-runtime-2.1
The following NEW packages will be installed:
aspnetcore-runtime-2.1{a} dotnet-host{a} dotnet-hostfxr-2.1{a} dotnet-runtime-2.1{a} dotnet-runtime-deps-2.1{ab} dotnet-sdk-2.1
0 packages upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 132 MB of archives. After unpacking 380 MB will be used.
The following packages have unmet dependencies:
dotnet-runtime-deps-2.1 : Depends: libicu55 which is a virtual package and is not provided by any available package
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) aspnetcore-runtime-2.1 [Not Installed]
2) dotnet-runtime-2.1 [Not Installed]
3) dotnet-runtime-deps-2.1 [Not Installed]
4) dotnet-sdk-2.1 [Not Installed]
Accept this solution? [Y/n/q/?] Y
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
libicu55 没有源可以提供
/etc/apt/sources.list中加入
deb http://security.ubuntu.com/ubuntu xenial-security main
apt update
apt install aspnetcore-runtime-2.1
即可
root@DESKTOP-ME54PJV:/home/xxoo# dotnet --version
2.1.402
阅读此文
post @ 2018-07-30
python安装pyaudio,需要portaudio安装成功后,python提示libportaudio.so.2找不到。
执行export LD_LIBRARY_PATH=xxxx后 source发现还是不行
export -p后发现有这个目录。/usr/local/bin

python还是不行。 未知了。
最后解决方法如下:
cd /etc/ld.so.conf.d
touch portaudio.conf
vi portaudio.conf
/usr/local/bin

ldconfig
成功!
阅读此文
post @ 2018-03-07
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
ExitProcess proto
MessageBoxA proto
.data
lpStr BYTE "Hello World!",0
lpTitle BYTE "Title",0
.code
;x64传参为 rcx rdx r8 r9 rsp+28
main proc
mov rcx,0;hwnd
mov rdx,offset lpStr
mov r8,offset lpTitle
mov r9,0
call MessageBoxA
mov rcx,0
call ExitProcess
main endp
end

以上为src.asm

需要用到ml64 以及kernel32.lib user32.lib
编译命令,路径请自行核对:
“C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\ml64.exe” C:\Users\Unsped\Desktop\ASM\src.asm /link /DYNAMICBASE:NO /SUBSYSTEM:WINDOWS /ENTRY:main /DYNAMICBASE “C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64\kernel32.Lib” “C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64\User32.Lib”

/DYNAMICBASE:NO 动态基质
/SUBSYSTEM:WINDOWS windows非console程序
/ENTRY:main 入口为main 否者会报错:LINK : error LNK2001: 无法解析的外部符号 WinMainCRTStartup 肯定有其他方法解决,就不深究了。
/DYNAMICBASE 指定需要的库文件

至此,编译完成
Microsoft (R) Macro Assembler (x64) Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.

Assembling: C:\Users\Unsped\Desktop\ASM\src.asm
Microsoft (R) Incremental Linker Version 14.00.24215.1
Copyright (C) Microsoft Corporation. All rights reserved.

/OUT:src.exe
src.obj
/DYNAMICBASE:NO
/SUBSYSTEM:WINDOWS
/ENTRY:main
/DYNAMICBASE
“C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64\kernel32.Lib”
“C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64\User32.Lib”

1
2
3
4
5
6
7
8
9
10
11
12
13
000000013F451000 <src.EntryPoint> | 48 C7 C1 00 00 00 00 | mov rcx,0 |
000000013F451007 | 48 BA 00 30 45 3F 01 00 00 00 | movabs rdx,src.13F453000 | 13F453000:"Hello World!"
000000013F451011 | 49 B8 0D 30 45 3F 01 00 00 00 | movabs r8,src.13F45300D | 13F45300D:"Title"
000000013F45101B | 49 C7 C1 00 00 00 00 | mov r9,0 |
000000013F451022 | E8 13 00 00 00 | call <src.MessageBoxA> |
000000013F451027 | 48 C7 C1 00 00 00 00 | mov rcx,0 |
000000013F45102E | E8 01 00 00 00 | call <src.RtlExitUserProcess> |
000000013F451033 | CC | int3 |
000000013F451034 <src.RtlExitUserProcess | FF 25 C6 0F 00 00 | jmp qword ptr ds:[<&RtlExitUserProcess>] |
000000013F45103A <src.MessageBoxA> | FF 25 D0 0F 00 00 | jmp qword ptr ds:[<&MessageBoxA>] |
000000013F451040 | 00 00 | add byte ptr ds:[rax],al |
000000013F451042 | 00 00 | add byte ptr ds:[rax],al |
000000013F451044 | 00 00 | add byte ptr ds:[rax],al |

给有需要的人。

阅读此文
⬆︎TOP