Skip to content

Instantly share code, notes, and snippets.

View martian17's full-sized avatar
🛰️
Working from home

Yutaro Yoshii martian17

🛰️
Working from home
View GitHub Profile
@martian17
martian17 / my-display-problem-var-log-Xorg.0.log
Created December 29, 2020 04:43
my-display-problem-var-log-Xorg.0.log
$ cat /var/log/Xorg.0.log
[ 4.974]
X.Org X Server 1.20.8
X Protocol Version 11, Revision 0
[ 4.974] Build Operating System: Linux 4.15.0-124-generic x86_64 Ubuntu
[ 4.974] Current Operating System: Linux ulap1 5.4.0-58-generic #64-Ubuntu SMP Wed Dec 9 08:16:25 UTC 2020 x86_64
[ 4.974] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.4.0-58-generic root=UUID=7f2ab20f-c4bd-42fa-8110-95d0cd844432 ro quiet splash
[ 4.974] Build Date: 30 November 2020 05:56:33PM
[ 4.974] xorg-server 2:1.20.8-2ubuntu2.6 (For technical support please see http://www.ubuntu.com/support)
[ 4.974] Current version of pixman: 0.38.4
@martian17
martian17 / my-display-problem-etc-default-grub
Created December 29, 2020 04:47
my-display-problem-etc-default-grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=-1
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
@martian17
martian17 / my-display-problem-glxinfo-b-celeron-intel-driver
Created December 31, 2020 04:17
my-display-problem-glxinfo-b-celeron-intel-driver
name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
Vendor: Intel Open Source Technology Center (0x8086)
Device: Mesa DRI Intel(R) HD Graphics 2000 (SNB GT1) (0x106)
Version: 20.0.8
Accelerated: yes
Video memory: 1536MB
Unified memory: yes
@martian17
martian17 / type-echo.c
Created May 31, 2021 08:22
type-echo.c
// # include <stdio.h>
# include <stdlib.h>
# include <unistd.h>
int main(int argc, char *argv[]){
// printf("%d\n", STDIN_FILENO);
// printf("%d\n", STDOUT_FILENO);
char buff[2];// 2 in case I want to printf
while(1){
read(0, buff, 1);
@martian17
martian17 / hello.c
Created June 7, 2021 14:11
hello world program using write syscall
//# include <stdio.h>
// for testing purposes only
# include <stdlib.h>
# include <unistd.h>
# include <sys/time.h>
# include <time.h>
int lengthUntilNull(char * str){
int i = 0;
while(str[i] != 0){
@martian17
martian17 / nepleague.js
Created June 8, 2021 12:11
このツイートに基づいて書いてみました。https://twitter.com/2_wykipedia/status/1402160697497165826
var primes = [];
var cond = [1];
for(var i = 2; i < 335; i++){
var flag = true;
var primeFlag = true;
for(var j = 0; j < primes.length; j++){
var prime = primes[j];
if(prime*prime > i)break;
primeFlag = primeFlag && (i%prime !== 0)
// flag === true if not divisible by any prime
@martian17
martian17 / murica_day.js
Created July 4, 2021 22:39
happy murica day!
let txt =
`bwbwbwbwbwbwbwbwbrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
bbbwbwbwbwbwbwbwbbsssssssssssssssssssssssssssssssssss
bwbwbwbwbwbwbwbwbrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
bbbwbwbwbwbwbwbwbbsssssssssssssssssssssssssssssssssss
bwbwbwbwbwbwbwbwbrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
bbbwbwbwbwbwbwbwbbsssssssssssssssssssssssssssssssssss
bwbwbwbwbwbwbwbwbrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
@martian17
martian17 / mac.js
Last active December 27, 2021 10:17
random mac generator
Array(6).fill(0).map(a=>("00"+Math.floor(Math.random()*256).toString(16)).substr(-2).toUpperCase()).join(":")
@martian17
martian17 / asdf.js
Last active January 12, 2022 05:15
//array of the object
let Arrayobject=[
{
section:'Dynamic Table',
marks:10
},
{
section:'Intellij Usage',
marks:10
},
function range_include(a,b){
let arr = [];
for(; a <= b; a++){
arr.push(a);
}
return arr;
}
//array of the object
let Arrayobject = range_include(1,10).map((i)=>{