Skip to content

Instantly share code, notes, and snippets.

View CoolCat467's full-sized avatar
:octocat:
Fixing various projects

CoolCat467 CoolCat467

:octocat:
Fixing various projects
  • Somewhere in North America, USA, Earth
  • 22:27 (UTC -05:00)
  • X @CCat467
View GitHub Profile
// cc -w -include time.h -o qlock qlock.c // MIT Copyright (c) Tsoding
char*s="// cc -w -include time.h -o qlock qlock.c // MIT Copyright (c) Tsoding\n"
"char*s=\"?\";x,y,d[8],i,dx;f[]={31599,19812,14479,31207,23524,29411,29679,\n"
"30866,31727,31719,1040};char*so,*si;p(ch){i=x/2/(3+2);dx=x/2%(3+2);if(i<8&&(y-5)\n"
"/2<5&&dx<3&&(f[d[i]]>>((5-(y-5)/2-1)*3+dx))&1)printf(\"\\033[1;41;30m%c\\033[0m\",ch\n"
");else printf(\"%c\",ch);if(ch=='\\n'){y+=1;x=0;}else x+=1;}gd(){time_t t=time(NULL);struct\n"
" tm*tm=localtime(&t);d[0]=tm->tm_hour/10;d[1]=tm->tm_hour%10;d[2]=10;d[3]=tm->tm_min\n"
"/10;d[4]=tm->tm_min%10;d[5]=10;d[6]=tm->tm_sec/10;d[7]=tm->tm_sec%10;}main(){for\n"
"(gd();;printf(\"\\n\\033[%dA\\033[%dD\",y+1,x),sleep(1),gd())for(so=s,x=0,y=0;*so;so++\n"
")if(*so==63)for(si=s;*si;si++)switch(*si){case'\\n':p('\\\\');p('n');p('\"');p('\\n')\n"
@Therises
Therises / fix_mic_lenovo320.md
Last active May 24, 2024 07:29
Fix microphone on Lenovo IdeaPad 320 on Ubuntu 18.04

In /usr/share/pulseaudio/alsa-mixer/paths/analog-input-internal-mic.conf and /usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf:

  • Under [Element Internal Mic Boost] set volume to zero.
  • Under [Element Int Mic Boost] set volume to zero.
  • Under [Element Mic Boost] set volume to zero

Find your source name from the following command; mine is alsa_input.pci-0000_00_1f.3.analog-stereo

  $ pacmd list-sources | grep 'name:.*input'

Edit /etc/pulse/default.pa and add the following lines, where INPUT_NAME is name of the input source from above step: