Ubuntu

Mingw-w64 toolchain for Bazel (Ubuntu 20.04.1 )

元气小坏坏 提交于 2021-01-29 06:58:17
问题 I am trying to create my toolchain for mingw-w64 on Ubuntu with Bazel. I am following this tutorial: https://docs.bazel.build/versions/master/tutorial/cc-toolchain-config.html. However, when I try to adapt the compilers paths to the paths of my mingw64 installation i get the following error: bazel build --config=mingw_config -s //main:hello-world --verbose_failures Starting local Bazel server and connecting to it... INFO: Analyzed target //main:hello-world (16 packages loaded, 46 targets

how to stop a daemon

♀尐吖头ヾ 提交于 2021-01-29 05:33:17
问题 I am executing a file as a daemon process. How can I stop the daemon? int main(int argc, char **argv) { if ( argc != 5 ) { printf ("Usage: %s <server> <nick> <channel> <logging>\n", argv[0]); return 1; } char *startPath = malloc(sizeof(char) *100); strcpy(startPath,"/home/.../start"); int child_pnr; if(daemonisieren() != 0) { printf("damonization not possible"); exit(0); } printf("I am a damon \n"); if((child_pnr = fork())==0) { execve(startPath,argv); } else if (child_pnr > 0) { printf("I am

Use ImageMagick to Generate Image from Text?

◇◆丶佛笑我妖孽 提交于 2021-01-29 05:30:37
问题 I'm trying to use ImageMagick to create thumbnail images that are 3840 x 2160. I need the image to have a black background and white text. The text should be centered vertically and horizontally. I want to be able to set a font size, but if the text would extend off the image, automatically decrease the font size so it fits with some amount of padding on the left and right. I will be doing this in bulk with several hundred thousand images. From what I've been able to find, it looks like you

Installing pygame on ubuntu

一笑奈何 提交于 2021-01-29 04:42:33
问题 I am trying to install pygame on an Ubuntu 16.04 system. My default python is 2.7.12. I opened terminal and tried: sudo apt-get install python-pygame I got this message: 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

Packer/Amazon EBS/Ubuntu - Inconsistent PPAs

北城以北 提交于 2021-01-29 04:21:06
问题 TL;DR; Packer is inconsistently ignoring the AWS Ubuntu PPAs, which is breaking my builds. Why? I have a job in Jenkins that uses Packer's Amazon EBS builder to create an AMI, based on the official Ubuntu 14.04 AMI. For some reason, every so often, the apt-gets that I use in the provisioner fail to use AWS' own PPAs, and only uses those at ubuntu.com: ==> amazon-ebs: Prevalidating AMI Name... ==> amazon-ebs: Inspecting the source AMI... ==> amazon-ebs: Creating temporary keypair: packer

Factorial function in x86 NASM assembly goes wrong

会有一股神秘感。 提交于 2021-01-29 01:54:26
问题 I'm learning assembly language using x86 NASM. I wanted to write a simple recursive factorial function to which I am passing one parameter using EAX register. After that, I want to print my result on the screen but nothing happens. After sitting and staring on my computer I don't have any clue what is wrong with my code. Can you guys help newbie with this problem? I know that the prologue and epilogue of factorial funtion is not required due I'm not using stack but for me code is more

解决Ubuntu系统“无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系”的有效方法

。_饼干妹妹 提交于 2021-01-28 22:11:18
解决Ubuntu系统“无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系”的有效方法 ubuntu系统下安装东西,很多时候会出现版本冲突的情况: 有效的解决方法是使用aptitude来帮助降级。 首先安装aptitude 而后使用aptitude来安装前面有冲突的构建,同样也是要使用root的。 在安装的时候,第一个界面是问你,是否接受“不更新”的操作,一定要选"N" 后面则都是"Y",一般情况下能够解决问题。 当然,如果你安装aptitude的时候遇到冲突,就要想其他办法,比如源码编译的方法安装aptitude。 感谢阅读至此,希望有所帮助。 来源: oschina 链接: https://my.oschina.net/u/124197/blog/4932248

Mingw64-w64 attribute(format) and <cinttypes> header

浪子不回头ぞ 提交于 2021-01-28 19:02:12
问题 I'm having serious trouble getting cinttypes to work properly on mingw64-w64 when cross-compiling. I've gotten it down to a minimal(ish) example that runs in docker. inttypes_test.cpp #include <cstdio> #include <cstddef> #include <cstdint> #include <cinttypes> #include <cstdarg> __attribute__((format(printf, 1, 2))) static void myPrintf(const char* fmt, ...) { va_list args; va_start(args, fmt); vprintf(fmt, args); va_end(args); } int main(int argc, const char** argv) { int i32 = 5; int64_t

foo.jar is not marked as executable

不打扰是莪最后的温柔 提交于 2021-01-28 18:05:48
问题 I am new to Ubuntu. I am trying to make a simple Java swing app(lets call it foo) that displays a hello message followed by a user name.I am using Eclipse .Till here everything works fine.When I press the "Run" button my app shows app without a problem.Now I export my app as a runnable jar but when I try to double click the generated jar to execute the following message: Blocked: /usr/bin/java -jar The file 'home/user/java projects/foo.jar' is not marked as executable. However if I run this

Ubuntu网络配置及shell脚本

南楼画角 提交于 2021-01-28 17:49:49
Ubuntu网络配置及shell脚本 一、Ubuntu系统网络配置 1.1 修改主机名 ​ 使用hostnamectl命令修改主机名 #测试环境 #uname -a Linux dl-homework.linux.com 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux #计算机名字永久生效 #hostnamectl set-hostname changename root@dl-homework ~]#hostname changename ​ 更改配置文件/etc/hostname修改主机名 #vim /etc/hostname #更改配置文件,将计算机名称改成abc,重启生效 abc #hostname abc # 计算机名称临时更改成abc 1.2 更改网卡名称 将网卡设备名称ens33更改回eth0 #增加net.ifnames=0 biosdevname=0这两个参数 #vim /etc/default/grub GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0" #生成grub.cfg #grub-mkconfig -o /boot/grub/grub.cfg Sourcing file